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
f1723336
Commit
f1723336
authored
Sep 12, 2025
by
DatHV
Browse files
cập nhật ui, lịch sử điểm.. base networking
parent
38520c1e
Changes
47
Show whitespace changes
Inline
Side-by-side
lib/screen/traffic_service/traffic_service_certificate_screen.dart
View file @
f1723336
...
...
@@ -5,6 +5,7 @@ import 'package:share_plus/share_plus.dart';
import
'package:webview_flutter/webview_flutter.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'package:http/http.dart'
as
http
;
import
'../../base/app_loading.dart'
;
import
'../../base/base_screen.dart'
;
import
'../../base/basic_state.dart'
;
import
'../../resources/base_color.dart'
;
...
...
@@ -33,17 +34,17 @@ class _TrafficServiceCertificateScreenState extends BaseState<TrafficServiceCert
@override
void
initState
()
{
super
.
initState
();
show
Loading
();
App
Loading
()
.
show
()
;
_controller
=
WebViewController
()
..
loadRequest
(
Uri
.
parse
(
widget
.
urlView
))
..
setJavaScriptMode
(
JavaScriptMode
.
unrestricted
)
..
setNavigationDelegate
(
NavigationDelegate
(
onPageFinished:
(
_
)
async
{
hide
Loading
();
App
Loading
()
.
hide
()
;
},
onWebResourceError:
(
error
)
{
hide
Loading
();
App
Loading
()
.
hide
()
;
},
),
);
...
...
lib/screen/voucher/detail/voucher_detail_screen.dart
View file @
f1723336
...
...
@@ -59,9 +59,8 @@ class _VoucherDetailScreenState extends BaseState<VoucherDetailScreen> with Basi
}
_viewModel
=
Get
.
put
(
VoucherDetailViewModel
(
productId:
productId
,
customerProductId:
customerProductId
));
_viewModel
.
onShowAlertError
=
(
message
)
{
if
(
message
.
is
Not
Empty
)
{
if
(
message
.
isEmpty
)
return
;
showAlertError
(
content:
message
);
}
};
}
...
...
lib/screen/voucher/detail/voucher_detail_viewmodel.dart
View file @
f1723336
import
'dart:ui'
;
import
'package:get/get.dart'
;
import
'package:mypoint_flutter_app/networking/restful_api_client_all_request.dart'
;
import
'package:uuid/uuid.dart'
;
...
...
lib/screen/webview/web_view_screen.dart
View file @
f1723336
...
...
@@ -5,6 +5,7 @@ import 'package:get/get.dart';
import
'package:mypoint_flutter_app/widgets/back_button.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'package:webview_flutter/webview_flutter.dart'
;
import
'../../base/app_loading.dart'
;
import
'../../base/base_screen.dart'
;
import
'../../base/basic_state.dart'
;
import
'../../directional/directional_screen.dart'
;
...
...
@@ -42,7 +43,7 @@ class _BaseWebViewScreenState extends BaseState<BaseWebViewScreen> with BasicSta
});
return
;
}
show
Loading
();
App
Loading
()
.
show
()
;
_controller
=
WebViewController
()
..
setJavaScriptMode
(
JavaScriptMode
.
unrestricted
)
...
...
@@ -50,14 +51,14 @@ class _BaseWebViewScreenState extends BaseState<BaseWebViewScreen> with BasicSta
..
setNavigationDelegate
(
NavigationDelegate
(
onPageFinished:
(
_
)
async
{
hide
Loading
();
App
Loading
()
.
hide
()
;
final
title
=
await
_controller
.
getTitle
();
setState
(()
{
_dynamicTitle
=
title
;
});
},
onWebResourceError:
(
error
)
{
hide
Loading
();
App
Loading
()
.
hide
()
;
if
(
error
.
description
!=
'about:blank'
)
{
if
(
kDebugMode
)
{
print
(
'WebView error:
${error.description}
'
);
...
...
@@ -101,13 +102,6 @@ class _BaseWebViewScreenState extends BaseState<BaseWebViewScreen> with BasicSta
CustomBackButton
(
onPressed:
_handleBack
),
],
),
// AppBar(
// title: Text(
// input.title ?? _dynamicTitle ?? Uri.parse(input.url).host,
// style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87),
// ),
// leading: CustomBackButton(onPressed: _handleBack),
// ),
body:
Stack
(
children:
[
SafeArea
(
...
...
lib/shared/router_gage.dart
View file @
f1723336
import
'package:get/get.dart'
;
import
'package:mypoint_flutter_app/screen/news/news_list_screen.dart'
;
import
'package:mypoint_flutter_app/screen/qr_code/qr_code_screen.dart'
;
import
'../screen/achievement/achievement_list_screen.dart'
;
import
'../screen/affiliate/affiliate_tab_screen.dart'
;
import
'../screen/affiliate_brand_detail/affiliate_brand_detail_screen.dart'
;
...
...
@@ -47,7 +48,6 @@ import '../screen/voucher/voucher_list/voucher_list_screen.dart';
import
'../screen/vplay_game_center/vplay_game_center_screen.dart'
;
import
'../screen/webview/payment_web_view_screen.dart'
;
import
'../screen/webview/web_view_screen.dart'
;
const
splashScreen
=
'/splash'
;
const
onboardingScreen
=
'/onboarding'
;
const
loginScreen
=
'/login'
;
...
...
@@ -96,6 +96,7 @@ const interestCategoriesScreen = '/interestCategoriesScreen';
const
myMobileCardListScreen
=
'/myMobileCardListScreen'
;
const
bankAccountManagerScreen
=
'/bankAccountManagerScreen'
;
const
historyPointScreen
=
'/historyPointScreen'
;
const
qrCodeScreen
=
'/qrCodeScreen'
;
class
RouterPage
{
static
List
<
GetPage
>
pages
()
{
...
...
@@ -160,6 +161,7 @@ class RouterPage {
GetPage
(
name:
interestCategoriesScreen
,
page:
()
=>
InterestCategoriesScreen
()),
GetPage
(
name:
bankAccountManagerScreen
,
page:
()
=>
BankAccountManagerScreen
()),
GetPage
(
name:
historyPointScreen
,
page:
()
=>
HistoryPointScreen
()),
GetPage
(
name:
qrCodeScreen
,
page:
()
=>
QRCodeScreen
()),
];
}
}
\ No newline at end of file
lib/widgets/custom_navigation_bar.dart
View file @
f1723336
...
...
@@ -38,6 +38,7 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
Widget
_buildAppBar
(
String
bgImage
,
BuildContext
context
)
{
final
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
final
bool
isHttp
=
bgImage
.
startsWith
(
'http://'
)
||
bgImage
.
startsWith
(
'https://'
);
final
paddingTitle
=
(
leftButtons
.
isNotEmpty
||
rightButtons
.
isNotEmpty
)
?
48.0
:
16.0
;
// cách 2 đầu
return
Container
(
height:
statusBarHeight
+
kToolbarHeight
,
decoration:
BoxDecoration
(
...
...
@@ -59,18 +60,36 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
Text
(
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
paddingTitle
),
child:
FittedBox
(
fit:
BoxFit
.
scaleDown
,
// tự giảm font để vừa khung
child:
Text
(
title
,
maxLines:
1
,
style:
const
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
white
),
softWrap:
false
,
overflow:
TextOverflow
.
visible
,
// không dùng ellipsis
textAlign:
TextAlign
.
center
,
style:
const
TextStyle
(
fontSize:
18
,
// cỡ tối đa
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
white
,
),
),
),
),
// Text(
// title,
// maxLines: 1,
// style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w800, color: Colors.white),
// textAlign: TextAlign.center,
// ),
// Buttons bên trái
if
(
leftButtons
.
isNotEmpty
)
Positioned
(
left:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
leftButtons
)),
// Buttons bên phải
if
(
rightButtons
!=
null
)
Positioned
(
right:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
rightButtons
!
)),
if
(
rightButtons
.
isNotEmpty
)
Positioned
(
right:
12
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
rightButtons
)),
],
),
),
...
...
pubspec.yaml
View file @
f1723336
...
...
@@ -33,8 +33,6 @@ dependencies:
flutter_localizations
:
sdk
:
flutter
dio
:
^5.8.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.8
shared_preferences
:
^2.5.2
json_annotation
:
^4.9.0
...
...
@@ -57,7 +55,6 @@ dependencies:
infinite_carousel
:
^1.0.3
package_info_plus
:
^4.1.0
dotted_border
:
^2.0.0
# contacts_service: ^0.6.3
flutter_contacts
:
^1.1.6
permission_handler
:
^11.0.0
share_plus
:
^7.2.1
...
...
@@ -65,6 +62,9 @@ dependencies:
month_picker_dialog
:
marquee
:
^2.2.3
fl_chart
:
^0.66.2
mobile_scanner
:
^3.5.7
encrypt
:
^5.0.1
connectivity_plus
:
game_miniapp
:
path
:
../mini_app/game_miniapp
dev_dependencies
:
...
...
Prev
1
2
3
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