added shoping and pesanan page
This commit is contained in:
5
.env
5
.env
@ -2,5 +2,6 @@
|
|||||||
# api_url = 'https://panti-asuhan.s-keytech.com/api/'
|
# api_url = 'https://panti-asuhan.s-keytech.com/api/'
|
||||||
# # url = 'http://172.29.85.181/panti_asuhan2/'
|
# # url = 'http://172.29.85.181/panti_asuhan2/'
|
||||||
# # api_url = 'http://172.29.85.181/panti_asuhan2/api/'
|
# # api_url = 'http://172.29.85.181/panti_asuhan2/api/'
|
||||||
url = 'http://20.20.20.25/panti_asuhan2/'
|
url = 'http://20.20.20.25:3001/'
|
||||||
api_url = 'http://20.20.20.25/panti_asuhan2/api/'
|
table_url = 'http://20.20.20.25:3001/table'
|
||||||
|
api_url = 'http://20.20.20.25:3001/table'
|
||||||
@ -2,7 +2,9 @@
|
|||||||
<application
|
<application
|
||||||
android:label="reza_app"
|
android:label="reza_app"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
>
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
BIN
assets/reza_gazebo.jpeg
Normal file
BIN
assets/reza_gazebo.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
BIN
assets/reza_meja_1.jpeg
Normal file
BIN
assets/reza_meja_1.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
BIN
assets/reza_meja_2.jpeg
Normal file
BIN
assets/reza_meja_2.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@ -1,9 +1,5 @@
|
|||||||
import 'package:reza_app/ui/views/user_ui/akun_user/akun_user_view.dart';
|
import 'package:reza_app/ui/views/meja_detail/meja_detail_view.dart';
|
||||||
import 'package:reza_app/ui/views/user_ui/makanan_list/detail_makanan/detail_makanan_view.dart';
|
import 'package:reza_app/ui/views/user_ui/pesanan_list/keranjang_saya/keranjang_saya_view.dart';
|
||||||
import 'package:reza_app/ui/views/user_ui/makanan_list/makanan_list_view.dart';
|
|
||||||
import 'package:reza_app/ui/views/user_ui/pesanan_list/pesanan_list_view.dart';
|
|
||||||
import 'package:reza_app/ui/views/user_ui/reservasi_meja/reservasi_meja_view.dart';
|
|
||||||
import 'package:reza_app/ui/views/user_ui/user_index_tracking/user_index_tracking_view.dart';
|
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
import 'package:stacked/stacked_annotations.dart';
|
import 'package:stacked/stacked_annotations.dart';
|
||||||
|
|
||||||
@ -14,6 +10,12 @@ import '../ui/views/daftar_user_ui/masukan_no_hp/masukan_no_hp_view.dart';
|
|||||||
import '../ui/views/daftar_user_ui/verifikasi_no_hp/verifikasi_no_hp_view.dart';
|
import '../ui/views/daftar_user_ui/verifikasi_no_hp/verifikasi_no_hp_view.dart';
|
||||||
import '../ui/views/login_user/login_user_view.dart';
|
import '../ui/views/login_user/login_user_view.dart';
|
||||||
import '../ui/views/splash_screen/splash_screen_view.dart';
|
import '../ui/views/splash_screen/splash_screen_view.dart';
|
||||||
|
import '../ui/views/user_ui/akun_user/akun_user_view.dart';
|
||||||
|
import '../ui/views/user_ui/makanan_list/detail_makanan/detail_makanan_view.dart';
|
||||||
|
import '../ui/views/user_ui/makanan_list/makanan_list_view.dart';
|
||||||
|
import '../ui/views/user_ui/pesanan_list/pesanan_list_view.dart';
|
||||||
|
import '../ui/views/user_ui/reservasi_meja/reservasi_meja_view.dart';
|
||||||
|
import '../ui/views/user_ui/user_index_tracking/user_index_tracking_view.dart';
|
||||||
|
|
||||||
@StackedApp(
|
@StackedApp(
|
||||||
routes: [
|
routes: [
|
||||||
@ -33,6 +35,8 @@ import '../ui/views/splash_screen/splash_screen_view.dart';
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
MaterialRoute(page: DetailMakananView),
|
MaterialRoute(page: DetailMakananView),
|
||||||
|
MaterialRoute(page: MejaDetailView),
|
||||||
|
MaterialRoute(page: KeranjangSayaView)
|
||||||
],
|
],
|
||||||
// dialogs: [
|
// dialogs: [
|
||||||
// StackedDialog(classType: AddSiswaDialogView),
|
// StackedDialog(classType: AddSiswaDialogView),
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||||
import 'package:flutter/material.dart' as _i9;
|
import 'package:flutter/material.dart' as _i11;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:reza_app/ui/views/daftar_user_ui/input_informasi_diri/input_informasi_diri_view.dart'
|
import 'package:reza_app/ui/views/daftar_user_ui/input_informasi_diri/input_informasi_diri_view.dart'
|
||||||
as _i6;
|
as _i6;
|
||||||
@ -14,21 +14,24 @@ import 'package:reza_app/ui/views/daftar_user_ui/masukan_no_hp/masukan_no_hp_vie
|
|||||||
import 'package:reza_app/ui/views/daftar_user_ui/verifikasi_no_hp/verifikasi_no_hp_view.dart'
|
import 'package:reza_app/ui/views/daftar_user_ui/verifikasi_no_hp/verifikasi_no_hp_view.dart'
|
||||||
as _i5;
|
as _i5;
|
||||||
import 'package:reza_app/ui/views/login_user/login_user_view.dart' as _i3;
|
import 'package:reza_app/ui/views/login_user/login_user_view.dart' as _i3;
|
||||||
|
import 'package:reza_app/ui/views/meja_detail/meja_detail_view.dart' as _i9;
|
||||||
import 'package:reza_app/ui/views/splash_screen/splash_screen_view.dart' as _i2;
|
import 'package:reza_app/ui/views/splash_screen/splash_screen_view.dart' as _i2;
|
||||||
import 'package:reza_app/ui/views/user_ui/akun_user/akun_user_view.dart'
|
import 'package:reza_app/ui/views/user_ui/akun_user/akun_user_view.dart'
|
||||||
as _i13;
|
as _i15;
|
||||||
import 'package:reza_app/ui/views/user_ui/makanan_list/detail_makanan/detail_makanan_view.dart'
|
import 'package:reza_app/ui/views/user_ui/makanan_list/detail_makanan/detail_makanan_view.dart'
|
||||||
as _i8;
|
as _i8;
|
||||||
import 'package:reza_app/ui/views/user_ui/makanan_list/makanan_list_view.dart'
|
import 'package:reza_app/ui/views/user_ui/makanan_list/makanan_list_view.dart'
|
||||||
as _i11;
|
as _i13;
|
||||||
import 'package:reza_app/ui/views/user_ui/pesanan_list/pesanan_list_view.dart'
|
import 'package:reza_app/ui/views/user_ui/pesanan_list/keranjang_saya/keranjang_saya_view.dart'
|
||||||
as _i12;
|
|
||||||
import 'package:reza_app/ui/views/user_ui/reservasi_meja/reservasi_meja_view.dart'
|
|
||||||
as _i10;
|
as _i10;
|
||||||
|
import 'package:reza_app/ui/views/user_ui/pesanan_list/pesanan_list_view.dart'
|
||||||
|
as _i14;
|
||||||
|
import 'package:reza_app/ui/views/user_ui/reservasi_meja/reservasi_meja_view.dart'
|
||||||
|
as _i12;
|
||||||
import 'package:reza_app/ui/views/user_ui/user_index_tracking/user_index_tracking_view.dart'
|
import 'package:reza_app/ui/views/user_ui/user_index_tracking/user_index_tracking_view.dart'
|
||||||
as _i7;
|
as _i7;
|
||||||
import 'package:stacked/stacked.dart' as _i1;
|
import 'package:stacked/stacked.dart' as _i1;
|
||||||
import 'package:stacked_services/stacked_services.dart' as _i14;
|
import 'package:stacked_services/stacked_services.dart' as _i16;
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
static const splashScreenView = '/';
|
static const splashScreenView = '/';
|
||||||
@ -45,6 +48,10 @@ class Routes {
|
|||||||
|
|
||||||
static const detailMakananView = '/detail-makanan-view';
|
static const detailMakananView = '/detail-makanan-view';
|
||||||
|
|
||||||
|
static const mejaDetailView = '/meja-detail-view';
|
||||||
|
|
||||||
|
static const keranjangSayaView = '/keranjang-saya-view';
|
||||||
|
|
||||||
static const all = <String>{
|
static const all = <String>{
|
||||||
splashScreenView,
|
splashScreenView,
|
||||||
loginUserView,
|
loginUserView,
|
||||||
@ -53,6 +60,8 @@ class Routes {
|
|||||||
inputInformasiDiriView,
|
inputInformasiDiriView,
|
||||||
userIndexTrackingView,
|
userIndexTrackingView,
|
||||||
detailMakananView,
|
detailMakananView,
|
||||||
|
mejaDetailView,
|
||||||
|
keranjangSayaView,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,54 +95,76 @@ class StackedRouter extends _i1.RouterBase {
|
|||||||
Routes.detailMakananView,
|
Routes.detailMakananView,
|
||||||
page: _i8.DetailMakananView,
|
page: _i8.DetailMakananView,
|
||||||
),
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
Routes.mejaDetailView,
|
||||||
|
page: _i9.MejaDetailView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
Routes.keranjangSayaView,
|
||||||
|
page: _i10.KeranjangSayaView,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
||||||
_i2.SplashScreenView: (data) {
|
_i2.SplashScreenView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i2.SplashScreenView(),
|
builder: (context) => const _i2.SplashScreenView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i3.LoginUserView: (data) {
|
_i3.LoginUserView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i3.LoginUserView(),
|
builder: (context) => const _i3.LoginUserView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i4.MasukanNoHpView: (data) {
|
_i4.MasukanNoHpView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i4.MasukanNoHpView(),
|
builder: (context) => const _i4.MasukanNoHpView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i5.VerifikasiNoHpView: (data) {
|
_i5.VerifikasiNoHpView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i5.VerifikasiNoHpView(),
|
builder: (context) => const _i5.VerifikasiNoHpView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i6.InputInformasiDiriView: (data) {
|
_i6.InputInformasiDiriView: (data) {
|
||||||
final args = data.getArgs<InputInformasiDiriViewArguments>(nullOk: false);
|
final args = data.getArgs<InputInformasiDiriViewArguments>(nullOk: false);
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
_i6.InputInformasiDiriView(key: args.key, noHp: args.noHp),
|
_i6.InputInformasiDiriView(key: args.key, noHp: args.noHp),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i7.UserIndexTrackingView: (data) {
|
_i7.UserIndexTrackingView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i7.UserIndexTrackingView(),
|
builder: (context) => const _i7.UserIndexTrackingView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
fullscreenDialog: true,
|
fullscreenDialog: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i8.DetailMakananView: (data) {
|
_i8.DetailMakananView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i8.DetailMakananView(),
|
builder: (context) => const _i8.DetailMakananView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
_i9.MejaDetailView: (data) {
|
||||||
|
final args = data.getArgs<MejaDetailViewArguments>(nullOk: false);
|
||||||
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) =>
|
||||||
|
_i9.MejaDetailView(key: args.key, mejaId: args.mejaId),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i10.KeranjangSayaView: (data) {
|
||||||
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i10.KeranjangSayaView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -148,7 +179,7 @@ class InputInformasiDiriViewArguments {
|
|||||||
required this.noHp,
|
required this.noHp,
|
||||||
});
|
});
|
||||||
|
|
||||||
final _i9.Key? key;
|
final _i11.Key? key;
|
||||||
|
|
||||||
final String noHp;
|
final String noHp;
|
||||||
|
|
||||||
@ -169,6 +200,33 @@ class InputInformasiDiriViewArguments {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MejaDetailViewArguments {
|
||||||
|
const MejaDetailViewArguments({
|
||||||
|
this.key,
|
||||||
|
required this.mejaId,
|
||||||
|
});
|
||||||
|
|
||||||
|
final _i11.Key? key;
|
||||||
|
|
||||||
|
final String mejaId;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return '{"key": "$key", "mejaId": "$mejaId"}';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(covariant MejaDetailViewArguments other) {
|
||||||
|
if (identical(this, other)) return true;
|
||||||
|
return other.key == key && other.mejaId == mejaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return key.hashCode ^ mejaId.hashCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class UserIndexTrackingViewRoutes {
|
class UserIndexTrackingViewRoutes {
|
||||||
static const reservasiMejaView = '';
|
static const reservasiMejaView = '';
|
||||||
|
|
||||||
@ -190,44 +248,44 @@ class UserIndexTrackingViewRouter extends _i1.RouterBase {
|
|||||||
final _routes = <_i1.RouteDef>[
|
final _routes = <_i1.RouteDef>[
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
UserIndexTrackingViewRoutes.reservasiMejaView,
|
UserIndexTrackingViewRoutes.reservasiMejaView,
|
||||||
page: _i10.ReservasiMejaView,
|
page: _i12.ReservasiMejaView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
UserIndexTrackingViewRoutes.makananListView,
|
UserIndexTrackingViewRoutes.makananListView,
|
||||||
page: _i11.MakananListView,
|
page: _i13.MakananListView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
UserIndexTrackingViewRoutes.pesananListView,
|
UserIndexTrackingViewRoutes.pesananListView,
|
||||||
page: _i12.PesananListView,
|
page: _i14.PesananListView,
|
||||||
),
|
),
|
||||||
_i1.RouteDef(
|
_i1.RouteDef(
|
||||||
UserIndexTrackingViewRoutes.akunUserView,
|
UserIndexTrackingViewRoutes.akunUserView,
|
||||||
page: _i13.AkunUserView,
|
page: _i15.AkunUserView,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
||||||
_i10.ReservasiMejaView: (data) {
|
_i12.ReservasiMejaView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i10.ReservasiMejaView(),
|
builder: (context) => const _i12.ReservasiMejaView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i11.MakananListView: (data) {
|
_i13.MakananListView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i11.MakananListView(),
|
builder: (context) => const _i13.MakananListView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i12.PesananListView: (data) {
|
_i14.PesananListView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i12.PesananListView(),
|
builder: (context) => const _i14.PesananListView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i13.AkunUserView: (data) {
|
_i15.AkunUserView: (data) {
|
||||||
return _i9.MaterialPageRoute<dynamic>(
|
return _i11.MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i13.AkunUserView(),
|
builder: (context) => const _i15.AkunUserView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -239,7 +297,7 @@ class UserIndexTrackingViewRouter extends _i1.RouterBase {
|
|||||||
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NavigatorStateExtension on _i14.NavigationService {
|
extension NavigatorStateExtension on _i16.NavigationService {
|
||||||
Future<dynamic> navigateToSplashScreenView([
|
Future<dynamic> navigateToSplashScreenView([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
@ -297,7 +355,7 @@ extension NavigatorStateExtension on _i14.NavigationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> navigateToInputInformasiDiriView({
|
Future<dynamic> navigateToInputInformasiDiriView({
|
||||||
_i9.Key? key,
|
_i11.Key? key,
|
||||||
required String noHp,
|
required String noHp,
|
||||||
int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
@ -341,6 +399,37 @@ extension NavigatorStateExtension on _i14.NavigationService {
|
|||||||
transition: transition);
|
transition: transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> navigateToMejaDetailView({
|
||||||
|
_i11.Key? key,
|
||||||
|
required String mejaId,
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
}) async {
|
||||||
|
return navigateTo<dynamic>(Routes.mejaDetailView,
|
||||||
|
arguments: MejaDetailViewArguments(key: key, mejaId: mejaId),
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> navigateToKeranjangSayaView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(Routes.keranjangSayaView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
Future<dynamic>
|
Future<dynamic>
|
||||||
navigateToNestedReservasiMejaViewInUserIndexTrackingViewRouter([
|
navigateToNestedReservasiMejaViewInUserIndexTrackingViewRouter([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
@ -455,7 +544,7 @@ extension NavigatorStateExtension on _i14.NavigationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> replaceWithInputInformasiDiriView({
|
Future<dynamic> replaceWithInputInformasiDiriView({
|
||||||
_i9.Key? key,
|
_i11.Key? key,
|
||||||
required String noHp,
|
required String noHp,
|
||||||
int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
@ -499,6 +588,37 @@ extension NavigatorStateExtension on _i14.NavigationService {
|
|||||||
transition: transition);
|
transition: transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithMejaDetailView({
|
||||||
|
_i11.Key? key,
|
||||||
|
required String mejaId,
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
}) async {
|
||||||
|
return replaceWith<dynamic>(Routes.mejaDetailView,
|
||||||
|
arguments: MejaDetailViewArguments(key: key, mejaId: mejaId),
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithKeranjangSayaView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(Routes.keranjangSayaView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
Future<dynamic>
|
Future<dynamic>
|
||||||
replaceWithNestedReservasiMejaViewInUserIndexTrackingViewRouter([
|
replaceWithNestedReservasiMejaViewInUserIndexTrackingViewRouter([
|
||||||
int? routerId,
|
int? routerId,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class CustomBaseViewModel extends BaseViewModel {
|
|||||||
final easyLoading = locator<MyEasyLoading>();
|
final easyLoading = locator<MyEasyLoading>();
|
||||||
final httpService = locator<MyHttpServices>();
|
final httpService = locator<MyHttpServices>();
|
||||||
|
|
||||||
bool backPressed = true;
|
// late bool backPressed;
|
||||||
|
|
||||||
void back() {
|
void back() {
|
||||||
navigationService.back();
|
navigationService.back();
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
|
||||||
class MyEasyLoading {
|
class MyEasyLoading {
|
||||||
|
int backPressed = 1;
|
||||||
|
|
||||||
showLoading() {
|
showLoading() {
|
||||||
EasyLoading.show(
|
EasyLoading.show(
|
||||||
status: 'loading...',
|
status: 'loading...',
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class InputInformasiDiriView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: WillPopScope(
|
body: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (model.backPressed) {
|
if (model.easyLoading.backPressed == 1) {
|
||||||
model.navigationService.navigateToMasukanNoHpView();
|
model.navigationService.navigateToMasukanNoHpView();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -33,13 +33,13 @@ class InputInformasiDiriViewModel extends CustomBaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goToLogin() async {
|
goToLogin() async {
|
||||||
backPressed = false;
|
easyLoading.backPressed = 0;
|
||||||
easyLoading.customLoading("Mendaftarkan Akun Anda");
|
easyLoading.customLoading("Mendaftarkan Akun Anda");
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
easyLoading.customLoading("Ke Halaman Login");
|
easyLoading.customLoading("Ke Halaman Login");
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
easyLoading.dismissLoading();
|
easyLoading.dismissLoading();
|
||||||
backPressed = true;
|
easyLoading.backPressed = 1;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
await navigationService.navigateToLoginUserView();
|
await navigationService.navigateToLoginUserView();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class MasukanNoHpView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: WillPopScope(
|
body: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (model.backPressed) {
|
if (model.easyLoading.backPressed == 1) {
|
||||||
model.navigationService.navigateToLoginUserView();
|
model.navigationService.navigateToLoginUserView();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -16,9 +16,9 @@ class MasukanNoHpViewModel extends CustomBaseViewModel {
|
|||||||
|
|
||||||
selanjutnya() async {
|
selanjutnya() async {
|
||||||
_easyloading.customLoading("Menghantar Kode OTP \nke WhatsApp Anda");
|
_easyloading.customLoading("Menghantar Kode OTP \nke WhatsApp Anda");
|
||||||
backPressed = false;
|
easyLoading.backPressed = 0;
|
||||||
await Future.delayed(const Duration(seconds: 3));
|
await Future.delayed(const Duration(seconds: 3));
|
||||||
backPressed = true;
|
easyLoading.backPressed = 1;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
_easyloading.dismissLoading();
|
_easyloading.dismissLoading();
|
||||||
await navigationService.navigateToVerifikasiNoHpView();
|
await navigationService.navigateToVerifikasiNoHpView();
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class VerifikasiNoHpView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: WillPopScope(
|
body: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (model.backPressed) {
|
if (model.easyLoading.backPressed == 1) {
|
||||||
model.back();
|
model.back();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -9,11 +9,11 @@ class VerifikasiNoHpViewModel extends CustomBaseViewModel {
|
|||||||
Future<void> init() async {}
|
Future<void> init() async {}
|
||||||
|
|
||||||
goToInputInformasiDiri() async {
|
goToInputInformasiDiri() async {
|
||||||
backPressed = false;
|
easyLoading.backPressed = 0;
|
||||||
easyLoading.customLoading("Ke Halaman Input Informasi Diri");
|
easyLoading.customLoading("Ke Halaman Input Informasi Diri");
|
||||||
await Future.delayed(const Duration(seconds: 3));
|
await Future.delayed(const Duration(seconds: 3));
|
||||||
easyLoading.dismissLoading();
|
easyLoading.dismissLoading();
|
||||||
backPressed = true;
|
easyLoading.backPressed = 1;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
await navigationService.navigateToInputInformasiDiriView(
|
await navigationService.navigateToInputInformasiDiriView(
|
||||||
noHp: "082293246583",
|
noHp: "082293246583",
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class LoginUserView extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: WillPopScope(
|
body: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (model.backPressed) {
|
if (model.easyLoading.backPressed == 1) {
|
||||||
// model.back();
|
// model.back();
|
||||||
model.quitApp(context);
|
model.quitApp(context);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,12 +17,12 @@ class LoginUserViewModel extends CustomBaseViewModel {
|
|||||||
|
|
||||||
login() async {
|
login() async {
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
backPressed = false;
|
easyLoading.backPressed = 0;
|
||||||
easyLoading.showLoading();
|
easyLoading.showLoading();
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 5));
|
||||||
easyLoading.dismissLoading();
|
easyLoading.dismissLoading();
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
backPressed = true;
|
easyLoading.backPressed = 1;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
await navigationService.navigateToUserIndexTrackingView();
|
await navigationService.navigateToUserIndexTrackingView();
|
||||||
}
|
}
|
||||||
|
|||||||
146
lib/ui/views/meja_detail/meja_detail_view.dart
Normal file
146
lib/ui/views/meja_detail/meja_detail_view.dart
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
import './meja_detail_view_model.dart';
|
||||||
|
|
||||||
|
class MejaDetailView extends StatelessWidget {
|
||||||
|
final String mejaId;
|
||||||
|
|
||||||
|
const MejaDetailView({
|
||||||
|
Key? key,
|
||||||
|
required this.mejaId,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<MejaDetailViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => MejaDetailViewModel(),
|
||||||
|
onViewModelReady: (MejaDetailViewModel model) async {
|
||||||
|
await model.init(mejaId);
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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: '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: '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,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
lib/ui/views/meja_detail/meja_detail_view_model.dart
Normal file
35
lib/ui/views/meja_detail/meja_detail_view_model.dart
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import '../../../app/app.logger.dart';
|
||||||
|
import '../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class MejaDetailViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('MejaDetailViewModel');
|
||||||
|
|
||||||
|
late String mejaId;
|
||||||
|
late String namaMeja;
|
||||||
|
|
||||||
|
String? imgAsset;
|
||||||
|
|
||||||
|
Future<void> init(String mejaId) async {
|
||||||
|
log.i('MejaDetailViewModel init');
|
||||||
|
log.i('mejaId : $mejaId');
|
||||||
|
this.mejaId = mejaId;
|
||||||
|
easyLoading.backPressed = 3;
|
||||||
|
// seperate the number from the string
|
||||||
|
var number = int.parse(mejaId.replaceAll(RegExp(r'[^0-9]'), ''));
|
||||||
|
// log.i('number : $number');
|
||||||
|
if (number <= 4) {
|
||||||
|
namaMeja = 'Gazebo';
|
||||||
|
imgAsset = 'assets/reza_gazebo.jpeg';
|
||||||
|
} else if (number >= 5 && number <= 12) {
|
||||||
|
namaMeja = 'Meja';
|
||||||
|
imgAsset = 'assets/reza_meja_1.jpeg';
|
||||||
|
} else if (number >= 13 && number <= 22) {
|
||||||
|
namaMeja = 'Meja';
|
||||||
|
imgAsset = 'assets/reza_meja_2.jpeg';
|
||||||
|
}
|
||||||
|
|
||||||
|
namaMeja = '$namaMeja $number';
|
||||||
|
|
||||||
|
log.i('imgAsset : $imgAsset');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../app/themes/app_text.dart';
|
||||||
import './akun_user_view_model.dart';
|
import './akun_user_view_model.dart';
|
||||||
|
|
||||||
class AkunUserView extends StatelessWidget {
|
class AkunUserView extends StatelessWidget {
|
||||||
@ -18,10 +20,110 @@ class AkunUserView extends StatelessWidget {
|
|||||||
AkunUserViewModel model,
|
AkunUserViewModel model,
|
||||||
Widget? child,
|
Widget? child,
|
||||||
) {
|
) {
|
||||||
return const Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
appBar: AppBar(
|
||||||
child: Text(
|
title: Text(
|
||||||
'AkunUserView',
|
'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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
class AkunUserViewModel extends CustomBaseViewModel {
|
class AkunUserViewModel extends CustomBaseViewModel {
|
||||||
Future<void> init() async {}
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,79 +29,181 @@ class DetailMakananView extends HookWidget {
|
|||||||
Widget? child,
|
Widget? child,
|
||||||
) {
|
) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
body: SizedBox(
|
body: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
itemCount: 1,
|
itemCount: 1,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Column(
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).padding.top,
|
||||||
|
),
|
||||||
|
const TopMenuWidget(),
|
||||||
|
const SecondWidget(),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
MyWhiteContainer(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: 'Ongkos Kirim',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: ' Rp. 10.000',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
color: dangerColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Bisa Dibayar COD sekitar Parepare",
|
||||||
|
style: regularTextStyle.copyWith(
|
||||||
|
fontSize: 13,
|
||||||
|
color: fontGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
MyWhiteContainer(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Deskripsi",
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
// bikin dummy text tentang nasi goreng
|
||||||
|
Text(
|
||||||
|
"Nasi goreng adalah makanan yang terbuat dari nasi yang digoreng dan diaduk dalam minyak goreng atau margarin, biasanya ditambah kecap manis, bawang merah, bawang putih, daging ayam, telur, dan bumbu-bumbu lainnya. Nasi goreng sering dianggap sebagai makanan nasional Indonesia. Nasi goreng dapat ditemukan di seluruh Indonesia, dari restoran pinggir jalan, warung, hingga hotel bintang lima dan restoran mewah.",
|
||||||
|
style: regularTextStyle.copyWith(
|
||||||
|
fontSize: 13,
|
||||||
|
color: fontGrey,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.justify,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TopBarWidget(opacity: opacity),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 10,
|
||||||
|
),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.1),
|
||||||
|
blurRadius: 5,
|
||||||
|
spreadRadius: 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Text(
|
||||||
height: MediaQuery.of(context).padding.top,
|
"Total Harga",
|
||||||
|
style: regularTextStyle.copyWith(
|
||||||
|
fontSize: 14,
|
||||||
|
color: fontGrey,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const TopMenuWidget(),
|
|
||||||
const SecondWidget(),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 5,
|
||||||
),
|
),
|
||||||
MyWhiteContainer(
|
Text(
|
||||||
child: Padding(
|
"Rp. 35.000",
|
||||||
padding: const EdgeInsets.symmetric(
|
style: boldTextStyle.copyWith(
|
||||||
horizontal: 10,
|
fontSize: 16,
|
||||||
),
|
color: dangerColor,
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: 'Ongkos Kirim',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: ' Rp. 10.000',
|
|
||||||
style: boldTextStyle.copyWith(
|
|
||||||
fontSize: 14,
|
|
||||||
color: dangerColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Bisa Dibayar COD sekitar Parepare",
|
|
||||||
style: regularTextStyle.copyWith(
|
|
||||||
fontSize: 13,
|
|
||||||
color: fontGrey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
},
|
),
|
||||||
),
|
Expanded(
|
||||||
TopBarWidget(opacity: opacity),
|
child: Container(
|
||||||
],
|
height: 40,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
color: dangerColor,
|
||||||
);
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Pesan Sekarang",
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,5 +4,7 @@ import '../../../../../app/core/custom_base_view_model.dart';
|
|||||||
class DetailMakananViewModel extends CustomBaseViewModel {
|
class DetailMakananViewModel extends CustomBaseViewModel {
|
||||||
final log = getLogger('DetailMakananViewModel');
|
final log = getLogger('DetailMakananViewModel');
|
||||||
|
|
||||||
Future<void> init() async {}
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,178 +22,215 @@ class MakananListView extends StatelessWidget {
|
|||||||
Widget? child,
|
Widget? child,
|
||||||
) {
|
) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
body: Column(
|
body: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// get the top height of the notification bar
|
// get the top height of the notification bar
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: MediaQuery.of(context).padding.top,
|
height: MediaQuery.of(context).padding.top,
|
||||||
),
|
|
||||||
MyWhiteContainer(
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () => model.back(),
|
|
||||||
icon: const Icon(Icons.arrow_back),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
width: 10,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 10,
|
|
||||||
child: MyTextFormField(
|
|
||||||
// controller: model.searchController,
|
|
||||||
hintText: 'Cari Makanan',
|
|
||||||
suffixIcon: IconButton(
|
|
||||||
onPressed: () {},
|
|
||||||
icon: const Icon(Icons.search),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {},
|
|
||||||
icon: const Icon(Icons.filter_list),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {},
|
|
||||||
child: const Text('Filter'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
MyWhiteContainer(
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
MyWhiteContainer(
|
|
||||||
child: IntrinsicHeight(
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextButton(
|
flex: 2,
|
||||||
onPressed: () {},
|
child: IconButton(
|
||||||
child: const Text('Terbaru'),
|
onPressed: () => model.back(),
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const VerticalDivider(
|
const SizedBox(
|
||||||
color: mainGrey,
|
width: 10,
|
||||||
thickness: 1,
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextButton(
|
flex: 10,
|
||||||
onPressed: () {},
|
child: MyTextFormField(
|
||||||
child: const Text(
|
// controller: model.searchController,
|
||||||
'Terlaris',
|
hintText: 'Cari Makanan',
|
||||||
style: TextStyle(
|
suffixIcon: IconButton(
|
||||||
color: mainGrey,
|
onPressed: () {},
|
||||||
),
|
icon: const Icon(Icons.search),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const VerticalDivider(
|
|
||||||
color: Colors.grey,
|
|
||||||
thickness: 1,
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextButton(
|
flex: 1,
|
||||||
|
child: IconButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const Row(
|
icon: const Icon(Icons.filter_list),
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Harga',
|
|
||||||
style: TextStyle(
|
|
||||||
color: mainGrey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
Icons.arrow_drop_down,
|
|
||||||
color: mainGrey,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Text('Filter'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
const SizedBox(
|
height: 5,
|
||||||
height: 10,
|
),
|
||||||
),
|
MyWhiteContainer(
|
||||||
Expanded(
|
child: IntrinsicHeight(
|
||||||
child: Center(
|
child: Row(
|
||||||
child: SingleChildScrollView(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
child: Wrap(
|
|
||||||
spacing: 10,
|
|
||||||
runSpacing: 10,
|
|
||||||
children: [
|
children: [
|
||||||
for (var i = 0; i < 10; i++)
|
Expanded(
|
||||||
GestureDetector(
|
child: TextButton(
|
||||||
onTap: () => model.goToDetailMakanan(),
|
onPressed: () {},
|
||||||
child: Container(
|
child: const Text('Terbaru'),
|
||||||
width: MediaQuery.of(context).size.width * 0.46,
|
),
|
||||||
color: Colors.white,
|
),
|
||||||
child: Column(
|
const VerticalDivider(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
color: mainGrey,
|
||||||
children: [
|
thickness: 1,
|
||||||
Image.network(
|
),
|
||||||
'https://a.cdn-hotels.com/gdcs/production0/d1513/35c1c89e-408c-4449-9abe-f109068f40c0.jpg?impolicy=fcrop&w=800&h=533&q=medium',
|
Expanded(
|
||||||
height: 150,
|
child: TextButton(
|
||||||
width: double.infinity,
|
onPressed: () {},
|
||||||
fit: BoxFit.fill,
|
child: const Text(
|
||||||
),
|
'Terlaris',
|
||||||
const SizedBox(
|
style: TextStyle(
|
||||||
height: 5,
|
color: mainGrey,
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 5,
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'Product Name',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 5,
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'Rp. 100.000',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
const VerticalDivider(
|
||||||
|
color: Colors.grey,
|
||||||
|
thickness: 1,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Harga',
|
||||||
|
style: TextStyle(
|
||||||
|
color: mainGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_drop_down,
|
||||||
|
color: mainGrey,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Wrap(
|
||||||
|
spacing: 10,
|
||||||
|
runSpacing: 10,
|
||||||
|
children: [
|
||||||
|
for (var i = 0; i < 10; i++)
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () => model.goToDetailMakanan(),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.46,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 5,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'Product Name',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 5,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'Rp. 100.000',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () {},
|
||||||
|
// create a shopping cart icon with a badge containing the number of items
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(right: 10),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: const Icon(Icons.shopping_cart_outlined,
|
||||||
|
color: Colors.white),
|
||||||
|
iconSize: 30,
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
));
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import '../../../../app/core/custom_base_view_model.dart';
|
|||||||
|
|
||||||
class MakananListViewModel extends CustomBaseViewModel {
|
class MakananListViewModel extends CustomBaseViewModel {
|
||||||
final log = getLogger('MakananListViewModel');
|
final log = getLogger('MakananListViewModel');
|
||||||
Future<void> init() async {}
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 2;
|
||||||
|
}
|
||||||
|
|
||||||
goToDetailMakanan() {
|
goToDetailMakanan() {
|
||||||
log.i('goToDetailMakanan');
|
log.i('goToDetailMakanan');
|
||||||
|
|||||||
@ -0,0 +1,172 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../../app/themes/app_text.dart';
|
||||||
|
import '../../../../widgets/my_white_container.dart';
|
||||||
|
import './keranjang_saya_view_model.dart';
|
||||||
|
|
||||||
|
class KeranjangSayaView extends StatelessWidget {
|
||||||
|
const KeranjangSayaView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<KeranjangSayaViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => KeranjangSayaViewModel(),
|
||||||
|
onViewModelReady: (KeranjangSayaViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
// 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,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
import '../../../../../app/app.logger.dart';
|
||||||
|
|
||||||
|
class KeranjangSayaViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('KeranjangSayaViewModel');
|
||||||
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
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:reza_app/ui/widgets/my_white_container.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
import './pesanan_list_view_model.dart';
|
import './pesanan_list_view_model.dart';
|
||||||
@ -18,12 +22,287 @@ class PesananListView extends StatelessWidget {
|
|||||||
PesananListViewModel model,
|
PesananListViewModel model,
|
||||||
Widget? child,
|
Widget? child,
|
||||||
) {
|
) {
|
||||||
return const Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
appBar: AppBar(
|
||||||
child: Text(
|
title: Text(
|
||||||
'PesananListView',
|
'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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
MyWhiteContainer(
|
||||||
|
child: IntrinsicHeight(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Text('Dikemas'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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(
|
||||||
|
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(
|
||||||
|
color: mainColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
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,
|
||||||
|
// ),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
class PesananListViewModel extends CustomBaseViewModel {
|
class PesananListViewModel extends CustomBaseViewModel {
|
||||||
Future<void> init() async {}
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
import 'package:reza_app/app/themes/app_colors.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
|
import '../../meja_detail/meja_detail_view.dart';
|
||||||
import './reservasi_meja_view_model.dart';
|
import './reservasi_meja_view_model.dart';
|
||||||
|
|
||||||
class ReservasiMejaView extends StatelessWidget {
|
class ReservasiMejaView extends StatelessWidget {
|
||||||
@ -18,11 +23,183 @@ class ReservasiMejaView extends StatelessWidget {
|
|||||||
ReservasiMejaViewModel model,
|
ReservasiMejaViewModel model,
|
||||||
Widget? child,
|
Widget? child,
|
||||||
) {
|
) {
|
||||||
return const Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
appBar: AppBar(
|
||||||
child: Text(
|
title: const Text('RESERVASI MEJA',
|
||||||
'ReservasiMejaView',
|
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%)');
|
||||||
|
},
|
||||||
|
// 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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,18 @@
|
|||||||
import 'package:reza_app/app/core/custom_base_view_model.dart';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import '../../../../app/app.logger.dart';
|
||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
class ReservasiMejaViewModel extends CustomBaseViewModel {
|
class ReservasiMejaViewModel extends CustomBaseViewModel {
|
||||||
Future<void> init() async {}
|
final log = getLogger('ReservasiMejaViewModel');
|
||||||
|
|
||||||
|
List<String> imagePaths = [
|
||||||
|
'assets/reza_gazebo.jpeg',
|
||||||
|
'assets/reza_meja_1.jpeg',
|
||||||
|
'assets/reza_meja_2.jpeg',
|
||||||
|
];
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
easyLoading.backPressed = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:back_button_interceptor/back_button_interceptor.dart';
|
import 'package:back_button_interceptor/back_button_interceptor.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:reza_app/services/my_easyloading.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
@ -12,18 +13,38 @@ import '../../../../app/themes/app_colors.dart';
|
|||||||
class UserIndexTrackingViewModel extends IndexTrackingViewModel {
|
class UserIndexTrackingViewModel extends IndexTrackingViewModel {
|
||||||
final log = getLogger('UserIndexTrackingViewModel');
|
final log = getLogger('UserIndexTrackingViewModel');
|
||||||
final navigationService = locator<NavigationService>();
|
final navigationService = locator<NavigationService>();
|
||||||
bool backPressed = true;
|
final easyLoading = locator<MyEasyLoading>();
|
||||||
|
// late bool backPressed;
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
BackButtonInterceptor.add(myInterceptor);
|
BackButtonInterceptor.add(myInterceptor);
|
||||||
|
// backPressed = easyLoading.backPressed;
|
||||||
|
easyLoading.backPressed = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
|
bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
|
||||||
// print("BACK BUTTON!"); // Do some stuff.
|
// print("BACK BUTTON!"); // Do some stuff.
|
||||||
|
|
||||||
if (backPressed) {
|
log.i('myInterceptor : ${easyLoading.backPressed}');
|
||||||
|
|
||||||
|
if (easyLoading.backPressed == 2) {
|
||||||
quitApp(null);
|
quitApp(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +96,7 @@ class UserIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
quitApp(BuildContext? context) {
|
quitApp(BuildContext? context) {
|
||||||
backPressed = false;
|
easyLoading.backPressed = 0;
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context ?? StackedService.navigatorKey!.currentContext!,
|
context: context ?? StackedService.navigatorKey!.currentContext!,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -85,7 +106,7 @@ class UserIndexTrackingViewModel extends IndexTrackingViewModel {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
backPressed = true;
|
easyLoading.backPressed = 2;
|
||||||
Navigator.of(context).pop(false);
|
Navigator.of(context).pop(false);
|
||||||
},
|
},
|
||||||
child: const Text('Batal'),
|
child: const Text('Batal'),
|
||||||
|
|||||||
40
pubspec.lock
40
pubspec.lock
@ -113,6 +113,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.6.1"
|
version: "8.6.1"
|
||||||
|
carousel_slider:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: carousel_slider
|
||||||
|
sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.1"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -949,6 +957,38 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.0"
|
||||||
|
webview_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: webview_flutter
|
||||||
|
sha256: "392c1d83b70fe2495de3ea2c84531268d5b8de2de3f01086a53334d8b6030a88"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.4"
|
||||||
|
webview_flutter_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_android
|
||||||
|
sha256: "8b3b2450e98876c70bfcead876d9390573b34b9418c19e28168b74f6cb252dbd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.10.4"
|
||||||
|
webview_flutter_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_platform_interface
|
||||||
|
sha256: "812165e4e34ca677bdfbfa58c01e33b27fd03ab5fa75b70832d4b7d4ca1fa8cf"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.9.5"
|
||||||
|
webview_flutter_wkwebview:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_wkwebview
|
||||||
|
sha256: a5364369c758892aa487cbf59ea41d9edd10f9d9baf06a94e80f1bd1b4c7bbc0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.9.5"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -53,6 +53,8 @@ dependencies:
|
|||||||
otp_text_field: ^1.1.3
|
otp_text_field: ^1.1.3
|
||||||
back_button_interceptor: ^6.0.2
|
back_button_interceptor: ^6.0.2
|
||||||
flutter_hooks: ^0.19.0
|
flutter_hooks: ^0.19.0
|
||||||
|
webview_flutter: ^3.0.4
|
||||||
|
carousel_slider: ^4.2.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@ -83,6 +85,9 @@ flutter:
|
|||||||
assets:
|
assets:
|
||||||
- .env
|
- .env
|
||||||
- assets/logo.png
|
- assets/logo.png
|
||||||
|
- assets/reza_gazebo.jpeg
|
||||||
|
- assets/reza_meja_1.jpeg
|
||||||
|
- assets/reza_meja_2.jpeg
|
||||||
# - images/a_dot_ham.jpeg
|
# - images/a_dot_ham.jpeg
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
|||||||
Reference in New Issue
Block a user