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

add bottom button

parent 0a328c71
......@@ -181,7 +181,7 @@ TextStyle addButtonMenu({
);
}
TextStyle addButtonBotoomCart({
TextStyle addButtonBottomCart({
font = 16,
Color color = textInButton,
}) {
......@@ -193,6 +193,18 @@ TextStyle addButtonBotoomCart({
);
}
TextStyle textAmountButtonBottomCart({
font = 16,
Color color = textInButton,
}) {
return TextStyle(
fontFamily: (fontFamily == '') ? null : fontFamily,
fontSize: font,
fontWeight: FontWeight.w300,
color: color,
);
}
Text fontAwesome(BuildContext context, String unicode, double fontSize,
{Color? color, isBold = true}) {
// double widthScreens = responsiveWidthScreen(context);
......
......@@ -450,6 +450,21 @@ class _NewHome2State extends State<NewHome2> {
],
),
),
Positioned(
bottom: 40,
left: 0,
child: Container(
height: 43,
width: MediaQuery.of(context).size.width -
147,
decoration: BoxDecoration(
color: buttonColor,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(30),
),
),
),
),
Positioned(
bottom: 0,
child: Container(
......@@ -458,7 +473,9 @@ class _NewHome2State extends State<NewHome2> {
decoration: BoxDecoration(
color: buttonColor,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(30)),
topRight: Radius.circular(30),
topLeft: Radius.circular(10),
),
),
child: Row(
crossAxisAlignment:
......@@ -469,7 +486,11 @@ class _NewHome2State extends State<NewHome2> {
margin: EdgeInsets.only(
left: paddingLeftRight),
child: defaultText(
context, 'Rp 25,000'),
context,
'Rp 25,000',
style:
textAmountButtonBottomCart(),
),
),
),
Container(
......@@ -492,7 +513,7 @@ class _NewHome2State extends State<NewHome2> {
defaultText(
context,
"Pesan",
style: addButtonBotoomCart(
style: addButtonBottomCart(
color: buttonColor,
),
),
......@@ -550,158 +571,158 @@ class _NewHome2State extends State<NewHome2> {
);
}
Container girdFavItem(
List<FilterMenu> favListItem,
int i,
double widthGrid,
double paddingLeftRigthGrid,
BuildContext context,
) {
bool addCondition = true;
return Container(
margin: EdgeInsets.only(
left: (i == 0) ? 0 : 8, // paling awal gausah dikasih margin
right: (i == favListItem.length - 1)
? 0
: 8, // paling akhir gausah dikasi margin
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: gridCardBackgroundColor,
),
height: double.infinity,
width: widthGrid,
child: Container(
margin: EdgeInsets.only(
top: 8,
left: paddingLeftRigthGrid,
right: paddingLeftRigthGrid,
bottom: 16,
),
// color: Colors.red,
child: Column(
children: [
Container(
width: widthGrid - (2 * paddingLeftRigthGrid),
height: widthGrid - (2 * paddingLeftRigthGrid),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
// color: Colors.red,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image(
fit: BoxFit.fill,
image: NetworkImage(favListItem[i].imageUrlMedium),
),
),
),
const SizedBox(
height: 3,
),
Container(
width: widthGrid - (2 * paddingLeftRigthGrid),
height: 28,
// color: Colors.blue,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: defaultText(
context,
favListItem[i].name,
maxLines: 2,
overFlow: TextOverflow.ellipsis,
style: menuNameGridFav(),
),
),
Container(
width: 40,
child: defaultText(
context,
'Rp ${formatNumber().format(amountParseToInt(favListItem[i].price))}',
maxLines: 3,
overFlow: TextOverflow.ellipsis,
style: menuPriceGridFav(),
),
)
],
),
),
const SizedBox(
height: 16,
),
(addCondition)
? Container(
height: 30,
width: widthGrid - (2 * paddingLeftRigthGrid),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: buttonColor,
),
child: Center(
child: defaultText(
context,
'Tambah',
style: addButtonGridFav(),
),
),
)
: Container(
height: 30,
width: widthGrid - (2 * paddingLeftRigthGrid),
child: Row(
children: [
Container(
width: 27,
height: 24,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: buttonColor,
),
child: const Center(
child: Image(
width: 13.33,
height: 13.33,
color: textInButton,
image: AssetImage('assets/icons/note.png'),
),
),
),
const SizedBox(
width: 5,
),
Container(
width: 22,
height: 22,
child: const Image(
image: AssetImage('assets/icons/minus.png'),
),
),
Expanded(
child: Center(
child: defaultText(
context,
'10',
style: amountGridFav(),
),
),
),
Container(
width: 22,
height: 22,
child: const Image(
image: AssetImage('assets/icons/plus.png'),
),
)
],
),
)
],
),
),
);
}
// Container girdFavItem(
// List<FilterMenu> favListItem,
// int i,
// double widthGrid,
// double paddingLeftRigthGrid,
// BuildContext context,
// ) {
// bool addCondition = true;
// return Container(
// margin: EdgeInsets.only(
// left: (i == 0) ? 0 : 8, // paling awal gausah dikasih margin
// right: (i == favListItem.length - 1)
// ? 0
// : 8, // paling akhir gausah dikasi margin
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(5),
// color: gridCardBackgroundColor,
// ),
// height: double.infinity,
// width: widthGrid,
// child: Container(
// margin: EdgeInsets.only(
// top: 8,
// left: paddingLeftRigthGrid,
// right: paddingLeftRigthGrid,
// bottom: 16,
// ),
// // color: Colors.red,
// child: Column(
// children: [
// Container(
// width: widthGrid - (2 * paddingLeftRigthGrid),
// height: widthGrid - (2 * paddingLeftRigthGrid),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// // color: Colors.red,
// ),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(8),
// child: Image(
// fit: BoxFit.fill,
// image: NetworkImage(favListItem[i].imageUrlMedium),
// ),
// ),
// ),
// const SizedBox(
// height: 3,
// ),
// Container(
// width: widthGrid - (2 * paddingLeftRigthGrid),
// height: 28,
// // color: Colors.blue,
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Expanded(
// child: defaultText(
// context,
// favListItem[i].name,
// maxLines: 2,
// overFlow: TextOverflow.ellipsis,
// style: menuNameGridFav(),
// ),
// ),
// Container(
// width: 40,
// child: defaultText(
// context,
// 'Rp ${formatNumber().format(amountParseToInt(favListItem[i].price))}',
// maxLines: 3,
// overFlow: TextOverflow.ellipsis,
// style: menuPriceGridFav(),
// ),
// )
// ],
// ),
// ),
// const SizedBox(
// height: 16,
// ),
// (addCondition)
// ? Container(
// height: 30,
// width: widthGrid - (2 * paddingLeftRigthGrid),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// color: buttonColor,
// ),
// child: Center(
// child: defaultText(
// context,
// 'Tambah',
// style: addButtonGridFav(),
// ),
// ),
// )
// : Container(
// height: 30,
// width: widthGrid - (2 * paddingLeftRigthGrid),
// child: Row(
// children: [
// Container(
// width: 27,
// height: 24,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// color: buttonColor,
// ),
// child: const Center(
// child: Image(
// width: 13.33,
// height: 13.33,
// color: textInButton,
// image: AssetImage('assets/icons/note.png'),
// ),
// ),
// ),
// const SizedBox(
// width: 5,
// ),
// Container(
// width: 22,
// height: 22,
// child: const Image(
// image: AssetImage('assets/icons/minus.png'),
// ),
// ),
// Expanded(
// child: Center(
// child: defaultText(
// context,
// '10',
// style: amountGridFav(),
// ),
// ),
// ),
// Container(
// width: 22,
// height: 22,
// child: const Image(
// image: AssetImage('assets/icons/plus.png'),
// ),
// )
// ],
// ),
// )
// ],
// ),
// ),
// );
// }
Container customAppBar(
BuildContext context, double paddingLeftRight, double appBarHeight) {
......
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