Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hoàng Văn Đạt
mypoint_flutter_app
Commits
2cf5375a
Commit
2cf5375a
authored
Nov 20, 2025
by
DatHV
Browse files
update navigation padding
parent
b3c72190
Changes
25
Show whitespace changes
Inline
Side-by-side
lib/features/voucher/detail/voucher_detail_screen.dart
View file @
2cf5375a
...
@@ -7,6 +7,7 @@ import 'package:mypoint_flutter_app/features/voucher/detail/store_list_section.d
...
@@ -7,6 +7,7 @@ import 'package:mypoint_flutter_app/features/voucher/detail/store_list_section.d
import
'package:mypoint_flutter_app/features/voucher/models/product_type.dart'
;
import
'package:mypoint_flutter_app/features/voucher/models/product_type.dart'
;
import
'package:mypoint_flutter_app/features/voucher/voucher_code_card_screen.dart'
;
import
'package:mypoint_flutter_app/features/voucher/voucher_code_card_screen.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../../app/config/constants.dart'
;
import
'../../../shared/widgets/base_view/base_screen.dart'
;
import
'../../../shared/widgets/base_view/base_screen.dart'
;
import
'../../../shared/widgets/base_view/basic_state.dart'
;
import
'../../../shared/widgets/base_view/basic_state.dart'
;
import
'../../../shared/preferences/point/point_manager.dart'
;
import
'../../../shared/preferences/point/point_manager.dart'
;
...
@@ -75,7 +76,12 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
...
@@ -75,7 +76,12 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
return
Stack
(
return
Stack
(
children:
[
children:
[
Center
(
child:
EmptyWidget
(
isLoading:
_viewModel
.
isLoading
.
value
)),
Center
(
child:
EmptyWidget
(
isLoading:
_viewModel
.
isLoading
.
value
)),
SafeArea
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
CustomBackButton
())),
SafeArea
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
,
bottom:
8
,
top:
8
+
Constants
.
extendTopPaddingNavigation
),
child:
CustomBackButton
(),
),
),
],
],
);
);
}
}
...
@@ -98,7 +104,7 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
...
@@ -98,7 +104,7 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
),
),
SafeArea
(
SafeArea
(
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
EdgeInsets
.
only
(
left:
8
,
right:
8
,
top:
8
+
Constants
.
extendTopPaddingNavigation
,
bottom:
8
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
...
@@ -211,16 +217,11 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
...
@@ -211,16 +217,11 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
if
(
product
.
price
?.
value
!=
null
&&
product
.
previewFlashSale
?.
isFlashSalePrice
==
true
)
if
(
product
.
price
?.
value
!=
null
&&
product
.
previewFlashSale
?.
isFlashSalePrice
==
true
)
Text
(
Text
(
'
${product.price?.value?.money(CurrencyUnit.noneSpace)}
đ'
,
'
${product.price?.value?.money(CurrencyUnit.noneSpace)}
đ'
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
,
decoration:
TextDecoration
.
lineThrough
),
fontSize:
14
,
color:
Colors
.
grey
,
decoration:
TextDecoration
.
lineThrough
,
),
),
),
],
],
),
),
if
(
product
.
isShowProsessSoldItem
)
if
(
product
.
isShowProsessSoldItem
)
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
16
),
if
(
product
.
isShowProsessSoldItem
)
if
(
product
.
isShowProsessSoldItem
)
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
...
@@ -234,17 +235,13 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
...
@@ -234,17 +235,13 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
value:
product
.
progress
,
value:
product
.
progress
,
minHeight:
10
,
minHeight:
10
,
backgroundColor:
Colors
.
grey
.
shade300
,
backgroundColor:
Colors
.
grey
.
shade300
,
valueColor:
AlwaysStoppedAnimation
<
Color
>(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
product
.
inStock
?
Colors
.
orange
:
Colors
.
red
),
product
.
inStock
?
Colors
.
orange
:
Colors
.
red
,
),
),
),
),
),
),
),
const
SizedBox
(
width:
2
),
const
SizedBox
(
width:
2
),
Text
(
Text
(
product
.
inStock
product
.
inStock
?
'Đã bán
${product.previewFlashSale?.fsQuantitySold ?? 0}
'
:
'Đã bán hết'
,
?
'Đã bán
${product.previewFlashSale?.fsQuantitySold ?? 0}
'
:
'Đã bán hết'
,
style:
TextStyle
(
fontSize:
12
,
color:
product
.
inStock
?
Colors
.
black
:
Colors
.
grey
),
style:
TextStyle
(
fontSize:
12
,
color:
product
.
inStock
?
Colors
.
black
:
Colors
.
grey
),
),
),
],
],
...
...
lib/features/voucher/voucher_code_card_screen.dart
View file @
2cf5375a
import
'package:barcode_widget/barcode_widget.dart'
;
import
'package:barcode_widget/barcode_widget.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/
back_button
.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/
custom_navigation_bar
.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/custom_toast_message.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/custom_toast_message.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/dashed_line.dart'
;
import
'package:mypoint_flutter_app/shared/widgets/dashed_line.dart'
;
import
'package:qr_flutter/qr_flutter.dart'
;
import
'package:qr_flutter/qr_flutter.dart'
;
import
'../../app/config/constants.dart'
;
import
'../../core/theme/base_color.dart'
;
import
'../../core/theme/base_color.dart'
;
import
'../../shared/widgets/back_button.dart'
;
import
'../../shared/widgets/custom_point_text_tag.dart'
;
import
'../../shared/widgets/custom_point_text_tag.dart'
;
import
'../../shared/widgets/image_loader.dart'
;
import
'../../shared/widgets/image_loader.dart'
;
import
'models/product_model.dart'
;
import
'models/product_model.dart'
;
...
@@ -20,16 +22,15 @@ class VoucherCodeCardScreen extends StatelessWidget {
...
@@ -20,16 +22,15 @@ class VoucherCodeCardScreen extends StatelessWidget {
final
code
=
product
.
item
?.
codeSecret
??
''
;
final
code
=
product
.
item
?.
codeSecret
??
''
;
final
password
=
product
.
item
?.
password
??
""
;
final
password
=
product
.
item
?.
password
??
""
;
final
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
final
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
final
topExpand
=
MediaQuery
.
of
(
context
).
padding
.
top
+
8
+
Constants
.
extendTopPaddingNavigation
;
return
Scaffold
(
return
Scaffold
(
backgroundColor:
BaseColor
.
primary500
,
backgroundColor:
BaseColor
.
primary500
,
appBar:
AppBar
(
leading:
CustomBackButton
(),
backgroundColor:
Colors
.
transparent
),
body:
Stack
(
body:
Stack
(
children:
[
children:
[
Column
(
Column
(
children:
[
children:
[
Container
(
Container
(
margin:
const
EdgeInsets
.
all
(
16
),
margin:
EdgeInsets
.
only
(
left:
16
,
right:
16
,
top:
16
+
topExpand
+
36
),
//
all(16),
padding:
const
EdgeInsets
.
all
(
16
),
padding:
const
EdgeInsets
.
all
(
16
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)),
child:
Column
(
child:
Column
(
...
@@ -160,6 +161,7 @@ class VoucherCodeCardScreen extends StatelessWidget {
...
@@ -160,6 +161,7 @@ class VoucherCodeCardScreen extends StatelessWidget {
child:
Image
.
asset
(
'assets/images/ic_scan_tutorial.png'
,
fit:
BoxFit
.
cover
),
child:
Image
.
asset
(
'assets/images/ic_scan_tutorial.png'
,
fit:
BoxFit
.
cover
),
),
),
),
),
Positioned
(
top:
topExpand
,
left:
8
,
child:
CustomBackButton
()),
],
],
),
),
);
);
...
...
lib/shared/navigation/directional_screen.dart
View file @
2cf5375a
...
@@ -265,7 +265,8 @@ class DirectionalScreen {
...
@@ -265,7 +265,8 @@ class DirectionalScreen {
Get
.
toNamed
(
healthBookScreen
);
Get
.
toNamed
(
healthBookScreen
);
return
true
;
return
true
;
case
DirectionalScreenName
.
campaignSevenDayScreen
:
case
DirectionalScreenName
.
campaignSevenDayScreen
:
Get
.
toNamed
(
campaignSevenDayScreen
);
if
((
clickActionParam
??
''
).
isEmpty
)
return
false
;
Get
.
toNamed
(
campaignSevenDayScreen
,
arguments:
{
"id"
:
clickActionParam
});
return
true
;
return
true
;
case
DirectionalScreenName
.
workerProfile
:
case
DirectionalScreenName
.
workerProfile
:
Get
.
toNamed
(
personalEditScreen
);
Get
.
toNamed
(
personalEditScreen
);
...
...
lib/shared/widgets/custom_navigation_bar.dart
View file @
2cf5375a
...
@@ -28,15 +28,16 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
...
@@ -28,15 +28,16 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
final
view
=
dispatcher
.
implicitView
??
(
dispatcher
.
views
.
isNotEmpty
?
dispatcher
.
views
.
first
:
null
);
final
view
=
dispatcher
.
implicitView
??
(
dispatcher
.
views
.
isNotEmpty
?
dispatcher
.
views
.
first
:
null
);
double
paddingTop
=
view
!=
null
?
MediaQueryData
.
fromView
(
view
).
padding
.
top
:
0.0
;
double
paddingTop
=
view
!=
null
?
MediaQueryData
.
fromView
(
view
).
padding
.
top
:
0.0
;
if
(
paddingTop
==
0
&&
kIsWeb
)
{
if
(
paddingTop
==
0
&&
kIsWeb
)
{
paddingTop
=
Constants
.
web
TopPadding
;
paddingTop
=
Constants
.
extend
TopPadding
Navigation
;
}
}
return
Size
.
fromHeight
(
kToolbarHeight
+
paddingTop
);
return
Size
.
fromHeight
(
kToolbarHeight
+
paddingTop
);
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
if
(
backgroundImage
!=
null
&&
backgroundImage
!.
isNotEmpty
)
{
final
customBg
=
backgroundImage
;
return
_buildAppBar
(
backgroundImage
!,
context
);
if
(
customBg
!=
null
)
{
return
_buildAppBar
(
customBg
,
context
);
}
}
final
theme
=
Get
.
find
<
HeaderThemeController
>();
final
theme
=
Get
.
find
<
HeaderThemeController
>();
...
@@ -50,7 +51,7 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
...
@@ -50,7 +51,7 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
double
extraWebPadding
=
0
;
double
extraWebPadding
=
0
;
if
(
statusBarHeight
==
0
&&
kIsWeb
)
{
if
(
statusBarHeight
==
0
&&
kIsWeb
)
{
extraWebPadding
=
Constants
.
web
TopPadding
;
extraWebPadding
=
Constants
.
extend
TopPadding
Navigation
;
}
}
final
double
totalTopPadding
=
statusBarHeight
+
extraWebPadding
;
final
double
totalTopPadding
=
statusBarHeight
+
extraWebPadding
;
final
bool
isHttp
=
bgImage
.
startsWith
(
'http://'
)
||
bgImage
.
startsWith
(
'https://'
);
final
bool
isHttp
=
bgImage
.
startsWith
(
'http://'
)
||
bgImage
.
startsWith
(
'https://'
);
...
@@ -92,7 +93,7 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
...
@@ -92,7 +93,7 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
if
(
leftButtons
.
isNotEmpty
)
if
(
leftButtons
.
isNotEmpty
)
Positioned
(
left:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
leftButtons
)),
Positioned
(
left:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
leftButtons
)),
if
(
rightButtons
.
isNotEmpty
)
if
(
rightButtons
.
isNotEmpty
)
Positioned
(
right:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
rightButtons
)),
Positioned
(
right:
8
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
rightButtons
)),
],
],
),
),
),
),
...
...
lib/shared/widgets/custom_search_navigation_bar.dart
View file @
2cf5375a
...
@@ -28,7 +28,7 @@ class CustomSearchNavigationBar extends StatefulWidget implements PreferredSizeW
...
@@ -28,7 +28,7 @@ class CustomSearchNavigationBar extends StatefulWidget implements PreferredSizeW
final
view
=
dispatcher
.
implicitView
??
(
dispatcher
.
views
.
isNotEmpty
?
dispatcher
.
views
.
first
:
null
);
final
view
=
dispatcher
.
implicitView
??
(
dispatcher
.
views
.
isNotEmpty
?
dispatcher
.
views
.
first
:
null
);
double
paddingTop
=
view
!=
null
?
MediaQueryData
.
fromView
(
view
).
padding
.
top
:
0.0
;
double
paddingTop
=
view
!=
null
?
MediaQueryData
.
fromView
(
view
).
padding
.
top
:
0.0
;
if
(
paddingTop
==
0
&&
kIsWeb
)
{
if
(
paddingTop
==
0
&&
kIsWeb
)
{
paddingTop
=
Constants
.
web
TopPadding
;
paddingTop
=
Constants
.
extend
TopPadding
Navigation
;
}
}
return
Size
.
fromHeight
(
kToolbarHeight
+
paddingTop
);
return
Size
.
fromHeight
(
kToolbarHeight
+
paddingTop
);
}
}
...
@@ -64,7 +64,7 @@ class _CustomSearchNavigationBarState extends State<CustomSearchNavigationBar> {
...
@@ -64,7 +64,7 @@ class _CustomSearchNavigationBarState extends State<CustomSearchNavigationBar> {
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
double
extraWebPadding
=
0
;
double
extraWebPadding
=
0
;
if
(
statusBarHeight
==
0
&&
kIsWeb
)
{
if
(
statusBarHeight
==
0
&&
kIsWeb
)
{
extraWebPadding
=
Constants
.
web
TopPadding
;
extraWebPadding
=
Constants
.
extend
TopPadding
Navigation
;
}
}
final
double
totalTopPadding
=
statusBarHeight
+
extraWebPadding
;
final
double
totalTopPadding
=
statusBarHeight
+
extraWebPadding
;
return
SizedBox
(
return
SizedBox
(
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment