Skip to content

Commit a1a5da8

Browse files
committed
update UI
1 parent edd28d1 commit a1a5da8

31 files changed

+308
-251
lines changed

lib/configs/theme.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class AppTheme {
3333
);
3434

3535
static final _inputDecorationThem = InputDecorationTheme(
36-
contentPadding: EdgeInsets.symmetric(horizontal: SizeConfig.defaultPadding),
36+
contentPadding:
37+
EdgeInsets.symmetric(horizontal: SizeConfig.defaultPadding * 1.2),
3738
border: OutlineInputBorder(
38-
borderRadius: BorderRadius.circular(5),
39+
borderRadius: BorderRadius.all(Radius.circular(5)),
3940
borderSide: BorderSide(color: COLOR_CONST.textColor),
4041
),
42+
hintStyle: FONT_CONST.REGULAR_DEFAULT_20,
4143
);
4244

4345
/// Singleton factory

lib/presentation/screens/cart/cart_screen.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:e_commerce_app/constants/constants.dart';
12
import 'package:e_commerce_app/presentation/screens/cart/widgets/list_cart_item.dart';
23
import 'package:e_commerce_app/presentation/screens/cart/widgets/checkout_bottom.dart';
34
import 'package:flutter/material.dart';
@@ -20,8 +21,9 @@ class CartScreen extends StatelessWidget {
2021
title: Text(Translate.of(context).translate("cart")),
2122
actions: [
2223
IconButton(
23-
icon: Icon(Icons.clear_all_rounded),
24-
onPressed: () => _onClearCart(context))
24+
icon: Icon(Icons.clear_all_rounded),
25+
onPressed: () => _onClearCart(context),
26+
)
2527
],
2628
);
2729
}
@@ -33,6 +35,7 @@ class CartScreen extends StatelessWidget {
3335
content: Text(
3436
Translate.of(context)
3537
.translate("all_cart_items_will_be_deleted_from_your_cart"),
38+
style: FONT_CONST.REGULAR_DEFAULT_20,
3639
),
3740
confirmButtonText: Translate.of(context).translate("delete"),
3841
) as bool;

lib/presentation/screens/cart/widgets/checkout_bottom.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ class CheckoutBottom extends StatelessWidget {
7373
return Row(
7474
children: [
7575
Container(
76-
padding: EdgeInsets.all(10),
77-
height: SizeConfig.defaultSize * 4,
78-
width: SizeConfig.defaultSize * 4,
76+
alignment: Alignment.center,
77+
height: SizeConfig.defaultSize * 5,
78+
width: SizeConfig.defaultSize * 5,
7979
decoration: BoxDecoration(
80-
color: Color(0xFFF5F6F9),
81-
borderRadius: BorderRadius.circular(10),
80+
color: COLOR_CONST.cardShadowColor.withOpacity(0.5),
81+
borderRadius: BorderRadius.circular(SizeConfig.defaultSize),
82+
),
83+
child: SvgPicture.asset(
84+
ICON_CONST.RECEIPT,
85+
width: SizeConfig.defaultSize * 2.5,
86+
height: SizeConfig.defaultSize * 2.5,
8287
),
83-
child: SvgPicture.asset(ICON_CONST.RECEIPT),
8488
),
8589
SizedBox(width: SizeConfig.defaultSize),
8690
Text.rich(

lib/presentation/screens/detail_product/widgets/product_info.dart

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
6060
_buildProductName() {
6161
return Padding(
6262
padding: EdgeInsets.symmetric(horizontal: SizeConfig.defaultPadding),
63-
child: Text(product.name, style: FONT_CONST.BOLD_DEFAULT_20),
63+
child: Text(product.name, style: FONT_CONST.BOLD_DEFAULT_24),
6464
);
6565
}
6666

@@ -92,10 +92,13 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
9292
TextSpan(
9393
style: FONT_CONST.BOLD_DEFAULT,
9494
children: [
95-
TextSpan(text: Translate.of(context).translate('sold')),
95+
TextSpan(
96+
text: Translate.of(context).translate('sold'),
97+
style: FONT_CONST.BOLD_DEFAULT_18,
98+
),
9699
TextSpan(
97100
text: " ${product.soldQuantity}",
98-
style: FONT_CONST.BOLD_PRIMARY_16,
101+
style: FONT_CONST.BOLD_PRIMARY_18,
99102
),
100103
],
101104
),
@@ -113,9 +116,13 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
113116
},
114117
child: Row(
115118
children: [
116-
Text("${product.rating}", style: FONT_CONST.BOLD_DEFAULT_16),
119+
Text("${product.rating}", style: FONT_CONST.BOLD_DEFAULT_18),
117120
SizedBox(width: 5),
118-
SvgPicture.asset("assets/icons/Star Icon.svg"),
121+
SvgPicture.asset(
122+
"assets/icons/Star Icon.svg",
123+
width: SizeConfig.defaultSize * 1.8,
124+
height: SizeConfig.defaultSize * 1.8,
125+
),
119126
],
120127
),
121128
);
@@ -125,13 +132,16 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
125132
return Align(
126133
alignment: Alignment.centerRight,
127134
child: Container(
128-
padding: EdgeInsets.symmetric(horizontal: SizeConfig.defaultPadding),
135+
padding: EdgeInsets.symmetric(
136+
horizontal: SizeConfig.defaultPadding,
137+
vertical: SizeConfig.defaultSize,
138+
),
129139
alignment: Alignment.center,
130-
height: SizeConfig.defaultSize * 4,
140+
height: SizeConfig.defaultSize * 5,
131141
decoration: BoxDecoration(
132142
color: product.isAvailable ? Color(0xFFFFE6E6) : Color(0xFFF5F6F9),
133143
borderRadius: BorderRadius.only(
134-
topLeft: Radius.circular(25),
144+
topLeft: Radius.circular(SizeConfig.defaultSize * 2.5),
135145
bottomLeft: Radius.circular(SizeConfig.defaultSize * 2.5),
136146
),
137147
),
@@ -141,10 +151,14 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
141151
"assets/icons/Check mark rounde.svg",
142152
color:
143153
product.isAvailable ? Color(0xFFFF4848) : Color(0xFFDBDEE4),
154+
width: SizeConfig.defaultSize * 3,
155+
height: SizeConfig.defaultSize * 3,
144156
),
145157
SizedBox(width: 5),
146158
Text(
147-
"${product.isAvailable ? Translate.of(context).translate('available') : Translate.of(context).translate('not_available')}"),
159+
"${product.isAvailable ? Translate.of(context).translate('available') : Translate.of(context).translate('not_available')}",
160+
style: FONT_CONST.REGULAR_DEFAULT_18,
161+
),
148162
],
149163
),
150164
),
@@ -159,7 +173,7 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
159173
children: [
160174
Text(
161175
product.description,
162-
style: FONT_CONST.REGULAR_DEFAULT_16,
176+
style: FONT_CONST.REGULAR_DEFAULT_18,
163177
maxLines: seeMore ? null : 2,
164178
),
165179
SizedBox(height: 5),
@@ -168,8 +182,8 @@ class _ProductInfoWidgetState extends State<ProductInfoWidget> {
168182
GestureDetector(
169183
onTap: onSeeMore,
170184
child: Text(
171-
"${seeMore ? Translate.of(context).translate('see_less') : Translate.of(context).translate('see_all')}",
172-
style: FONT_CONST.BOLD_PRIMARY,
185+
"${seeMore ? Translate.of(context).translate('see_less') : Translate.of(context).translate('see_more')}",
186+
style: FONT_CONST.BOLD_PRIMARY_18,
173187
),
174188
),
175189
],

lib/presentation/screens/detail_product/widgets/slogan.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class Slogan extends StatelessWidget {
4242
children: [
4343
SvgPicture.asset(
4444
iconPath,
45-
width: SizeConfig.defaultSize * 2,
46-
height: SizeConfig.defaultSize * 2,
45+
width: SizeConfig.defaultSize * 3,
46+
height: SizeConfig.defaultSize * 3,
4747
color: COLOR_CONST.primaryColor,
4848
),
4949
SizedBox(width: SizeConfig.defaultSize * 0.5),
50-
Text(text),
50+
Text(text, style: FONT_CONST.REGULAR_DEFAULT_18),
5151
],
5252
);
5353
}

lib/presentation/screens/feedbacks/widgets/header.dart

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ class _HeaderState extends State<Header> {
5151
RatingBar(initialRating: state.rating, readOnly: true),
5252
SizedBox(height: SizeConfig.defaultSize),
5353
Text(
54-
"${state.numberOfFeedbacks} " +
55-
Translate.of(context).translate("feedbacks"),
56-
style: FONT_CONST.MEDIUM_WHITE,
54+
"${state.numberOfFeedbacks} ${Translate.of(context).translate("feedbacks")}",
55+
style: FONT_CONST.MEDIUM_WHITE_20,
5756
),
5857
],
5958
),
@@ -87,13 +86,7 @@ class _HeaderState extends State<Header> {
8786
),
8887
child: Text(
8988
"All",
90-
style: TextStyle(
91-
fontSize: 14,
92-
fontWeight: FontWeight.w600,
93-
color: selectedStarIndex == 0
94-
? COLOR_CONST.primaryColor
95-
: COLOR_CONST.textColor,
96-
),
89+
style:selectedStarIndex == 0 ? FONT_CONST.BOLD_PRIMARY_18 : FONT_CONST.BOLD_DEFAULT_18 ,
9790
),
9891
),
9992
),

lib/presentation/screens/home_page/home_screen.dart

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,30 @@ class HomeScreen extends StatelessWidget {
99
Widget build(BuildContext context) {
1010
return BlocProvider(
1111
create: (context) => HomeBloc()..add(LoadHome()),
12-
child: Scaffold(
13-
body: SafeArea(
14-
child: CustomScrollView(
15-
physics: BouncingScrollPhysics(),
16-
slivers: [
17-
SliverPersistentHeader(
18-
delegate: HomePersistentHeader(),
19-
pinned: true,
12+
child: Builder(
13+
builder: (context) {
14+
return Scaffold(
15+
body: SafeArea(
16+
child: RefreshIndicator(
17+
onRefresh: () async {
18+
BlocProvider.of<HomeBloc>(context).add(RefreshHome());
19+
},
20+
child: CustomScrollView(
21+
physics: AlwaysScrollableScrollPhysics(
22+
parent: BouncingScrollPhysics(),
23+
),
24+
slivers: [
25+
SliverPersistentHeader(
26+
delegate: HomePersistentHeader(),
27+
pinned: true,
28+
),
29+
HomeBody(),
30+
],
31+
),
2032
),
21-
HomeBody(),
22-
],
23-
),
24-
),
33+
),
34+
);
35+
},
2536
),
2637
);
2738
}

lib/presentation/screens/home_page/widgets/home_header.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ import 'package:e_commerce_app/constants/color_constant.dart';
99

1010
class HomePersistentHeader extends SliverPersistentHeaderDelegate {
1111
double _mainHeaderHeight = SizeConfig.defaultSize * 4;
12-
double _searchFieldHeight = SizeConfig.defaultSize * 6;
12+
double _searchFieldHeight = SizeConfig.defaultSize * 5;
1313
double _insetVertical = SizeConfig.defaultSize * 1.5;
1414
double _insetHorizontal = SizeConfig.defaultSize * 1.5;
1515
// _mainHeaderHeight + 2*_insetVertical
16-
double _minHeaderExtent = SizeConfig.defaultSize * 7;
16+
double _minHeaderExtent = SizeConfig.defaultSize * 8;
1717
// _mainHeaderHeight + _searchFieldHeight + 2*_insetVertical + whiteSpace
18-
double _maxHeaderExtent = SizeConfig.defaultSize * 13 + SizeConfig.defaultSize;
18+
double _maxHeaderExtent =
19+
SizeConfig.defaultSize * 13 + SizeConfig.defaultSize / 2;
1920
@override
2021
Widget build(
2122
BuildContext context, double shrinkOffset, bool overlapsContent) {
@@ -71,7 +72,6 @@ class HomePersistentHeader extends SliverPersistentHeaderDelegate {
7172
child: Container(
7273
margin: EdgeInsets.symmetric(horizontal: _insetHorizontal),
7374
child: SearchFieldWidget(
74-
height: SizeConfig.defaultSize * 6,
7575
readOnly: true,
7676
onTap: () => Navigator.pushNamed(context, AppRouter.SEARCH),
7777
hintText: Translate.of(context)

lib/presentation/screens/initialize_info/initialize_info_screen.dart

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
1+
import 'package:e_commerce_app/configs/config.dart';
2+
import 'package:e_commerce_app/constants/constants.dart';
13
import 'package:e_commerce_app/presentation/screens/initialize_info/widgets/initialize_info_form.dart';
24
import 'package:e_commerce_app/presentation/screens/initialize_info/widgets/initialize_info_header.dart';
5+
import 'package:e_commerce_app/utils/utils.dart';
36
import 'package:flutter/material.dart';
47

58
class InitializeInfoScreen extends StatelessWidget {
69
@override
710
Widget build(BuildContext context) {
8-
return Scaffold(
9-
body: SingleChildScrollView(
10-
child: Column(
11-
children: [
12-
InitializeInfoHeader(),
13-
InitializeInfoForm(),
14-
],
11+
return GestureDetector(
12+
onTap: () => FocusScope.of(context).unfocus(),
13+
child: Scaffold(
14+
body: SingleChildScrollView(
15+
physics: BouncingScrollPhysics(),
16+
child: Column(
17+
children: [
18+
InitializeInfoHeader(),
19+
InitializeInfoForm(),
20+
],
21+
),
1522
),
23+
bottomNavigationBar: _buildHaveAccountText(context),
24+
),
25+
);
26+
}
27+
28+
_buildHaveAccountText(context) {
29+
return Padding(
30+
padding: EdgeInsets.symmetric(vertical: SizeConfig.defaultSize * 3),
31+
child: Row(
32+
mainAxisAlignment: MainAxisAlignment.center,
33+
children: <Widget>[
34+
Text(
35+
Translate.of(context).translate("already_have_an_account"),
36+
style: FONT_CONST.REGULAR_DEFAULT_20,
37+
),
38+
SizedBox(width: 5),
39+
GestureDetector(
40+
onTap: () => Navigator.pushNamedAndRemoveUntil(
41+
context,
42+
AppRouter.LOGIN,
43+
(_) => false,
44+
),
45+
child: Text(
46+
Translate.of(context).translate("login"),
47+
style: FONT_CONST.BOLD_PRIMARY_20,
48+
),
49+
),
50+
],
1651
),
1752
);
1853
}

lib/presentation/screens/initialize_info/widgets/initialize_info_form.dart

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ class _InitializeInfoFormState extends State<InitializeInfoForm> {
7070
_buildPhoneNumberInput(),
7171
SizedBox(height: SizeConfig.defaultSize * 2),
7272
_buildButtonContinue(),
73-
SizedBox(height: SizeConfig.defaultSize),
74-
_buildHaveAccountText(),
7573
],
7674
),
7775
),
@@ -90,7 +88,7 @@ class _InitializeInfoFormState extends State<InitializeInfoForm> {
9088
},
9189
decoration: InputDecoration(
9290
hintText: Translate.of(context).translate("name"),
93-
suffixIcon: Icon(Icons.person),
91+
suffixIcon: Icon(Icons.person_outline),
9492
),
9593
);
9694
}
@@ -107,7 +105,7 @@ class _InitializeInfoFormState extends State<InitializeInfoForm> {
107105
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
108106
decoration: InputDecoration(
109107
hintText: Translate.of(context).translate("phone_number"),
110-
suffixIcon: Icon(Icons.phone_callback),
108+
suffixIcon: Icon(Icons.phone_callback_outlined),
111109
),
112110
);
113111
}
@@ -122,26 +120,5 @@ class _InitializeInfoFormState extends State<InitializeInfoForm> {
122120
);
123121
}
124122

125-
_buildHaveAccountText() {
126-
return Container(
127-
child: Row(
128-
mainAxisAlignment: MainAxisAlignment.center,
129-
children: <Widget>[
130-
Text(Translate.of(context).translate("already_have_an_account")),
131-
SizedBox(width: 5),
132-
GestureDetector(
133-
onTap: () => Navigator.pushNamedAndRemoveUntil(
134-
context,
135-
AppRouter.LOGIN,
136-
(_) => false,
137-
),
138-
child: Text(
139-
Translate.of(context).translate("login"),
140-
style: FONT_CONST.BOLD_PRIMARY_16,
141-
),
142-
),
143-
],
144-
),
145-
);
146-
}
123+
147124
}

0 commit comments

Comments
 (0)