first commit
This commit is contained in:
@ -0,0 +1,78 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
import 'package:stylish_bottom_bar/model/bar_items.dart';
|
||||
import 'package:stylish_bottom_bar/stylish_bottom_bar.dart';
|
||||
|
||||
import '../../../../app/app.router.dart';
|
||||
import '../../../../app/themes/app_colors.dart';
|
||||
import '../../../../app/themes/app_text.dart';
|
||||
import './admin_index_tracking_view_model.dart';
|
||||
|
||||
class AdminIndexTrackingView extends StatelessWidget {
|
||||
const AdminIndexTrackingView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<AdminIndexTrackingViewModel>.reactive(
|
||||
viewModelBuilder: () => AdminIndexTrackingViewModel(),
|
||||
onViewModelReady: (AdminIndexTrackingViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
AdminIndexTrackingViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return Scaffold(
|
||||
extendBody: false,
|
||||
body: ExtendedNavigator(
|
||||
navigatorKey: StackedService.nestedNavigationKey(2),
|
||||
router: AdminIndexTrackingViewRouter(),
|
||||
observers: [
|
||||
StackedService.routeObserver,
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: StylishBottomBar(
|
||||
items: [
|
||||
for (var item in model.bottomNavBarList)
|
||||
BottomBarItem(
|
||||
icon: Icon(item['icon'],
|
||||
color: model.currentIndex ==
|
||||
model.bottomNavBarList.indexOf(item)
|
||||
? mainColor
|
||||
: backgroundColor),
|
||||
title: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
item['name'],
|
||||
style: regularTextStyle.copyWith(
|
||||
color: model.currentIndex ==
|
||||
model.bottomNavBarList.indexOf(item)
|
||||
? mainColor
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
model.currentIndex == model.bottomNavBarList.indexOf(item)
|
||||
? Colors.white
|
||||
: Colors.grey,
|
||||
),
|
||||
],
|
||||
currentIndex: model.currentIndex,
|
||||
hasNotch: true,
|
||||
backgroundColor: mainColor,
|
||||
onTap: (value) {
|
||||
model.handleNavigation(value);
|
||||
},
|
||||
option: BubbleBarOptions(
|
||||
barStyle: BubbleBarStyle.horizotnal,
|
||||
bubbleFillStyle: BubbleFillStyle.fill,
|
||||
opacity: 0.3),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.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 '../../../../services/global_var.dart';
|
||||
|
||||
class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
||||
final log = getLogger('AdminIndexTrackingViewModel');
|
||||
final globalVar = locator<GlobalVar>();
|
||||
final navigationService = locator<NavigationService>();
|
||||
|
||||
final _bottomNavBarList = [
|
||||
{
|
||||
'name': 'Meja',
|
||||
'icon': Icons.table_restaurant_outlined,
|
||||
'header': 'RESERVASI MEJA',
|
||||
},
|
||||
{
|
||||
'name': 'Makanan',
|
||||
'icon': Icons.food_bank_outlined,
|
||||
'header': 'LIST MAKANAN',
|
||||
},
|
||||
{
|
||||
'name': 'Pesanan',
|
||||
'icon': Icons.shopping_cart_outlined,
|
||||
'header': 'LIST PESANAN',
|
||||
},
|
||||
{
|
||||
'name': 'Akun',
|
||||
'icon': Icons.person_outline,
|
||||
'header': 'AKUN',
|
||||
},
|
||||
];
|
||||
|
||||
String header = 'RESERVASI MEJA';
|
||||
|
||||
List<Map<String, dynamic>> get bottomNavBarList => _bottomNavBarList;
|
||||
|
||||
final List<String> _views = [
|
||||
AdminIndexTrackingViewRoutes.mejaListView,
|
||||
AdminIndexTrackingViewRoutes.makananListView,
|
||||
AdminIndexTrackingViewRoutes.pesananListView,
|
||||
AdminIndexTrackingViewRoutes.akunAdminView,
|
||||
];
|
||||
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'exitApp';
|
||||
}
|
||||
|
||||
void handleNavigation(int index) {
|
||||
// log.d("handleNavigation: $index");
|
||||
// log.d("currentIndex: $currentIndex");
|
||||
|
||||
if (currentIndex == index) return;
|
||||
|
||||
setIndex(index);
|
||||
header = _bottomNavBarList[index]['header'] as String;
|
||||
navigationService.navigateTo(
|
||||
_views[index],
|
||||
id: 2,
|
||||
);
|
||||
}
|
||||
}
|
42
lib/ui/views/admin_ui/akun_admin/akun_admin_view.dart
Normal file
42
lib/ui/views/admin_ui/akun_admin/akun_admin_view.dart
Normal file
@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import './akun_admin_view_model.dart';
|
||||
|
||||
class AkunAdminView extends StatelessWidget {
|
||||
const AkunAdminView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<AkunAdminViewModel>.reactive(
|
||||
viewModelBuilder: () => AkunAdminViewModel(),
|
||||
onViewModelReady: (AkunAdminViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
AkunAdminViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
// model.log.d('onWillPop ini akun');
|
||||
if (model.globalVar.backPressed == 'exitApp') {
|
||||
model.quitApp(context);
|
||||
model.globalVar.backPressed = 'exitApp';
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
child: const Scaffold(
|
||||
body: Center(
|
||||
child: Text(
|
||||
'AkunAdminView',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
import 'package:reza_admin/app/core/custom_base_view_model.dart';
|
||||
|
||||
class AkunAdminViewModel extends CustomBaseViewModel {
|
||||
Future<void> init() async {}
|
||||
}
|
@ -0,0 +1,493 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'add_edit_makanan_view_model.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import '../../../../../app/themes/app_colors.dart';
|
||||
import '../../../../../app/themes/app_text.dart';
|
||||
import '../../../../widgets/my_white_container.dart';
|
||||
|
||||
class AddEditMakananView extends HookWidget {
|
||||
const AddEditMakananView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scrollController = useScrollController();
|
||||
final opacity = useState(0.0);
|
||||
final theHeight = useState(MediaQuery.of(useContext()).size.height * 0.35);
|
||||
|
||||
checkScrollValue(scrollController, opacity, theHeight);
|
||||
|
||||
return ViewModelBuilder<AddEditMakananViewModel>.reactive(
|
||||
viewModelBuilder: () => AddEditMakananViewModel(),
|
||||
onViewModelReady: (AddEditMakananViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
AddEditMakananViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
model.log.d('onWillPop ini detail makanan');
|
||||
model.globalVar.backPressed = 'exitApp';
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
body: SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
controller: scrollController,
|
||||
itemCount: 1,
|
||||
itemBuilder: (context, index) {
|
||||
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: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'Ongkos Kirim',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' Harga Ongkir Di Sini',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 14,
|
||||
color: dangerColor,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: dangerColor,
|
||||
),
|
||||
iconSize: 20,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
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: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Deskripsi",
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: mainGrey,
|
||||
),
|
||||
iconSize: 20,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// bikin dummy text tentang nasi goreng
|
||||
Text(
|
||||
"Deskripsi Makanan Di Sini",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 13,
|
||||
color: fontGrey,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
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: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: dangerColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Tambah Makanan Baru",
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void checkScrollValue(
|
||||
ScrollController scrollController,
|
||||
ValueNotifier<double> opacity,
|
||||
ValueNotifier<double> theHeight,
|
||||
) {
|
||||
scrollController.addListener(() {
|
||||
opacity.value = scrollController.offset / theHeight.value;
|
||||
if (opacity.value > 1) {
|
||||
opacity.value = 1;
|
||||
} else if (opacity.value < 0) {
|
||||
opacity.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class TopBarWidget extends ViewModelWidget<AddEditMakananViewModel> {
|
||||
const TopBarWidget({
|
||||
super.key,
|
||||
required this.opacity,
|
||||
});
|
||||
|
||||
final ValueNotifier<double> opacity;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, AddEditMakananViewModel viewModel) {
|
||||
return Positioned(
|
||||
top: 0,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white.withOpacity(opacity.value),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).padding.top,
|
||||
),
|
||||
Row(
|
||||
// create 3 circle widget, with background color is black and opacity is 0.5, ist icon is back, second icon is cart and third icon is 3 dots
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
viewModel.globalVar.backPressed = 'exitApp';
|
||||
viewModel.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
// const Expanded(
|
||||
// child: SizedBox(
|
||||
// width: 20,
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.black.withOpacity(0.5),
|
||||
// borderRadius: BorderRadius.circular(20),
|
||||
// ),
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.shopping_cart_outlined,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 20,
|
||||
// ),
|
||||
// Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.black.withOpacity(0.5),
|
||||
// borderRadius: BorderRadius.circular(20),
|
||||
// ),
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.more_vert,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondWidget extends ViewModelWidget<AddEditMakananViewModel> {
|
||||
const SecondWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, AddEditMakananViewModel viewModel) {
|
||||
return MyWhiteContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Nama Makanan Di Sini",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 17,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: mainGrey,
|
||||
),
|
||||
iconSize: 20,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Harga Makanan Di Sini",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
color: dangerColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: dangerColor,
|
||||
),
|
||||
iconSize: 20,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TopMenuWidget extends ViewModelWidget<AddEditMakananViewModel> {
|
||||
const TopMenuWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, AddEditMakananViewModel viewModel) {
|
||||
return Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height * 0.35,
|
||||
// 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',
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Add Image',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Positioned(
|
||||
// bottom: 10,
|
||||
// right: 10,
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 5,
|
||||
// ),
|
||||
// // width: 20,
|
||||
// height: 20,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// ),
|
||||
// child: const Center(
|
||||
// child: Text(
|
||||
// '1 / 2',
|
||||
// style: TextStyle(
|
||||
// color: fontGrey,
|
||||
// fontSize: 12,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Positioned(
|
||||
bottom: 20,
|
||||
right: 20,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
),
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.camera_alt_outlined,
|
||||
color: Colors.white,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import '../../../../../app/app.logger.dart';
|
||||
import '../../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class AddEditMakananViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('AddMakananViewModel');
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'backNormal';
|
||||
}
|
||||
}
|
@ -0,0 +1,406 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.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 './detail_makanan_view_model.dart';
|
||||
|
||||
class DetailMakananView extends HookWidget {
|
||||
const DetailMakananView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scrollController = useScrollController();
|
||||
final opacity = useState(0.0);
|
||||
final theHeight = useState(MediaQuery.of(useContext()).size.height * 0.35);
|
||||
|
||||
checkScrollValue(scrollController, opacity, theHeight);
|
||||
|
||||
return ViewModelBuilder<DetailMakananViewModel>.reactive(
|
||||
viewModelBuilder: () => DetailMakananViewModel(),
|
||||
onViewModelReady: (DetailMakananViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
DetailMakananViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
model.log.d('onWillPop ini detail makanan');
|
||||
model.globalVar.backPressed = 'exitApp';
|
||||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
body: SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
controller: scrollController,
|
||||
itemCount: 1,
|
||||
itemBuilder: (context, index) {
|
||||
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: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: dangerColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Edit Detail Makanan",
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void checkScrollValue(
|
||||
ScrollController scrollController,
|
||||
ValueNotifier<double> opacity,
|
||||
ValueNotifier<double> theHeight,
|
||||
) {
|
||||
scrollController.addListener(() {
|
||||
opacity.value = scrollController.offset / theHeight.value;
|
||||
if (opacity.value > 1) {
|
||||
opacity.value = 1;
|
||||
} else if (opacity.value < 0) {
|
||||
opacity.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class TopBarWidget extends ViewModelWidget<DetailMakananViewModel> {
|
||||
const TopBarWidget({
|
||||
super.key,
|
||||
required this.opacity,
|
||||
});
|
||||
|
||||
final ValueNotifier<double> opacity;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, DetailMakananViewModel viewModel) {
|
||||
return Positioned(
|
||||
top: 0,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white.withOpacity(opacity.value),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).padding.top,
|
||||
),
|
||||
Row(
|
||||
// create 3 circle widget, with background color is black and opacity is 0.5, ist icon is back, second icon is cart and third icon is 3 dots
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
viewModel.globalVar.backPressed = 'exitApp';
|
||||
viewModel.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
// const Expanded(
|
||||
// child: SizedBox(
|
||||
// width: 20,
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.black.withOpacity(0.5),
|
||||
// borderRadius: BorderRadius.circular(20),
|
||||
// ),
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.shopping_cart_outlined,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 20,
|
||||
// ),
|
||||
// Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.black.withOpacity(0.5),
|
||||
// borderRadius: BorderRadius.circular(20),
|
||||
// ),
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.more_vert,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondWidget extends ViewModelWidget<DetailMakananViewModel> {
|
||||
const SecondWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, DetailMakananViewModel viewModel) {
|
||||
return MyWhiteContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Burger King Handcrafted Burgers ",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"Rp. 25.000",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
color: dangerColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"49 Terjual",
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 14,
|
||||
color: fontGrey,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.favorite_border,
|
||||
color: fontGrey,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TopMenuWidget extends ViewModelWidget<DetailMakananViewModel> {
|
||||
const TopMenuWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, DetailMakananViewModel viewModel) {
|
||||
return Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height * 0.35,
|
||||
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',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 10,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
),
|
||||
// width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'1 / 2',
|
||||
style: TextStyle(
|
||||
color: fontGrey,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
import '../../../../../app/app.logger.dart';
|
||||
import '../../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class DetailMakananViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('DetailMakananViewModel');
|
||||
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'backNormal';
|
||||
}
|
||||
}
|
219
lib/ui/views/admin_ui/makanan_list/makanan_list_view.dart
Normal file
219
lib/ui/views/admin_ui/makanan_list/makanan_list_view.dart
Normal file
@ -0,0 +1,219 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:reza_admin/app/app.router.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import '../../../../app/themes/app_colors.dart';
|
||||
import '../../../widgets/my_textformfield.dart';
|
||||
import '../../../widgets/my_white_container.dart';
|
||||
import './makanan_list_view_model.dart';
|
||||
|
||||
class MakananListView extends StatelessWidget {
|
||||
const MakananListView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<MakananListViewModel>.reactive(
|
||||
viewModelBuilder: () => MakananListViewModel(),
|
||||
onViewModelReady: (MakananListViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MakananListViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
model.log.d('onWillPop ini makanan');
|
||||
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,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// get the top height of the notification bar
|
||||
SizedBox(
|
||||
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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
MyWhiteContainer(
|
||||
child: IntrinsicHeight(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text('Terbaru'),
|
||||
),
|
||||
),
|
||||
const VerticalDivider(
|
||||
color: mainGrey,
|
||||
thickness: 1,
|
||||
),
|
||||
Expanded(
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text(
|
||||
'Terlaris',
|
||||
style: TextStyle(
|
||||
color: mainGrey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: () {
|
||||
model.navigationService.navigateToAddEditMakananView();
|
||||
},
|
||||
// create a add product button
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import '../../../../app/app.logger.dart';
|
||||
import '../../../../app/app.router.dart';
|
||||
import '../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class MakananListViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('MakananListViewModel');
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'exitApp';
|
||||
}
|
||||
|
||||
goToDetailMakanan() {
|
||||
log.i('goToDetailMakanan');
|
||||
navigationService.navigateTo(Routes.detailMakananView);
|
||||
}
|
||||
}
|
@ -0,0 +1,302 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import '../../../../../app/themes/app_colors.dart';
|
||||
import '../../../../../app/themes/app_text.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 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),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 2,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
// make the color random between red and blue
|
||||
const color = Colors.blue;
|
||||
String pesanStatus = 'Menunggu Pengesahan';
|
||||
return Card(
|
||||
color: color,
|
||||
child: ListTile(
|
||||
// leading: CircleAvatar(
|
||||
// backgroundColor: Colors.white,
|
||||
// child: Text(
|
||||
// index.toString(),
|
||||
// style: regularTextStyle,
|
||||
// ),
|
||||
// ),
|
||||
title: Text(
|
||||
'Nama Pemesan',
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'08:00.00 - 09:00.00',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
pesanStatus,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: const Icon(Icons.arrow_forward_ios,
|
||||
color: Colors.white),
|
||||
onTap: () {
|
||||
model.log.i('Meja 1');
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 10,
|
||||
),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(
|
||||
color: mainColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: 5,
|
||||
spreadRadius: 5,
|
||||
),
|
||||
],
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
model.log.i('Edit');
|
||||
},
|
||||
child: const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Text(
|
||||
'Edit',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// divider
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.white,
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
model.log.i('List');
|
||||
// model.navigationService.navigateToMakananListView();
|
||||
},
|
||||
child: const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.list,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Text(
|
||||
'History Booking',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
backgroundColor: orangeColor,
|
||||
onPressed: () {
|
||||
// model.navigationService.navigateToAddEditMakananView();
|
||||
},
|
||||
// create a add product button
|
||||
child: const Icon(
|
||||
Icons.edit_calendar_outlined,
|
||||
),
|
||||
),
|
||||
floatingActionButtonLocation:
|
||||
FloatingActionButtonLocation.miniEndTop,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -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;
|
||||
globalVar.backPressed = 'backNormal';
|
||||
// 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');
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import './meja_edit_view_model.dart';
|
||||
|
||||
class MejaEditView extends StatelessWidget {
|
||||
const MejaEditView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<MejaEditViewModel>.reactive(
|
||||
viewModelBuilder: () => MejaEditViewModel(),
|
||||
onViewModelReady: (MejaEditViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MejaEditViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Text(
|
||||
'MejaEditView',
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import '../../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class MejaEditViewModel extends CustomBaseViewModel {
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'backNormal';
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import './meja_history_log_view_model.dart';
|
||||
|
||||
class MejaHistoryLogView extends StatelessWidget {
|
||||
const MejaHistoryLogView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<MejaHistoryLogViewModel>.reactive(
|
||||
viewModelBuilder: () => MejaHistoryLogViewModel(),
|
||||
onViewModelReady: (MejaHistoryLogViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MejaHistoryLogViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Text(
|
||||
'MejaHistoryLogView',
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import '../../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class MejaHistoryLogViewModel extends CustomBaseViewModel {
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'backNormal';
|
||||
}
|
||||
}
|
235
lib/ui/views/admin_ui/meja_list/meja_list_view.dart
Normal file
235
lib/ui/views/admin_ui/meja_list/meja_list_view.dart
Normal file
@ -0,0 +1,235 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:reza_admin/app/app.router.dart';
|
||||
import 'package:reza_admin/app/themes/app_colors.dart';
|
||||
import 'package:reza_admin/app/themes/app_text.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
import './meja_list_view_model.dart';
|
||||
|
||||
class MejaListView extends StatelessWidget {
|
||||
const MejaListView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<MejaListViewModel>.reactive(
|
||||
viewModelBuilder: () => MejaListViewModel(),
|
||||
onViewModelReady: (MejaListViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
MejaListViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
model.log.d('onWillPop ini meja');
|
||||
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,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.35,
|
||||
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.navigationService.navigateToMejaDetailView(
|
||||
mejaId: message.message,
|
||||
);
|
||||
},
|
||||
),
|
||||
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: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
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('Dibooking'),
|
||||
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.blue,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const Text('Menunggu'),
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[600],
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const Text('Tidak Tersedia'),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 15,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
// make the color random between red and blue
|
||||
final color = index % 2 == 0 ? Colors.red : Colors.blue;
|
||||
String pesanStatus =
|
||||
index % 2 == 0 ? 'Dibooking' : 'Menunggu Pengesahan';
|
||||
return Card(
|
||||
color: color,
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: Text(
|
||||
index.toString(),
|
||||
style: regularTextStyle,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'Nama Pemesan',
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 18,
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'08:00.00 - 09:00.00',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
pesanStatus,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: const Icon(Icons.arrow_forward_ios,
|
||||
color: Colors.white),
|
||||
onTap: () {
|
||||
model.log.i('Meja 1');
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
10
lib/ui/views/admin_ui/meja_list/meja_list_view_model.dart
Normal file
10
lib/ui/views/admin_ui/meja_list/meja_list_view_model.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:reza_admin/app/app.logger.dart';
|
||||
|
||||
import '../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class MejaListViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('MejaListViewModel');
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'exitApp';
|
||||
}
|
||||
}
|
298
lib/ui/views/admin_ui/pesanan_list/pesanan_list_view.dart
Normal file
298
lib/ui/views/admin_ui/pesanan_list/pesanan_list_view.dart
Normal file
@ -0,0 +1,298 @@
|
||||
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 './pesanan_list_view_model.dart';
|
||||
|
||||
class PesananListView extends StatelessWidget {
|
||||
const PesananListView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<PesananListViewModel>.reactive(
|
||||
viewModelBuilder: () => PesananListViewModel(),
|
||||
onViewModelReady: (PesananListViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
PesananListViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
model.log.d('onWillPop ini pesanan');
|
||||
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: mainColor,
|
||||
automaticallyImplyLeading: false,
|
||||
),
|
||||
backgroundColor: backgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
MyWhiteContainer(
|
||||
child: IntrinsicHeight(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text(
|
||||
'Orderan',
|
||||
style: TextStyle(color: mainGrey),
|
||||
),
|
||||
),
|
||||
),
|
||||
const VerticalDivider(
|
||||
color: mainGrey,
|
||||
thickness: 1,
|
||||
),
|
||||
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,
|
||||
// ),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import '../../../../app/app.logger.dart';
|
||||
import '../../../../app/core/custom_base_view_model.dart';
|
||||
|
||||
class PesananListViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('PesananListViewModel');
|
||||
Future<void> init() async {
|
||||
globalVar.backPressed = 'exitApp';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user