feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -17,7 +17,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
class DayWidget extends StatefulWidget {
DayWidget({
const DayWidget({
super.key,
required this.index,
});
@@ -47,10 +47,10 @@ class _DayWidgetState extends State<DayWidget> {
Row(
children: [
Text(
s.day + ' ${widget.index + 1}',
'${s.day} ${widget.index + 1}',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
Spacer(),
const Spacer(),
GestureDetector(
onTap: () {
context.read<CreateDietCubit>().copyDay(widget.index);
@@ -65,23 +65,23 @@ class _DayWidgetState extends State<DayWidget> {
),
],
),
SizedBox(
const SizedBox(
height: 12,
),
CustomDivider(),
SizedBox(
const CustomDivider(),
const SizedBox(
height: 12,
),
Text(
s.meal,
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Row(
children: [
ChoiceChipWidget(
chipsLabelList: chipsLabelList,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
fontSize: TextStyles.textMMedium.fontSize,
fontWeight: TextStyles.textMMedium.fontWeight,
index: 0,
@@ -92,10 +92,10 @@ class _DayWidgetState extends State<DayWidget> {
});
},
),
Spacer(),
const Spacer(),
ChoiceChipWidget(
chipsLabelList: chipsLabelList,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
fontSize: TextStyles.textMMedium.fontSize,
fontWeight: TextStyles.textMMedium.fontWeight,
index: 1,
@@ -106,10 +106,10 @@ class _DayWidgetState extends State<DayWidget> {
});
},
),
Spacer(),
const Spacer(),
ChoiceChipWidget(
chipsLabelList: chipsLabelList,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
fontSize: TextStyles.textMMedium.fontSize,
fontWeight: TextStyles.textMMedium.fontWeight,
index: 2,
@@ -120,10 +120,10 @@ class _DayWidgetState extends State<DayWidget> {
});
},
),
Spacer(),
const Spacer(),
ChoiceChipWidget(
chipsLabelList: chipsLabelList,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
fontSize: TextStyles.textMMedium.fontSize,
fontWeight: TextStyles.textMMedium.fontWeight,
index: 3,
@@ -134,10 +134,10 @@ class _DayWidgetState extends State<DayWidget> {
});
},
),
Spacer(),
const Spacer(),
ChoiceChipWidget(
chipsLabelList: chipsLabelList,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
fontSize: TextStyles.textMMedium.fontSize,
fontWeight: TextStyles.textMMedium.fontWeight,
index: 4,
@@ -151,10 +151,10 @@ class _DayWidgetState extends State<DayWidget> {
],
),
ListView.separated(
separatorBuilder: (context, index) => SizedBox(
separatorBuilder: (context, index) => const SizedBox(
height: 8,
),
padding: EdgeInsets.all(0),
padding: const EdgeInsets.all(0),
itemBuilder: (context, index) {
final product = state.dietData.dailySchedule?[widget.index][_selectedMealIndex][index];
if (product != null) {
@@ -174,9 +174,9 @@ class _DayWidgetState extends State<DayWidget> {
},
itemCount: state.dietData.dailySchedule?[widget.index][_selectedMealIndex].length ?? 0,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Row(
children: [
GestureDetector(
@@ -184,8 +184,8 @@ class _DayWidgetState extends State<DayWidget> {
context.read<CreateDietCubit>().pasteCopiedDay(widget.index);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 14),
decoration: BoxDecoration(color: appTheme.gray50, borderRadius: BorderRadius.all(Radius.circular(12))),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
decoration: BoxDecoration(color: appTheme.gray50, borderRadius: const BorderRadius.all(Radius.circular(12))),
child: SvgPicture.asset(
'assets/icons/paste2.svg',
width: 28,
@@ -193,7 +193,7 @@ class _DayWidgetState extends State<DayWidget> {
),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: CustomOutlinedButton(
onPressed: () {
@@ -209,7 +209,7 @@ class _DayWidgetState extends State<DayWidget> {
color: appTheme.whiteA700,
),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
),
@@ -217,10 +217,10 @@ class _DayWidgetState extends State<DayWidget> {
],
),
if (state.dailyScheduleErrors[widget.index].isNotEmpty) ...[
SizedBox(height: 12),
const SizedBox(height: 12),
CustomErrorWidget(error: state.dailyScheduleErrors[widget.index]),
],
SizedBox(height: 20),
const SizedBox(height: 20),
],
),
),
@@ -274,7 +274,7 @@ class _DayWidgetState extends State<DayWidget> {
carbohydrates: carbohydrates,
);
}
return CpfcContainer(
return const CpfcContainer(
calories: 0,
proteins: 0,
fats: 0,
@@ -302,7 +302,7 @@ class _DayWidgetState extends State<DayWidget> {
quantityControllerText: quantity.toString(),
);
},
trailing: Icon(Icons.more_vert_rounded),
trailing: const Icon(Icons.more_vert_rounded),
title: Text(product),
subtitle: Text('$quantity $portion'),
shape: RoundedRectangleBorder(
@@ -324,7 +324,7 @@ class _DayWidgetState extends State<DayWidget> {
return showModalBottomSheet(
useRootNavigator: true,
context: context,
shape: RoundedRectangleBorder(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
),
isScrollControlled: true,