checkout page
This commit is contained in:
@@ -43,6 +43,20 @@ class $AssetsAudioGen {
|
||||
];
|
||||
}
|
||||
|
||||
class $AssetsIconsGen {
|
||||
const $AssetsIconsGen();
|
||||
|
||||
/// File path: assets/icons/dine_in.png
|
||||
AssetGenImage get dineIn => const AssetGenImage('assets/icons/dine_in.png');
|
||||
|
||||
/// File path: assets/icons/takeaway.png
|
||||
AssetGenImage get takeaway =>
|
||||
const AssetGenImage('assets/icons/takeaway.png');
|
||||
|
||||
/// List of all assets
|
||||
List<AssetGenImage> get values => [dineIn, takeaway];
|
||||
}
|
||||
|
||||
class $AssetsImagesGen {
|
||||
const $AssetsImagesGen();
|
||||
|
||||
@@ -97,6 +111,7 @@ class Assets {
|
||||
const Assets._();
|
||||
|
||||
static const $AssetsAudioGen audio = $AssetsAudioGen();
|
||||
static const $AssetsIconsGen icons = $AssetsIconsGen();
|
||||
static const $AssetsImagesGen images = $AssetsImagesGen();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DashedDivider extends StatelessWidget {
|
||||
final double height;
|
||||
final double dashWidth;
|
||||
final double dashSpacing;
|
||||
final Color color;
|
||||
|
||||
const DashedDivider({
|
||||
super.key,
|
||||
this.height = 1,
|
||||
this.dashWidth = 5,
|
||||
this.dashSpacing = 3,
|
||||
this.color = Colors.grey,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final boxWidth = constraints.constrainWidth();
|
||||
final dashCount = (boxWidth / (dashWidth + dashSpacing)).floor();
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: List.generate(dashCount, (_) {
|
||||
return SizedBox(
|
||||
width: dashWidth,
|
||||
height: height,
|
||||
child: DecoratedBox(decoration: BoxDecoration(color: color)),
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,3 +4,5 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import '../../../common/theme/theme.dart';
|
||||
|
||||
part 'elevated_button.dart';
|
||||
part 'outline_button.dart';
|
||||
part 'qty_button.dart';
|
||||
|
||||
@@ -6,7 +6,7 @@ class AppElevatedButton extends StatelessWidget {
|
||||
required this.onPressed,
|
||||
required this.title,
|
||||
this.width = double.infinity,
|
||||
this.height = 48.0,
|
||||
this.height = 44.0,
|
||||
this.isLoading = false,
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ class AppElevatedButton extends StatelessWidget {
|
||||
)
|
||||
: Text(
|
||||
title,
|
||||
style: AppStyle.lg.copyWith(
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
part of 'button.dart';
|
||||
|
||||
class AppOutlineButton extends StatelessWidget {
|
||||
const AppOutlineButton({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
required this.title,
|
||||
this.width = double.infinity,
|
||||
this.height = 44.0,
|
||||
this.isLoading = false,
|
||||
this.borderColor,
|
||||
});
|
||||
|
||||
final Function()? onPressed;
|
||||
final String title;
|
||||
final double width;
|
||||
final double height;
|
||||
final bool isLoading;
|
||||
final Color? borderColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: OutlinedButton(
|
||||
onPressed: onPressed,
|
||||
style: OutlinedButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
side: BorderSide(color: borderColor ?? AppColor.primary),
|
||||
),
|
||||
child: isLoading
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SpinKitFadingCircle(color: AppColor.white, size: 24),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'Loading',
|
||||
style: AppStyle.lg.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
title,
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
part of 'button.dart';
|
||||
|
||||
class QtyButton extends StatelessWidget {
|
||||
const QtyButton({super.key});
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/data/service_data.dart';
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../image/image.dart';
|
||||
import 'gradient_card.dart';
|
||||
|
||||
class ServiceCard extends StatelessWidget {
|
||||
final Service service;
|
||||
const ServiceCard({super.key, required this.service});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GradientCard(
|
||||
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadiusGeometry.circular(8),
|
||||
child: Image.asset(
|
||||
service.imagePath,
|
||||
width: 60,
|
||||
height: 60,
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
ImagePlaceholder(width: 60, height: 60),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
service.name,
|
||||
style: AppStyle.xl.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.white,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
service.description,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColor.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
child: Text(
|
||||
'Ubah',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user