Commit 0b825b15 authored by Dio Maulana's avatar Dio Maulana

viewbill new pge

parent 4dcaa98f
......@@ -77,7 +77,10 @@ class Api {
"table": tableNumber,
"user_name": userName,
"total_order": totalOrder,
"date_order": dateOrder,
"date_order": localDate(
dateOrder,
isHistory: true,
),
"branch_code": branchCode,
"brand": brandCode,
"token": token,
......@@ -88,6 +91,8 @@ class Api {
}
await prefs.setString('sessionId', jsonObject['data']['session_id']);
await prefs.setInt('table_mode', jsonObject['data']['table_mode']);
await prefs.setString('logoUrl', jsonObject['data']['image']);
//** save sessionID and Table Mode */
// return jsonObject['data']['name'];
......
import 'package:flutter_bloc/flutter_bloc.dart';
class SearchHistory extends Cubit<List<String>> {
SearchHistory() : super(['start']);
void search(List<String> historyOrder, String keyword) {
if (keyword == '') {
emit(historyOrder);
} else {
List<String> result = [];
for (var history in historyOrder) {
if (history.toLowerCase().contains(keyword.toLowerCase())) {
result.add(history);
}
}
emit(result);
}
}
}
......@@ -229,7 +229,7 @@ String localDate(String date, {isHistory = false}) {
}
break;
}
return "$day $resultMonth $year";
return "$day-$resultMonth-$year";
}
//** convert UTC to local */
......@@ -242,6 +242,12 @@ String localDate(String date, {isHistory = false}) {
double heightTombol = 0.06; // untuk dikalikan di height media query
//**Height tombol */
//** kalkulasi pixel dihome */
double imageHeight = 96;
double heighScrollWithImage = 371 + imageHeight;
double heighScrollWithOutImage = 371;
//** */
//** core warna */
// const Color backgroundColor = Colors.white;
const Color backgroundColor = Color(0xffF4F4F4);
......@@ -484,6 +490,9 @@ const double backIconSize = 0.03;
const String arrowBack = '\uf060';
const double arrowBackSize = 17;
const String arrowNext = '\uf105';
const double arrowNextSize = 14;
const String shopingBag = '\uf290';
const double shopingBagSize = 0.03;
......
......@@ -15,7 +15,6 @@ Future<dynamic> buttonDialogGlobal(
void Function() ontapCancel,
{Color okButtonColor = Colors.indigo,
Color cancelButtonColor = Colors.red}) {
double widthScreen = responsiveWidthScreen(context);
return showDialog(
context: context,
builder: (BuildContext context) => AlertDialog(
......@@ -29,108 +28,65 @@ Future<dynamic> buttonDialogGlobal(
title,
// style: textStyleNormalFont(context),
),
content: SizedBox(
height: MediaQuery.of(context).size.height * 0.38,
width: widthScreen * widhtDialog,
child: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.2,
child: Align(
alignment: Alignment.topLeft,
// child: Text(
// description,
// textScaleFactor: textScaleFactor,
// style: textStyleNormalFont(context),
// // style: TextStyle(
// // fontWeight: FontWeight.w400,
// // fontSize:
// // MediaQuery.of(context).size.height * normalFont),
// ),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Align(
alignment: Alignment.topLeft,
child: defaultText(
context,
description,
style: textStyleNormalFont(context),
),
),
const SizedBox(height: 10),
GestureDetector(
onTap: () {
ontapOk();
},
child: Container(
width: double.infinity,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: okButtonColor),
child: Center(
child: defaultText(
context,
description,
style: textStyleNormalFont(context),
),
),
),
SizedBox(height: MediaQuery.of(context).size.height * 0.01),
GestureDetector(
onTap: () {
ontapOk();
},
child: Container(
height: MediaQuery.of(context).size.height * heightTombol,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: okButtonColor),
child: Align(
// child: Text(
// textOnOk,
// textScaleFactor: textScaleFactor,
// // style: TextStyle(
// // fontWeight: FontWeight.w500,
// // fontSize:
// // MediaQuery.of(context).size.height * normalFont,
// // color: textInButton,
// // ),
// style: textStyleNormalFont(
// context,
// color: textInButton,
// ),
// ),
child: defaultText(
textOnOk,
style: textStyleNormalFont(
context,
textOnOk,
style: textStyleNormalFont(
context,
color: textInButton,
),
color: textInButton,
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
GestureDetector(
onTap: () {
ontapCancel();
},
child: Container(
height: MediaQuery.of(context).size.height * heightTombol,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: Colors.transparent,
),
child: Align(
// child: Text(
// textOnCancel,
// textScaleFactor: textScaleFactor,
// // style: TextStyle(
// // fontWeight: FontWeight.w500,
// // fontSize:
// // MediaQuery.of(context).size.height * normalFont,
// // color: textInButton,
// // ),
// style: textStyleNormalFont(
// context,
// color: textInButton,
// ),
// ),
child: defaultText(
),
const SizedBox(height: 10),
GestureDetector(
onTap: () {
ontapCancel();
},
child: Container(
width: double.infinity,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: Colors.transparent,
),
child: Center(
child: defaultText(
context,
textOnCancel,
style: textStyleNormalFont(
context,
textOnCancel,
style: textStyleNormalFont(
context,
color: textCancelColor,
),
color: textCancelColor,
),
),
),
)
],
),
),
)
],
),
));
}
......@@ -74,6 +74,7 @@ class EmoticonRateNew extends StatelessWidget {
defaultText(
context,
'Bagaimana pengalaman anda bertransaksi di excelso ?',
textAlign: TextAlign.center,
style: emojiStyle(),
),
const SizedBox(
......
// ignore_for_file: sized_box_for_whitespace
import 'package:byod/helper/widget/style.dart';
import 'package:flutter/material.dart';
import '../helper.dart';
class PlusMinusButton extends StatelessWidget {
const PlusMinusButton({
Key? key,
required this.initialValue,
required this.minus,
required this.plus,
this.backgroundAmountColor = backgroundColor,
this.isFromVariant = false,
this.widthInitialValue = 94,
}) : super(key: key);
final int initialValue;
final void Function() minus;
final void Function() plus;
final Color backgroundAmountColor;
final bool isFromVariant;
final double widthInitialValue;
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
width: widthInitialValue,
height: 22,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: backgroundAmountColor,
),
child: Center(
child: defaultText(
context,
initialValue.toString(),
style: amountViewBillButton(),
),
),
),
Positioned(
left: 0,
child: GestureDetector(
onTap: () {
// if (initialValue > 1) {
// initialValue += -1;
// context
// .read<OrderVariantTemporaryBloc>()
// .insertDataVariant(itemId, satuanPrice,
// initialValue, []);
// }
minus();
},
child: Container(
width: 22,
height: 22,
child: Image(
image: AssetImage((initialValue < 2 && isFromVariant)
? 'assets/icons/minus.png'
: 'assets/icons/minus-blue.png'),
),
),
),
),
Positioned(
right: 0,
child: GestureDetector(
onTap: () {
// initialValue += 1;
// context
// .read<OrderVariantTemporaryBloc>()
// .insertDataVariant(
// itemId, satuanPrice, initialValue, []);
plus();
},
child: Container(
width: 22,
height: 22,
child: const Image(
image: AssetImage('assets/icons/plus.png'),
),
),
),
)
],
);
}
}
......@@ -46,6 +46,19 @@ TextStyle emojiStyle({
);
}
TextStyle historyOrderStyle({
font = 12,
Color color = textColorBlack,
FontWeight fontWeight = FontWeight.w400,
}) {
return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily,
fontSize: font,
fontWeight: fontWeight,
color: color,
);
}
TextStyle appBarNameViewBill({font = 17, Color color = textColorBlack}) {
return TextStyle(
fontFamily: 'Mulish',
......@@ -281,7 +294,7 @@ TextStyle rincianPembayaran({
FontStyle? fontStyle,
}) {
return TextStyle(
fontFamily: 'OpenSans',
fontFamily: (fontFamily == '') ? null : fontFamily,
fontSize: font,
fontWeight: fontWeight,
color: color,
......
......@@ -28,6 +28,7 @@ import 'bloc/order_detail_variant.dart';
import 'bloc/order_variant_temporary.dart';
import 'bloc/order_variant_value.dart';
import 'bloc/search_active.dart';
import 'bloc/search_history.dart';
import 'bloc/view_bill.dart';
import 'package:flutter/services.dart' as bundle_root;
......@@ -158,6 +159,7 @@ class MyApp extends StatelessWidget {
BlocProvider(create: (_) => FavSelectedBar()),
BlocProvider(create: (_) => MenuSelectedBar()),
BlocProvider(create: (_) => SearchActive()),
BlocProvider(create: (_) => SearchHistory()),
],
child: MaterialApp(
title: (title == null) ? defaultTitle : title,
......
// ignore_for_file: sized_box_for_whitespace
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../bloc/search_history.dart';
import '../../helper/helper.dart';
import '../../helper/widget/style.dart';
class CustomAppBar extends StatelessWidget {
CustomAppBar({
Key? key,
required this.historyOrder,
}) : super(key: key);
final List<String> historyOrder;
final _searchController = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
color: backgroundWhite,
padding: const EdgeInsets.symmetric(
horizontal: paddingLeftRight, vertical: 15),
child: Column(
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
width: 24,
height: 24,
child: Center(
child: fontAwesomeNew(
arrowBack,
arrowBackSize,
),
),
),
),
const SizedBox(
width: 16,
),
Center(
child: defaultText(
context,
'Riwayat Transaksi',
maxLines: 1,
overFlow: TextOverflow.ellipsis,
style: appBarNameViewBill(),
),
),
],
),
const SizedBox(
height: 16,
),
Container(
height: 36,
child: TextField(
controller: _searchController,
// autofocus: true,
onChanged: (sarchValue) {
context.read<SearchHistory>().search(
historyOrder,
_searchController.text,
);
},
key: const Key('SearchField'),
style: TextStyle(
color: Colors.black,
fontFamily: fontFamily,
fontSize: 15,
),
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: Colors.grey.withOpacity(0.8),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: buttonColor,
),
),
prefixIcon: Image(
image: const AssetImage('assets/icons/search.png'),
color: Colors.grey.withOpacity(0.8),
height: 20,
width: 20,
),
hintText: 'Example: September',
hintStyle: TextStyle(
color: Colors.grey.withOpacity(0.8),
fontFamily: fontFamily,
fontSize: 10,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
),
),
),
),
],
),
);
}
}
// ignore_for_file: sized_box_for_whitespace
import 'dart:convert';
import 'package:byod/helper/helper.dart';
import 'package:byod/helper/widget/style.dart';
import 'package:byod/ui/history_order/app_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../bloc/search_history.dart';
import '../viewbill/view_bill_new.dart';
class HistoryOrderNew extends StatelessWidget {
const HistoryOrderNew({
super.key,
required this.historyOrder,
});
final List<String> historyOrder;
@override
Widget build(BuildContext context) {
return SafeArea(
child: GestureDetector(
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
},
child: Scaffold(
backgroundColor: backgroundColor,
body: Column(
children: [
CustomAppBar(
historyOrder: historyOrder,
),
const SizedBox(
height: 16,
),
BlocBuilder<SearchHistory, List<String>>(
builder: (ctxSearch, historyOrderSearch) {
List<String> historyOrderAfterSearch;
if (historyOrderSearch.isNotEmpty &&
historyOrderSearch[0] == 'start') {
historyOrderAfterSearch = historyOrder;
} else {
historyOrderAfterSearch = historyOrderSearch;
}
return Expanded(
child: ListView.builder(
itemCount: historyOrderAfterSearch.length,
itemBuilder: (ctxHistory, i) {
var jsonDecodeHistory = jsonDecode(
historyOrderAfterSearch[
historyOrderAfterSearch.length - (i + 1)]);
return GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => ViewBillNew(
isHistory: true,
sessionId: jsonDecodeHistory['session'],
branchCodeH: jsonDecodeHistory['branch_code'],
brandCodeH: jsonDecodeHistory['brand'],
token: jsonDecodeHistory['token'],
userName: jsonDecodeHistory['user_name'],
),
),
);
},
child: Container(
margin: const EdgeInsets.only(
bottom: 8,
left: paddingLeftRight,
right: paddingLeftRight,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: backgroundWhite,
),
height: 72,
child: Container(
padding: const EdgeInsets.only(
left: 16,
right: 12,
bottom: 16,
top: 5,
),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
defaultText(
context,
jsonDecodeHistory['user_name'],
style: historyOrderStyle(),
),
const SizedBox(
height: 4,
),
defaultText(
context,
"Rp ${formatNumber().format(amountParseToInt(jsonDecodeHistory['total_order']))}",
style: historyOrderStyle(),
)
],
),
),
Container(
width: 145,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
defaultText(
context,
(jsonDecodeHistory['date_order'] ==
null)
? ''
: jsonDecodeHistory['date_order'],
style: historyOrderStyle(
color: textGreyDeskripsi,
),
),
const SizedBox(
height: 15,
),
fontAwesomeNew(
arrowNext,
16,
)
],
),
)
],
),
),
),
);
},
),
);
},
)
],
),
),
));
}
}
......@@ -52,8 +52,8 @@ class _CategoryListHomeState extends State<CategoryListHome> {
.selectedBarMenu(i, widget.categoryList[i].id);
widget.scrollController.animateTo(
(widget.favList.isNotEmpty)
? 371
: 0, // 371 sudah dihituing pixelnya untuk awal banget dari menu item
? heighScrollWithImage
: imageHeight, // 371 sudah dihituing pixelnya untuk awal banget dari menu item
duration: const Duration(milliseconds: 500),
curve: Curves.fastOutSlowIn,
);
......
// ignore_for_file: sized_box_for_whitespace, avoid_unnecessary_containers
import 'package:byod/helper/widget/plus_minus_button.dart';
import 'package:byod/models/orders.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
......@@ -211,6 +212,54 @@ class FavGridMenu extends StatelessWidget {
}
final noteController = TextEditingController(
text: (indexListOrderan != -1) ? list[indexListOrderan].note : '');
void minus() {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
if (initialValue > 0) {
initialValue -= 1;
context.read<OrdersBloc>().insertData([
[
menuFav.id,
menuFav.name,
initialValue,
amountParseToInt(menuFav.price),
list,
menuFav.imageUrlMedium,
orderVariants,
amountParseToInt(menuFav.price),
(indexListOrderan != -1) ? list[indexListOrderan].note : ''
]
], context);
// setState(() {});
}
}
void plus() {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
initialValue += 1;
context.read<OrdersBloc>().insertData([
[
menuFav.id,
menuFav.name,
initialValue,
amountParseToInt(menuFav.price),
list,
menuFav.imageUrlMedium,
orderVariants,
amountParseToInt(menuFav.price),
(indexListOrderan != -1) ? list[indexListOrderan].note : '',
]
], context);
}
return AnimatedSwitcher(
duration: Duration(milliseconds: animatedTime),
transitionBuilder: (Widget child, Animation<double> animation) {
......@@ -363,82 +412,89 @@ class FavGridMenu extends StatelessWidget {
const SizedBox(
width: 5,
),
GestureDetector(
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
PlusMinusButton(
initialValue: initialValue,
minus: minus,
plus: plus,
backgroundAmountColor: backgroundWhite,
widthInitialValue: 86,
)
// GestureDetector(
// onTap: () {
// FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
if (initialValue > 0) {
initialValue -= 1;
context.read<OrdersBloc>().insertData([
[
menuFav.id,
menuFav.name,
initialValue,
amountParseToInt(menuFav.price),
list,
menuFav.imageUrlMedium,
orderVariants,
amountParseToInt(menuFav.price),
(indexListOrderan != -1)
? list[indexListOrderan].note
: ''
]
], context);
// setState(() {});
}
},
child: Container(
width: 22,
height: 22,
child: const Image(
image: AssetImage('assets/icons/minus-blue.png'),
),
),
),
Expanded(
child: Center(
child: defaultText(
context,
initialValue.toString(),
style: amountGridFav(),
),
),
),
GestureDetector(
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
// if (!currentFocus.hasPrimaryFocus) {
// currentFocus.unfocus();
// }
// if (initialValue > 0) {
// initialValue -= 1;
// context.read<OrdersBloc>().insertData([
// [
// menuFav.id,
// menuFav.name,
// initialValue,
// amountParseToInt(menuFav.price),
// list,
// menuFav.imageUrlMedium,
// orderVariants,
// amountParseToInt(menuFav.price),
// (indexListOrderan != -1)
// ? list[indexListOrderan].note
// : ''
// ]
// ], context);
// // setState(() {});
// }
// },
// child: Container(
// width: 22,
// height: 22,
// child: const Image(
// image: AssetImage('assets/icons/minus-blue.png'),
// ),
// ),
// ),
// Expanded(
// child: Center(
// child: defaultText(
// context,
// initialValue.toString(),
// style: amountGridFav(),
// ),
// ),
// ),
// GestureDetector(
// onTap: () {
// FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
initialValue += 1;
context.read<OrdersBloc>().insertData([
[
menuFav.id,
menuFav.name,
initialValue,
amountParseToInt(menuFav.price),
list,
menuFav.imageUrlMedium,
orderVariants,
amountParseToInt(menuFav.price),
(indexListOrderan != -1)
? list[indexListOrderan].note
: '',
]
], context);
},
child: Container(
width: 22,
height: 22,
child: const Image(
image: AssetImage('assets/icons/plus.png'),
),
),
)
// if (!currentFocus.hasPrimaryFocus) {
// currentFocus.unfocus();
// }
// initialValue += 1;
// context.read<OrdersBloc>().insertData([
// [
// menuFav.id,
// menuFav.name,
// initialValue,
// amountParseToInt(menuFav.price),
// list,
// menuFav.imageUrlMedium,
// orderVariants,
// amountParseToInt(menuFav.price),
// (indexListOrderan != -1)
// ? list[indexListOrderan].note
// : '',
// ]
// ], context);
// },
// child: Container(
// width: 22,
// height: 22,
// child: const Image(
// image: AssetImage('assets/icons/plus.png'),
// ),
// ),
// )
],
),
),
......
This diff is collapsed.
......@@ -591,35 +591,83 @@ class _NewHome2State extends State<NewHome2> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
customAppBar(
context,
paddingLeftRight,
appBarHeight,
tableNumber,
userName,
isSearchActive,
),
SizedBox(
height: (isSearchActive) ? 16 : 20,
),
AnimatedSwitcher(
duration: Duration(milliseconds: animatedTime),
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(scale: animation, child: child);
},
child: (isSearchActive)
? searchField(
searchFieldHeight,
categoryNonFav,
)
: const SizedBox(
key: Key('SearchField'),
),
),
// customAppBar(
// context,
// paddingLeftRight,
// appBarHeight,
// tableNumber,
// userName,
// isSearchActive,
// ),
// SizedBox(
// height: (isSearchActive) ? 16 : 20,
// ),
// AnimatedSwitcher(
// duration: Duration(milliseconds: animatedTime),
// transitionBuilder: (Widget child, Animation<double> animation) {
// return ScaleTransition(scale: animation, child: child);
// },
// child: (isSearchActive)
// ? searchField(
// searchFieldHeight,
// categoryNonFav,
// )
// : const SizedBox(
// key: Key('SearchField'),
// ),
// ),
Expanded(
child: CustomScrollView(
controller: _scrollController,
slivers: [
SliverToBoxAdapter(
child: Container(
padding: const EdgeInsets.only(
top: 16,
),
child: Row(
children: [
const Spacer(),
Container(
width: 209,
height: 80,
child: const Image(
width: 209,
height: 80,
fit: BoxFit.fill,
image: AssetImage('assets/emoji/excelso.png'),
),
),
const Spacer(),
],
),
),
),
SliverPersistentHeader(
pinned: true,
delegate: DelegateAppBar(
appBarHeight + searchFieldHeight,
customAppBar(
context,
paddingLeftRight,
appBarHeight + searchFieldHeight,
tableNumber,
userName,
isSearchActive,
),
),
),
SliverPersistentHeader(
pinned: true,
delegate: DelegateSearchField(
isSearchActive,
searchFieldHeight,
searchField(
searchFieldHeight,
categoryNonFav,
),
),
),
SliverToBoxAdapter(
child: SizedBox(
height: (isSearchActive) ? spacerHeight : 0,
......@@ -792,10 +840,12 @@ class _NewHome2State extends State<NewHome2> {
Container searchField(
double searchFieldHeight, List<FilterMenu> categoryNonFav) {
return Container(
margin: const EdgeInsets.only(bottom: 5),
padding: const EdgeInsets.only(bottom: 10),
height: searchFieldHeight,
color: backgroundColor,
child: TextField(
autofocus: true,
textAlignVertical: TextAlignVertical.center,
onChanged: (sarchValue) {
context.read<SearchMenu>().searchMenu(
categoryNonFav,
......@@ -812,6 +862,7 @@ class _NewHome2State extends State<NewHome2> {
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.zero,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
......@@ -1080,8 +1131,9 @@ class _NewHome2State extends State<NewHome2> {
barName = "Meja $tableNumber";
}
return Container(
margin: const EdgeInsets.only(top: 24),
padding: const EdgeInsets.only(top: 10),
height: appBarHeight,
color: backgroundColor,
child: Row(
children: [
defaultText(
......@@ -1101,8 +1153,8 @@ class _NewHome2State extends State<NewHome2> {
);
_scrollController.animateTo(
(favList.isNotEmpty)
? 371
: 0, // 371 sudah dihituing pixelnya untuk awal banget dari menu item
? heighScrollWithImage
: imageHeight, // 371 sudah dihituing pixelnya untuk awal banget dari menu item
duration: const Duration(milliseconds: 500),
curve: Curves.fastOutSlowIn,
);
......@@ -1197,6 +1249,65 @@ class Delegate extends SliverPersistentHeaderDelegate {
}
}
class DelegateAppBar extends SliverPersistentHeaderDelegate {
final double appBarHeight;
final Widget customAppBar;
DelegateAppBar(
this.appBarHeight,
this.customAppBar,
);
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return customAppBar;
}
@override
double get maxExtent => appBarHeight;
@override
double get minExtent => appBarHeight;
@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
return true;
}
}
class DelegateSearchField extends SliverPersistentHeaderDelegate {
final bool isSearchActive;
final double searchFieldHeight;
final Widget searchField;
DelegateSearchField(
this.isSearchActive, this.searchFieldHeight, this.searchField);
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return AnimatedSwitcher(
duration: Duration(milliseconds: animatedTime),
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(scale: animation, child: child);
},
child: (isSearchActive)
? searchField
: const SizedBox(
key: Key('SearchField'),
),
);
}
@override
double get maxExtent => (isSearchActive) ? searchFieldHeight : 0;
@override
double get minExtent => (isSearchActive) ? searchFieldHeight : 0;
@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
return true;
}
}
class CustomClipPath extends CustomClipper<Path> {
@override
Path getClip(Size size) {
......
This diff is collapsed.
......@@ -25,11 +25,14 @@ class CustomAppBar extends StatelessWidget {
String cashierName = prefs.getString('cashier_name') ?? '';
String sessionId = prefs.getString('sessionId') ?? '';
return Container(
margin: const EdgeInsets.only(
padding: const EdgeInsets.only(
top: 15,
bottom: 30,
bottom: 19,
left: paddingLeftRight,
right: paddingLeftRight,
),
padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
// padding: const EdgeInsets.symmetric(horizontal: paddingLeftRight),
color: backgroundWhite,
child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
......
This diff is collapsed.
......@@ -24,7 +24,7 @@ class RincianPembayaran extends StatelessWidget {
vertical: 16,
),
height: 209,
// color: Colors.red,
color: backgroundWhite,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment