repair back button

This commit is contained in:
kicap
2023-08-10 01:21:43 +08:00
parent 696c52efeb
commit 6c5bfde828
29 changed files with 956 additions and 845 deletions

View File

@ -40,7 +40,7 @@ class InputInformasiDiriView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.navigationService.navigateToMasukanNoHpView();
}
return false;

View File

@ -33,13 +33,13 @@ class InputInformasiDiriViewModel extends CustomBaseViewModel {
}
goToLogin() async {
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
easyLoading.customLoading("Mendaftarkan Akun Anda");
await Future.delayed(const Duration(seconds: 2));
easyLoading.customLoading("Ke Halaman Login");
await Future.delayed(const Duration(seconds: 2));
easyLoading.dismissLoading();
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
await navigationService.navigateToLoginUserView();
}

View File

@ -36,7 +36,7 @@ class MasukanNoHpView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.navigationService.navigateToLoginUserView();
}
return false;

View File

@ -16,9 +16,9 @@ class MasukanNoHpViewModel extends CustomBaseViewModel {
selanjutnya() async {
_easyloading.customLoading("Menghantar Kode OTP \nke WhatsApp Anda");
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
await Future.delayed(const Duration(seconds: 3));
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
_easyloading.dismissLoading();
await navigationService.navigateToVerifikasiNoHpView();

View File

@ -36,7 +36,7 @@ class VerifikasiNoHpView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.back();
}
return false;

View File

@ -9,11 +9,11 @@ class VerifikasiNoHpViewModel extends CustomBaseViewModel {
Future<void> init() async {}
goToInputInformasiDiri() async {
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
easyLoading.customLoading("Ke Halaman Input Informasi Diri");
await Future.delayed(const Duration(seconds: 3));
easyLoading.dismissLoading();
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
await navigationService.navigateToInputInformasiDiriView(
noHp: "082293246583",

View File

@ -23,7 +23,7 @@ class LoginUserView extends StatelessWidget {
return Scaffold(
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
// model.back();
model.quitApp(context);
}

View File

@ -17,12 +17,12 @@ class LoginUserViewModel extends CustomBaseViewModel {
login() async {
setBusy(true);
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
easyLoading.showLoading();
await Future.delayed(const Duration(seconds: 5));
easyLoading.dismissLoading();
setBusy(false);
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
await navigationService.navigateToUserIndexTrackingView();
}

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:reza_app/app/app.router.dart';
import 'package:reza_app/app/themes/app_colors.dart';
import 'package:reza_app/app/themes/app_text.dart';
import 'package:stacked/stacked.dart';
@ -26,119 +25,136 @@ class MejaDetailView extends StatelessWidget {
MejaDetailViewModel model,
Widget? child,
) {
return Scaffold(
appBar: AppBar(
title: const Text('MejaDetailView',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
leading: IconButton(
onPressed: () => model.navigationService.popUntil((route) =>
route.settings.name == Routes.userIndexTrackingView),
icon: const Icon(Icons.arrow_back, color: Colors.white),
return WillPopScope(
onWillPop: () async {
if (model.globalVar.backPressed == 'backNormal') {
model.globalVar.backPressed = 'exitApp';
return true;
}
// model.quitApp(context);
return false;
},
child: Scaffold(
appBar: AppBar(
title: const Text('MejaDetailView',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
leading: IconButton(
onPressed: () {
if (model.globalVar.backPressed == 'backNormal') {
model.globalVar.backPressed = 'exitApp';
model.navigationService.back();
// return true;
}
},
icon: const Icon(Icons.arrow_back, color: Colors.white),
),
),
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 250,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
body: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 250,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: model.imgAsset == null
? const Center(child: CircularProgressIndicator())
: Image.asset(model.imgAsset!, fit: BoxFit.cover),
),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: model.imgAsset == null
? const Center(child: CircularProgressIndicator())
: Image.asset(model.imgAsset!, fit: BoxFit.cover),
const SizedBox(height: 5),
Text(
model.namaMeja,
style: const TextStyle(
fontSize: 20,
// fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 5),
Text(
model.namaMeja,
style: const TextStyle(
fontSize: 20,
// fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Status : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Tersedia',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Status : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Tersedia',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
),
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Kapasitas : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Maksimal 8 Orang',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Kapasitas : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Maksimal 8 Orang',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
),
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Lokasi : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Luar Ruangan',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Lokasi : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Luar Ruangan',
style: regularTextStyle.copyWith(
color: Colors.green,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
),
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Harga : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Rp. 20.000',
style: regularTextStyle.copyWith(
color: Colors.orange,
fontWeight: FontWeight.bold,
const SizedBox(height: 10),
RichText(
text: TextSpan(
text: 'Harga : ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Rp. 20.000',
style: regularTextStyle.copyWith(
color: Colors.orange,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
),
],
],
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {},
label: const Text('Pesan'),
icon: const Icon(Icons.add_shopping_cart),
backgroundColor: mainColor,
),
floatingActionButtonAnimator: FloatingActionButtonAnimator.scaling,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {},
label: const Text('Pesan'),
icon: const Icon(Icons.add_shopping_cart),
backgroundColor: mainColor,
),
floatingActionButtonAnimator: FloatingActionButtonAnimator.scaling,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
);
},
);

View File

@ -13,7 +13,7 @@ class MejaDetailViewModel extends CustomBaseViewModel {
log.i('MejaDetailViewModel init');
log.i('mejaId : $mejaId');
this.mejaId = mejaId;
easyLoading.backPressed = 3;
globalVar.backPressed = 'backNormal';
// seperate the number from the string
var number = int.parse(mejaId.replaceAll(RegExp(r'[^0-9]'), ''));
// log.i('number : $number');

View File

@ -20,111 +20,122 @@ class AkunUserView extends StatelessWidget {
AkunUserViewModel model,
Widget? child,
) {
return Scaffold(
appBar: AppBar(
title: Text(
'Akun Saya',
style: boldTextStyle.copyWith(color: fontGrey, fontSize: 16),
),
// transparent
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
actions: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.logout_outlined,
color: fontGrey,
),
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di akun_user_view.dart');
if (model.globalVar.backPressed == 'exitApp') {
model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
return false;
}
return false;
},
child: Scaffold(
appBar: AppBar(
title: Text(
'Akun Saya',
style: boldTextStyle.copyWith(color: fontGrey, fontSize: 16),
),
],
),
backgroundColor: backgroundColor,
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 20),
// create a circle avatar 150x150 that contain the image
Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(150),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 150,
width: 150,
fit: BoxFit.fill,
errorBuilder: (context, error, stackTrace) {
return const Icon(Icons.error);
},
),
// transparent
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
actions: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.logout_outlined,
color: fontGrey,
),
),
const SizedBox(height: 10),
Row(
children: [
const Text('Nama'),
const Expanded(child: SizedBox(width: 10)),
Text(
'Reza',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
const SizedBox(height: 20),
Row(
children: [
const Text('Jenis Kelamin'),
const Expanded(child: SizedBox(width: 10)),
Text(
'Laki-laki',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
const SizedBox(height: 20),
Row(
children: [
const Text('Tanggal Lahir'),
const Expanded(child: SizedBox(width: 10)),
Text(
'12-12-1999',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
],
),
backgroundColor: backgroundColor,
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 20),
// create a circle avatar 150x150 that contain the image
Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(150),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 150,
width: 150,
fit: BoxFit.fill,
errorBuilder: (context, error, stackTrace) {
return const Icon(Icons.error);
},
),
),
),
const SizedBox(height: 10),
Row(
children: [
const Text('Nama'),
const Expanded(child: SizedBox(width: 10)),
Text(
'Reza',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
const SizedBox(height: 20),
Row(
children: [
const Text('Jenis Kelamin'),
const Expanded(child: SizedBox(width: 10)),
Text(
'Laki-laki',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
const SizedBox(height: 20),
Row(
children: [
const Text('Tanggal Lahir'),
const Expanded(child: SizedBox(width: 10)),
Text(
'12-12-1999',
style: regularTextStyle.copyWith(
color: fontGrey,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 10),
const Icon(
Icons.arrow_forward_ios,
color: fontGrey,
size: 15,
),
],
),
],
),
),
),
);
},

View File

@ -2,6 +2,6 @@ import 'package:reza_app/app/core/custom_base_view_model.dart';
class AkunUserViewModel extends CustomBaseViewModel {
Future<void> init() async {
easyLoading.backPressed = 2;
globalVar.backPressed = 'exitApp';
}
}

View File

@ -28,7 +28,17 @@ class DetailMakananView extends HookWidget {
DetailMakananViewModel model,
Widget? child,
) {
return Scaffold(
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di reservasi_meja_view.dart');
// if (model.globalVar.backPressed == 'exitApp') {
model.globalVar.backPressed = 'exitApp';
model.back();
return false;
// }
// return false;
},
child: Scaffold(
backgroundColor: backgroundColor,
body: SizedBox(
width: MediaQuery.of(context).size.width,
@ -203,7 +213,9 @@ class DetailMakananView extends HookWidget {
),
],
),
));
),
),
);
},
);
}
@ -257,6 +269,7 @@ class TopBarWidget extends ViewModelWidget<DetailMakananViewModel> {
),
child: IconButton(
onPressed: () {
viewModel.globalVar.backPressed = 'exitApp';
viewModel.back();
},
icon: const Icon(

View File

@ -5,6 +5,6 @@ class DetailMakananViewModel extends CustomBaseViewModel {
final log = getLogger('DetailMakananViewModel');
Future<void> init() async {
easyLoading.backPressed = 3;
globalVar.backPressed = 'backNormal';
}
}

View File

@ -21,7 +21,17 @@ class MakananListView extends StatelessWidget {
MakananListViewModel model,
Widget? child,
) {
return Scaffold(
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di reservasi_meja_view.dart');
if (model.globalVar.backPressed == 'exitApp') {
model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
return false;
}
return false;
},
child: Scaffold(
backgroundColor: backgroundColor,
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -38,7 +48,14 @@ class MakananListView extends StatelessWidget {
Expanded(
flex: 2,
child: IconButton(
onPressed: () => model.back(),
onPressed: () {
if (model.globalVar.backPressed == 'exitApp') {
model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
} else {
model.navigationService.back();
}
},
icon: const Icon(Icons.arrow_back),
),
),
@ -230,7 +247,9 @@ class MakananListView extends StatelessWidget {
],
),
),
));
),
),
);
},
);
}

View File

@ -5,7 +5,7 @@ import '../../../../app/core/custom_base_view_model.dart';
class MakananListViewModel extends CustomBaseViewModel {
final log = getLogger('MakananListViewModel');
Future<void> init() async {
easyLoading.backPressed = 2;
globalVar.backPressed = 'exitApp';
}
goToDetailMakanan() {

View File

@ -21,151 +21,164 @@ class KeranjangSayaView extends StatelessWidget {
KeranjangSayaViewModel model,
Widget? child,
) {
return Scaffold(
appBar: AppBar(
title: const Text('Keranjang Saya',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
iconTheme: const IconThemeData(color: Colors.white),
),
body: Column(
children: [
const SizedBox(height: 15),
Expanded(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10),
child: MyWhiteContainer(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// create a checkbox
Checkbox(
// check if the value is true or false
value: false,
// if true change the value to false
onChanged: (bool? value) {
// model.changeIsCheck(value!);
},
),
const SizedBox(width: 10),
// create a container 100x100 that contain the image
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di reservasi_meja_view.dart');
if (model.globalVar.backPressed == 'backNormal') {
// model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
return true;
}
return false;
},
child: Scaffold(
appBar: AppBar(
title: const Text('Keranjang Saya',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
iconTheme: const IconThemeData(color: Colors.white),
),
body: Column(
children: [
const SizedBox(height: 15),
Expanded(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10),
child: MyWhiteContainer(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// create a checkbox
Checkbox(
// check if the value is true or false
value: false,
// if true change the value to false
onChanged: (bool? value) {
// model.changeIsCheck(value!);
},
),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 150,
width: double.infinity,
fit: BoxFit.fill,
errorBuilder: (context, error, stackTrace) {
return const Icon(Icons.error);
},
const SizedBox(width: 10),
// create a container 100x100 that contain the image
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 150,
width: double.infinity,
fit: BoxFit.fill,
errorBuilder:
(context, error, stackTrace) {
return const Icon(Icons.error);
},
),
),
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Product Name ',
style: regularTextStyle.copyWith(
fontSize: 16),
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 5),
Text(
'Rp. 100.000',
style: boldTextStyle.copyWith(
color: redColor),
),
const SizedBox(height: 5),
// create a row that contain minus button, value, and plus button
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
// create a button minus
GestureDetector(
onTap: () {},
child: Container(
width: 25,
height: 25,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
color: stockColor,
),
child: const Icon(
Icons.remove,
color: mainGrey,
const SizedBox(width: 10),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Product Name ',
style: regularTextStyle.copyWith(
fontSize: 16),
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 5),
Text(
'Rp. 100.000',
style: boldTextStyle.copyWith(
color: redColor),
),
const SizedBox(height: 5),
// create a row that contain minus button, value, and plus button
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
// create a button minus
GestureDetector(
onTap: () {},
child: Container(
width: 25,
height: 25,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
color: stockColor,
),
child: const Icon(
Icons.remove,
color: mainGrey,
),
),
),
),
const SizedBox(width: 10),
// create a text that contain value
Text(
'1',
style: regularTextStyle.copyWith(
fontSize: 16,
),
),
const SizedBox(width: 10),
// create a button plus
GestureDetector(
onTap: () {},
child: Container(
width: 25,
height: 25,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
color: stockColor,
),
child: const Icon(
Icons.add,
color: mainGrey,
const SizedBox(width: 10),
// create a text that contain value
Text(
'1',
style: regularTextStyle.copyWith(
fontSize: 16,
),
),
),
],
),
],
const SizedBox(width: 10),
// create a button plus
GestureDetector(
onTap: () {},
child: Container(
width: 25,
height: 25,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
color: stockColor,
),
child: const Icon(
Icons.add,
color: mainGrey,
),
),
),
],
),
],
),
),
),
],
],
),
),
),
);
},
);
},
),
),
),
const SizedBox(height: 15),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
// create a shopping cart icon with a badge containing the number of items
child: const Icon(
Icons.shopping_cart_outlined,
color: Colors.white,
const SizedBox(height: 15),
],
),
));
floatingActionButton: FloatingActionButton(
onPressed: () {},
// create a shopping cart icon with a badge containing the number of items
child: const Icon(
Icons.shopping_cart_outlined,
color: Colors.white,
),
)),
);
},
);
}

View File

@ -5,6 +5,6 @@ import '../../../../../app/app.logger.dart';
class KeranjangSayaViewModel extends CustomBaseViewModel {
final log = getLogger('KeranjangSayaViewModel');
Future<void> init() async {
easyLoading.backPressed = 3;
globalVar.backPressed = 'backNormal';
}
}

View File

@ -22,93 +22,54 @@ class PesananListView extends StatelessWidget {
PesananListViewModel model,
Widget? child,
) {
return Scaffold(
appBar: AppBar(
title: Text(
'List Pesanan',
style: boldTextStyle.copyWith(color: Colors.white),
),
backgroundColor: mainColor,
automaticallyImplyLeading: false,
actions: [
// create a shopping cart icon with a badge containing the number of items
Container(
margin: const EdgeInsets.only(right: 10),
child: Stack(
children: [
IconButton(
onPressed: () {
model.navigationService.navigateToKeranjangSayaView();
},
icon: const Icon(Icons.shopping_cart_outlined,
color: Colors.white),
),
Positioned(
top: 5,
right: 5,
child: Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: const Center(
child: Text(
'9',
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
),
],
),
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di reservasi_meja_view.dart');
if (model.globalVar.backPressed == 'exitApp') {
model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
return false;
}
return false;
},
child: Scaffold(
appBar: AppBar(
title: Text(
'List Pesanan',
style: boldTextStyle.copyWith(color: Colors.white),
),
],
),
backgroundColor: backgroundColor,
body: Column(
children: [
MyWhiteContainer(
child: IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
backgroundColor: mainColor,
automaticallyImplyLeading: false,
actions: [
// create a shopping cart icon with a badge containing the number of items
Container(
margin: const EdgeInsets.only(right: 10),
child: Stack(
children: [
Expanded(
child: TextButton(
onPressed: () {},
child: const Text('Dikemas'),
),
IconButton(
onPressed: () {
model.navigationService.navigateToKeranjangSayaView();
},
icon: const Icon(Icons.shopping_cart_outlined,
color: Colors.white),
),
const VerticalDivider(
color: mainGrey,
thickness: 1,
),
Expanded(
child: TextButton(
onPressed: () {},
child: const Text(
'Dikirim',
style: TextStyle(
color: mainGrey,
),
Positioned(
top: 5,
right: 5,
child: Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
),
),
const VerticalDivider(
color: Colors.grey,
thickness: 1,
),
Expanded(
child: TextButton(
onPressed: () {},
child: const Text(
'Selesai',
style: TextStyle(
color: mainGrey,
child: const Center(
child: Text(
'9',
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
@ -116,193 +77,246 @@ class PesananListView extends StatelessWidget {
],
),
),
),
const SizedBox(
height: 15,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10),
child: MyWhiteContainer(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20,
],
),
backgroundColor: backgroundColor,
body: Column(
children: [
MyWhiteContainer(
child: IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: TextButton(
onPressed: () {},
child: const Text('Dikemas'),
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 100,
width: double.infinity,
fit: BoxFit.fill,
errorBuilder:
(context, error, stackTrace) {
return const Icon(Icons.error);
},
),
const VerticalDivider(
color: mainGrey,
thickness: 1,
),
Expanded(
child: TextButton(
onPressed: () {},
child: const Text(
'Dikirim',
style: TextStyle(
color: mainGrey,
),
),
),
),
const VerticalDivider(
color: Colors.grey,
thickness: 1,
),
Expanded(
child: TextButton(
onPressed: () {},
child: const Text(
'Selesai',
style: TextStyle(
color: mainGrey,
),
),
),
),
],
),
),
),
const SizedBox(
height: 15,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 10),
child: MyWhiteContainer(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20,
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
height: 100,
width: double.infinity,
fit: BoxFit.fill,
errorBuilder:
(context, error, stackTrace) {
return const Icon(Icons.error);
},
),
),
),
const SizedBox(
width: 20,
),
Expanded(
child: IntrinsicHeight(
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
'Nama Makanan',
style:
regularTextStyle.copyWith(
fontSize: 17,
),
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(
height: 5,
),
Align(
alignment: Alignment.centerRight,
child: Text(
'x 1',
style:
regularTextStyle.copyWith(
color: mainGrey,
fontSize: 17,
),
),
),
const SizedBox(
height: 5,
),
Align(
alignment: Alignment.centerRight,
child: Text(
'Rp. 100.000',
style:
regularTextStyle.copyWith(
color: redColor,
fontSize: 17,
),
),
),
],
),
),
)
],
),
const SizedBox(
height: 10,
),
Center(
child: Text(
'Tampilkan Produk Lain',
style: regularTextStyle.copyWith(
color: mainGrey,
),
),
const SizedBox(
width: 20,
),
Expanded(
child: IntrinsicHeight(
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const Text(
'3 Item',
style: regularTextStyle,
),
const Expanded(child: SizedBox()),
RichText(
text: TextSpan(
text: 'Total Pesanan: ',
style: regularTextStyle,
children: [
Expanded(
child: Text(
'Nama Makanan',
style: regularTextStyle.copyWith(
fontSize: 17,
),
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(
height: 5,
),
Align(
alignment: Alignment.centerRight,
child: Text(
'x 1',
style: regularTextStyle.copyWith(
color: mainGrey,
fontSize: 17,
),
),
),
const SizedBox(
height: 5,
),
Align(
alignment: Alignment.centerRight,
child: Text(
'Rp. 100.000',
style: regularTextStyle.copyWith(
color: redColor,
fontSize: 17,
),
TextSpan(
text: 'Rp. 300.000',
style: regularTextStyle.copyWith(
color: redColor,
fontWeight: FontWeight.bold,
),
),
],
),
),
)
],
),
const SizedBox(
height: 10,
),
Center(
child: Text(
'Tampilkan Produk Lain',
style: regularTextStyle.copyWith(
color: mainGrey,
),
],
),
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const Text(
'3 Item',
style: regularTextStyle,
),
const Expanded(child: SizedBox()),
RichText(
text: TextSpan(
text: 'Total Pesanan: ',
style: regularTextStyle,
children: [
TextSpan(
text: 'Rp. 300.000',
style: regularTextStyle.copyWith(
color: redColor,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
const SizedBox(
height: 15,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
// lorry icon
const Icon(
Icons.local_shipping_outlined,
color: mainColor,
),
const SizedBox(
width: 5,
),
Text(
'Pesanan telah sampai',
style: regularTextStyle.copyWith(
const SizedBox(
height: 15,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
// lorry icon
const Icon(
Icons.local_shipping_outlined,
color: mainColor,
),
),
const SizedBox(
width: 5,
),
Text(
'Pesanan telah sampai',
style: regularTextStyle.copyWith(
color: mainColor,
),
),
const Expanded(child: SizedBox()),
const Icon(
Icons.arrow_forward_ios,
color: mainGrey,
size: 15,
),
],
),
],
const Expanded(child: SizedBox()),
const Icon(
Icons.arrow_forward_ios,
color: mainGrey,
size: 15,
),
],
),
],
),
),
),
),
);
},
);
},
),
),
),
],
],
),
// floatingActionButton: FloatingActionButton.extended(
// onPressed: () {},
// label: Text(
// 'Pesan',
// style: boldTextStyle.copyWith(color: Colors.white),
// ),
// icon: const Icon(
// Icons.shopping_cart,
// color: Colors.white,
// ),
// backgroundColor: mainColor,
// ),
),
// floatingActionButton: FloatingActionButton.extended(
// onPressed: () {},
// label: Text(
// 'Pesan',
// style: boldTextStyle.copyWith(color: Colors.white),
// ),
// icon: const Icon(
// Icons.shopping_cart,
// color: Colors.white,
// ),
// backgroundColor: mainColor,
// ),
);
},
);

View File

@ -2,6 +2,6 @@ import 'package:reza_app/app/core/custom_base_view_model.dart';
class PesananListViewModel extends CustomBaseViewModel {
Future<void> init() async {
easyLoading.backPressed = 2;
globalVar.backPressed = 'exitApp';
}
}

View File

@ -23,183 +23,198 @@ class ReservasiMejaView extends StatelessWidget {
ReservasiMejaViewModel model,
Widget? child,
) {
return Scaffold(
appBar: AppBar(
title: const Text('RESERVASI MEJA',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
automaticallyImplyLeading: false,
actions: [
// create a shopping cart icon with a badge containing the number of items
Container(
margin: const EdgeInsets.only(right: 10),
child: Stack(
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.shopping_cart_outlined,
color: Colors.white),
),
Positioned(
top: 5,
right: 5,
child: Container(
return WillPopScope(
onWillPop: () async {
// model.log.i('onWillPop di reservasi_meja_view.dart');
if (model.globalVar.backPressed == 'exitApp') {
model.quitApp(context);
model.globalVar.backPressed = 'exitApp';
return false;
}
return false;
},
child: Scaffold(
appBar: AppBar(
title: const Text('RESERVASI MEJA',
style: TextStyle(color: Colors.white)),
backgroundColor: mainColor,
automaticallyImplyLeading: false,
actions: [
// create a shopping cart icon with a badge containing the number of items
Container(
margin: const EdgeInsets.only(right: 10),
child: Stack(
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.shopping_cart_outlined,
color: Colors.white),
),
Positioned(
top: 5,
right: 5,
child: Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: const Center(
child: Text(
'9',
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
),
],
),
),
],
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 20,
),
CarouselSlider.builder(
itemCount: model.imagePaths.length,
itemBuilder:
(BuildContext context, int index, int realIndex) {
return SizedBox(
width: MediaQuery.of(context)
.size
.width, // Set the width to full width
child: Image.asset(
model.imagePaths[index],
fit: BoxFit.cover,
),
);
},
options: CarouselOptions(
autoPlay: true,
aspectRatio: 2.0,
enlargeCenterPage: true,
),
),
Expanded(
child: WebView(
initialUrl: dotenv.env['table_url'],
// initialUrl: 'http://172.29.85.181/parkir/user',
// initialUrl: 'https://rekam-medis.airlangga-it.com/',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// model.controllerCompleter.future
// .then((value) => model.webViewController = value);
// model.controllerCompleter.complete(webViewController);
},
onProgress: (int progress) {
// model.log.i('WebView is loading (progress : $progress%)');
// show a loading indicator when the WebView is loading using circular progress indicator
model.easyLoading.customLoading('Loading Data Meja');
},
// javascriptChannels: <JavascriptChannel>{
// _toasterJavascriptChannel(context),
// },
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: 'messageHandler',
onMessageReceived: (JavascriptMessage message) async {
// model.log.i('messageHandler : ${message.message}');
// model.easyLoading.backPressed = 1;
model.notifyListeners();
// model.log.i(
// 'backPressed : ${model.easyLoading.backPressed}');
String mejaId = message.message;
model.navigationService.navigateToView(
MejaDetailView(
mejaId: mejaId,
),
);
},
),
JavascriptChannel(
name: 'messageHandler1',
onMessageReceived: (JavascriptMessage message) async {
// String no_telpon = message.message;
// dev.i('no_telpon : $no_telpon');
// await launchUrl(Uri.parse('tel:$no_telpon'));
},
),
},
navigationDelegate: (NavigationRequest request) async {
// if (request.url.startsWith('https://www.youtube.com/')) {
// dev.log('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// check if request.url has 'nrm'
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
model.log.i('Page started loading: $url');
},
onPageFinished: (String url) {
model.log.i('Page finished loading: $url');
model.easyLoading.dismissLoading();
},
gestureNavigationEnabled: true,
backgroundColor: const Color(0x00000000),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
// create 3 circle color
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Color.fromRGBO(223, 216, 214, 1),
shape: BoxShape.circle,
),
),
const SizedBox(width: 5),
const Text('Tersedia'),
const SizedBox(width: 10),
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: const Center(
child: Text(
'9',
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
const SizedBox(width: 5),
const Text('Tidak Tersedia'),
const SizedBox(width: 10),
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.blue,
shape: BoxShape.circle,
),
),
),
],
const SizedBox(width: 5),
const Text('Dipesan'),
const SizedBox(width: 10),
],
),
),
),
],
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 20,
),
CarouselSlider.builder(
itemCount: model.imagePaths.length,
itemBuilder: (BuildContext context, int index, int realIndex) {
return SizedBox(
width: MediaQuery.of(context)
.size
.width, // Set the width to full width
child: Image.asset(
model.imagePaths[index],
fit: BoxFit.cover,
),
);
},
options: CarouselOptions(
autoPlay: true,
aspectRatio: 2.0,
enlargeCenterPage: true,
),
),
Expanded(
child: WebView(
initialUrl: dotenv.env['table_url'],
// initialUrl: 'http://172.29.85.181/parkir/user',
// initialUrl: 'https://rekam-medis.airlangga-it.com/',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// model.controllerCompleter.future
// .then((value) => model.webViewController = value);
// model.controllerCompleter.complete(webViewController);
},
onProgress: (int progress) {
model.log.i('WebView is loading (progress : $progress%)');
},
// javascriptChannels: <JavascriptChannel>{
// _toasterJavascriptChannel(context),
// },
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: 'messageHandler',
onMessageReceived: (JavascriptMessage message) async {
// model.log.i('messageHandler : ${message.message}');
model.easyLoading.backPressed = 1;
model.notifyListeners();
model.log.i(
'backPressed : ${model.easyLoading.backPressed}');
String mejaId = message.message;
model.navigationService.navigateToView(
MejaDetailView(
mejaId: mejaId,
),
);
},
),
JavascriptChannel(
name: 'messageHandler1',
onMessageReceived: (JavascriptMessage message) async {
// String no_telpon = message.message;
// dev.i('no_telpon : $no_telpon');
// await launchUrl(Uri.parse('tel:$no_telpon'));
},
),
},
navigationDelegate: (NavigationRequest request) async {
// if (request.url.startsWith('https://www.youtube.com/')) {
// dev.log('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// check if request.url has 'nrm'
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
model.log.i('Page started loading: $url');
},
onPageFinished: (String url) {
model.log.i('Page finished loading: $url');
},
gestureNavigationEnabled: true,
backgroundColor: const Color(0x00000000),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
// create 3 circle color
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Color.fromRGBO(223, 216, 214, 1),
shape: BoxShape.circle,
),
),
const SizedBox(width: 5),
const Text('Tersedia'),
const SizedBox(width: 10),
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
),
const SizedBox(width: 5),
const Text('Tidak Tersedia'),
const SizedBox(width: 10),
Container(
width: 20,
height: 20,
decoration: const BoxDecoration(
color: Colors.blue,
shape: BoxShape.circle,
),
),
const SizedBox(width: 5),
const Text('Dipesan'),
const SizedBox(width: 10),
],
),
),
],
],
),
),
);
},

View File

@ -13,6 +13,6 @@ class ReservasiMejaViewModel extends CustomBaseViewModel {
];
Future<void> init() async {
easyLoading.backPressed = 2;
globalVar.backPressed = 'exitApp';
}
}

View File

@ -1,52 +1,49 @@
import 'package:back_button_interceptor/back_button_interceptor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:reza_app/services/my_easyloading.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';
import '../../../../app/app.locator.dart';
import '../../../../app/app.logger.dart';
import '../../../../app/app.router.dart';
import '../../../../app/themes/app_colors.dart';
import '../../../../services/global_var.dart';
class UserIndexTrackingViewModel extends IndexTrackingViewModel {
final log = getLogger('UserIndexTrackingViewModel');
final navigationService = locator<NavigationService>();
final easyLoading = locator<MyEasyLoading>();
final globalVar = locator<GlobalVar>();
// late bool backPressed;
Future<void> init() async {
BackButtonInterceptor.add(myInterceptor);
// BackButtonInterceptor.add(myInterceptor);
// backPressed = easyLoading.backPressed;
easyLoading.backPressed = 2;
globalVar.backPressed = 'exitApp';
}
bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
// print("BACK BUTTON!"); // Do some stuff.
// bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
// // print("BACK BUTTON!"); // Do some stuff.
log.i('myInterceptor : ${easyLoading.backPressed}');
// log.i('myInterceptor : ${easyLoading.backPressed}');
if (easyLoading.backPressed == 2) {
quitApp(null);
}
// if (easyLoading.backPressed == 2) {
// quitApp(null);
// }
if (easyLoading.backPressed == 3) {
// easyLoading.backPressed = 2;
// notifyListeners();
// navigationService.back();
easyLoading.backPressed = 2;
return false;
}
// if (easyLoading.backPressed == 3) {
// // easyLoading.backPressed = 2;
// // notifyListeners();
// // navigationService.back();
// easyLoading.backPressed = 2;
// return false;
// }
if (easyLoading.backPressed == 1) {
// easyLoading.backPressed = 2;
// notifyListeners();
// navigationService.back();
return false;
}
// if (easyLoading.backPressed == 1) {
// // easyLoading.backPressed = 2;
// // notifyListeners();
// // navigationService.back();
// return false;
// }
return true;
}
// return true;
// }
final _bottomNavBarList = [
{
@ -95,37 +92,37 @@ class UserIndexTrackingViewModel extends IndexTrackingViewModel {
);
}
quitApp(BuildContext? context) {
easyLoading.backPressed = 0;
showDialog(
context: context ?? StackedService.navigatorKey!.currentContext!,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Keluar'),
content: const Text('Apakah Anda yakin ingin keluar?'),
actions: [
TextButton(
onPressed: () {
easyLoading.backPressed = 2;
Navigator.of(context).pop(false);
},
child: const Text('Batal'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: const Text(
'Keluar',
style: TextStyle(color: dangerColor),
),
),
],
);
},
).then((value) {
if (value == true) {
SystemNavigator.pop();
}
});
notifyListeners();
}
// quitApp(BuildContext? context) {
// easyLoading.backPressed = 0;
// showDialog(
// context: context ?? StackedService.navigatorKey!.currentContext!,
// builder: (BuildContext context) {
// return AlertDialog(
// title: const Text('Keluar'),
// content: const Text('Apakah Anda yakin ingin keluar?'),
// actions: [
// TextButton(
// onPressed: () {
// easyLoading.backPressed = 2;
// Navigator.of(context).pop(false);
// },
// child: const Text('Batal'),
// ),
// TextButton(
// onPressed: () => Navigator.of(context).pop(true),
// child: const Text(
// 'Keluar',
// style: TextStyle(color: dangerColor),
// ),
// ),
// ],
// );
// },
// ).then((value) {
// if (value == true) {
// SystemNavigator.pop();
// }
// });
// notifyListeners();
// }
}