Skip to content

Commit 736db6c

Browse files
committed
Version upgrade and more BETA ui changes
1 parent 31a3cf8 commit 736db6c

File tree

3 files changed

+193
-104
lines changed

3 files changed

+193
-104
lines changed

lib/features/home/drawer/profile_drawer.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ class ProfileDrawer extends ConsumerWidget {
166166
Padding(
167167
padding: const EdgeInsets.all(20),
168168
child: Text(
169-
'Version 1.30.20',
169+
'Version 1.40.00',
170170
style: TextStyle(
171-
fontFamily: 'Montserrat',
172-
fontSize: 14,
173-
color: Colors.grey[500],
174-
),
171+
fontFamily: 'Montserrat',
172+
fontSize: 16,
173+
color: Colors.grey[500],
174+
fontWeight: FontWeight.bold),
175175
),
176176
),
177177
],

lib/features/posts/screens/add_posts_type_screen.dart

Lines changed: 187 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import 'dart:io';
2-
import 'package:profanity_filter/profanity_filter.dart';
2+
33
import 'package:dotted_border/dotted_border.dart';
44
import 'package:femunity/core/common/error_text.dart';
55
import 'package:femunity/core/common/loader.dart';
6-
import 'package:femunity/core/constants/constants.dart';
76
import 'package:femunity/core/utils.dart';
87
import 'package:femunity/features/communities/controller/community_controller.dart';
98
import 'package:femunity/features/posts/controller/posts_controller.dart';
109
import 'package:femunity/models/community_model.dart';
1110
import 'package:femunity/theme/pallate.dart';
1211
import 'package:flutter/material.dart';
1312
import 'package:flutter_riverpod/flutter_riverpod.dart';
13+
import 'package:profanity_filter/profanity_filter.dart';
1414

1515
class AddPostsTypeScreen extends ConsumerStatefulWidget {
1616
final String type;
17-
const AddPostsTypeScreen({super.key, required this.type});
17+
18+
const AddPostsTypeScreen({Key? key, required this.type}) : super(key: key);
1819

1920
@override
2021
ConsumerState<ConsumerStatefulWidget> createState() =>
@@ -99,128 +100,216 @@ class _AddPostsTypeScreenState extends ConsumerState<AddPostsTypeScreen> {
99100
final isTypeLink = widget.type == 'Link';
100101
final isLoading = ref.watch(postControllerProvider);
101102
return Scaffold(
103+
backgroundColor: currentTheme.backgroundColor,
102104
appBar: AppBar(
103-
title: Text('Post ${widget.type}'),
105+
backgroundColor: Colors.black,
106+
elevation: 0,
107+
leading: IconButton(
108+
icon: const Icon(
109+
Icons.arrow_back_ios,
110+
color: Colors.white,
111+
),
112+
onPressed: () => Navigator.of(context).pop(),
113+
),
114+
title:
115+
Text('Add ${widget.type}', style: TextStyle(color: Colors.white)),
104116
actions: [
105117
TextButton(
106118
onPressed: sharePost,
107119
style: ButtonStyle(
108-
foregroundColor:
109-
MaterialStateProperty.all<Color>(const Color(0xFFFEB2B2)),
110-
),
120+
// foregroundColor: MaterialStateProperty.all<Color>(
121+
// currentTheme.accentIconColor),
122+
),
111123
child: Text(
112124
'Share',
113125
style: TextStyle(
114-
fontSize: 18,
115-
color: Theme.of(context).brightness == Brightness.dark
116-
? Color(0xffFEB2B2)
117-
: Color.fromARGB(255, 0, 0, 0)),
126+
fontSize: 18,
127+
fontWeight: FontWeight.bold,
128+
color: Colors.white,
129+
),
118130
),
119131
),
120132
],
121133
),
122134
body: isLoading
123135
? const Loader()
124136
: Padding(
125-
padding: const EdgeInsets.all(8.0),
126-
child: Column(
127-
children: [
128-
TextField(
129-
controller: titleController,
130-
decoration: const InputDecoration(
131-
hintText: 'What should the title be?',
132-
filled: true,
133-
border: InputBorder.none,
134-
contentPadding: EdgeInsets.all(18),
137+
padding: const EdgeInsets.all(20.0),
138+
child: SingleChildScrollView(
139+
child: Column(
140+
crossAxisAlignment: CrossAxisAlignment.start,
141+
children: [
142+
const Text(
143+
'Title',
144+
style:
145+
TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
135146
),
136-
maxLength: 30,
137-
),
138-
const SizedBox(
139-
height: 10,
140-
),
141-
if (isTypeImage)
142-
GestureDetector(
143-
onTap: selectBannerImage,
144-
child: DottedBorder(
145-
borderType: BorderType.RRect,
146-
radius: const Radius.circular(10),
147-
dashPattern: const [10, 4],
148-
strokeCap: StrokeCap.round,
149-
color: currentTheme.textTheme.bodyText2!.color!,
150-
child: Container(
151-
width: double.infinity,
152-
height: 150,
153-
decoration: BoxDecoration(
154-
borderRadius: BorderRadius.circular(10),
155-
),
156-
child: bannerFile != null
157-
? Image.file(bannerFile!)
158-
: const Center(
159-
child: Icon(
160-
Icons.camera_alt_outlined,
161-
size: 40,
162-
),
163-
)),
164-
),
165-
),
166-
if (isTypeText)
147+
const SizedBox(height: 10),
167148
TextField(
168-
controller: descriptionController,
169-
decoration: const InputDecoration(
170-
hintText: 'Voice your thoughts!',
171-
hintStyle: TextStyle(
172-
fontWeight: FontWeight.w500,
173-
),
149+
controller: titleController,
150+
decoration: InputDecoration(
151+
hintText: 'What should the title be?',
152+
hintStyle: currentTheme.textTheme.bodyText2!
153+
.copyWith(color: currentTheme.hintColor),
174154
filled: true,
175-
border: InputBorder.none,
176-
contentPadding: EdgeInsets.all(18),
155+
fillColor: Colors.purple[900],
156+
border: OutlineInputBorder(
157+
borderRadius: BorderRadius.circular(15),
158+
borderSide: BorderSide.none,
159+
),
160+
contentPadding: const EdgeInsets.all(18),
177161
),
178-
maxLines: 5,
162+
maxLength: 30,
163+
style: currentTheme.textTheme.bodyText2!
164+
.copyWith(fontWeight: FontWeight.bold),
179165
),
180-
if (isTypeLink)
181-
TextField(
182-
controller: linkController,
183-
decoration: const InputDecoration(
184-
hintText: 'Enter link here',
185-
hintStyle: TextStyle(
186-
fontWeight: FontWeight.w500,
187-
),
188-
filled: true,
189-
border: InputBorder.none,
190-
contentPadding: EdgeInsets.all(18),
166+
const SizedBox(height: 20),
167+
if (isTypeImage)
168+
Column(
169+
crossAxisAlignment: CrossAxisAlignment.start,
170+
children: [
171+
const Text(
172+
'Image',
173+
style: TextStyle(
174+
fontSize: 24, fontWeight: FontWeight.bold),
175+
),
176+
const SizedBox(height: 10),
177+
GestureDetector(
178+
onTap: selectBannerImage,
179+
child: DottedBorder(
180+
borderType: BorderType.RRect,
181+
radius: const Radius.circular(10),
182+
dashPattern: const [10, 4],
183+
strokeCap: StrokeCap.round,
184+
color: currentTheme.textTheme.bodyText2!.color!,
185+
child: Container(
186+
width: double.infinity,
187+
height: 150,
188+
decoration: BoxDecoration(
189+
borderRadius: BorderRadius.circular(10),
190+
),
191+
child: bannerFile != null
192+
? ClipRRect(
193+
borderRadius: BorderRadius.circular(10),
194+
child: Image.file(
195+
bannerFile!,
196+
fit: BoxFit.cover,
197+
),
198+
)
199+
: const Center(
200+
child: Icon(
201+
Icons.camera_alt_outlined,
202+
size: 40,
203+
),
204+
),
205+
),
206+
),
207+
),
208+
],
209+
),
210+
if (isTypeText)
211+
Column(
212+
crossAxisAlignment: CrossAxisAlignment.start,
213+
children: [
214+
const Text(
215+
'Text',
216+
style: TextStyle(
217+
fontSize: 24, fontWeight: FontWeight.bold),
218+
),
219+
const SizedBox(height: 10),
220+
TextField(
221+
controller: descriptionController,
222+
decoration: InputDecoration(
223+
hintText: 'Voice your thoughts!',
224+
hintStyle: currentTheme.textTheme.bodyText2!
225+
.copyWith(color: currentTheme.hintColor),
226+
filled: true,
227+
fillColor: Colors.green[600],
228+
border: OutlineInputBorder(
229+
borderRadius: BorderRadius.circular(15),
230+
borderSide: BorderSide.none,
231+
),
232+
contentPadding: const EdgeInsets.all(18),
233+
),
234+
maxLines: 5,
235+
style: currentTheme.textTheme.bodyText2!
236+
.copyWith(fontWeight: FontWeight.bold),
237+
),
238+
],
239+
),
240+
if (isTypeLink)
241+
Column(
242+
crossAxisAlignment: CrossAxisAlignment.start,
243+
children: [
244+
const Text(
245+
'Link',
246+
style: TextStyle(
247+
fontSize: 24, fontWeight: FontWeight.bold),
248+
),
249+
const SizedBox(height: 10),
250+
TextField(
251+
controller: linkController,
252+
decoration: InputDecoration(
253+
hintText: 'Enter link here',
254+
hintStyle: currentTheme.textTheme.bodyText2!
255+
.copyWith(color: currentTheme.hintColor),
256+
filled: true,
257+
fillColor: Colors.orange[800],
258+
border: OutlineInputBorder(
259+
borderRadius: BorderRadius.circular(15),
260+
borderSide: BorderSide.none,
261+
),
262+
contentPadding: const EdgeInsets.all(18),
263+
),
264+
maxLines: 2,
265+
style: currentTheme.textTheme.bodyText2!
266+
.copyWith(fontWeight: FontWeight.bold),
267+
),
268+
],
191269
),
192-
maxLines: 2,
270+
const SizedBox(height: 20),
271+
const Text(
272+
'Select Community',
273+
style:
274+
TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
193275
),
194-
const SizedBox(height: 20),
195-
const Align(
196-
alignment: Alignment.topLeft,
197-
child: Text('Select Community'),
198-
),
199-
ref.watch(userCommunitiesProvider).when(
200-
data: (data) {
201-
communities = data;
276+
const SizedBox(height: 10),
277+
ref.watch(userCommunitiesProvider).when(
278+
data: (data) {
279+
communities = data;
202280

203-
if (data.isEmpty) {
204-
return const SizedBox();
205-
}
206-
return DropdownButton(
281+
if (data.isEmpty) {
282+
return const SizedBox();
283+
}
284+
return DropdownButton(
207285
value: selectedCommunity ?? data[0],
208-
items: data
209-
.map((e) => DropdownMenuItem(
210-
value: e, child: Text(e.name)))
211-
.toList(),
212-
onChanged: (val) {
286+
onChanged: (value) {
213287
setState(() {
214-
selectedCommunity = val;
288+
selectedCommunity = value as Community?;
215289
});
216-
});
217-
},
218-
error: (error, StackTrace) => ErrorText(
219-
error: error.toString(),
290+
},
291+
items: data
292+
.map(
293+
(e) => DropdownMenuItem(
294+
value: e,
295+
child: Text(
296+
e.name,
297+
style: currentTheme.textTheme.bodyText2!
298+
.copyWith(
299+
fontWeight: FontWeight.bold,
300+
),
301+
),
302+
),
303+
)
304+
.toList(),
305+
);
306+
},
307+
loading: () => const LinearProgressIndicator(),
308+
error: (error, stackTrace) =>
309+
ErrorText(error: error.toString()),
220310
),
221-
loading: () => const Loader(),
222-
),
223-
],
311+
],
312+
),
224313
),
225314
),
226315
);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 1.30.20
19+
version: 1.40.00
2020

2121
environment:
2222
sdk: '>=2.19.2 <3.0.0'

0 commit comments

Comments
 (0)