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

@@ -7,7 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AddItemWidget extends StatefulWidget {
AddItemWidget({
const AddItemWidget({
super.key,
required this.canBeDeleted,
required this.enableHint,
@@ -51,13 +51,13 @@ class _AddItemWidgetState extends State<AddItemWidget> {
),
),
if (widget.canBeDeleted) ...[
SizedBox(width: 8),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
context.read<CreatePlanCubit>().removeOptionContentItem(widget.index);
},
child: Container(
padding: EdgeInsets.all(14),
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: appTheme.lightGray0,
borderRadius: BorderRadius.circular(20),

View File

@@ -13,7 +13,7 @@ import 'package:flutter_portal/flutter_portal.dart';
import 'package:flutter_svg/flutter_svg.dart';
class OptionWidget extends StatefulWidget {
OptionWidget({super.key});
const OptionWidget({super.key});
@override
State<OptionWidget> createState() => _OptionWidgetState();
@@ -40,7 +40,7 @@ class _OptionWidgetState extends State<OptionWidget> {
}
final price = double.tryParse(customerPriceController.text.replaceAll('₽', ''));
if (price != null && price < 1200) {
customerPriceController.value = TextEditingValue(
customerPriceController.value = const TextEditingValue(
text: "1200₽",
selection: TextSelection.collapsed(offset: 4),
);
@@ -57,7 +57,7 @@ class _OptionWidgetState extends State<OptionWidget> {
}
final price = double.tryParse(creatorPriceController.text.replaceAll('₽', ''));
if (price != null && price < 1000) {
creatorPriceController.value = TextEditingValue(
creatorPriceController.value = const TextEditingValue(
text: "1000₽",
selection: TextSelection.collapsed(offset: 4),
);
@@ -80,7 +80,7 @@ class _OptionWidgetState extends State<OptionWidget> {
optionTitleController.text = state.planData.options[selectedOptionIndex].short;
optionDescriptionController.text = state.planData.options[selectedOptionIndex].description;
return MainBackgroundBouble(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -91,7 +91,7 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
hintText: optionNameHintText,
controller: optionTitleController,
@@ -100,7 +100,7 @@ class _OptionWidgetState extends State<OptionWidget> {
},
maxLength: 150,
),
SizedBox(height: 12),
const SizedBox(height: 12),
Text(
s.option_desc,
textAlign: TextAlign.center,
@@ -108,7 +108,7 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
SizedBox(
height: 120,
child: CustomTextFormField(
@@ -124,7 +124,7 @@ class _OptionWidgetState extends State<OptionWidget> {
},
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Row(
children: [
Text(
@@ -134,11 +134,11 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(width: 4),
_PriceExplanationWidget(),
const SizedBox(width: 4),
const _PriceExplanationWidget(),
],
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: creatorPriceController,
onChanged: (value) {
@@ -151,7 +151,7 @@ class _OptionWidgetState extends State<OptionWidget> {
},
maxLength: 20,
),
SizedBox(height: 12),
const SizedBox(height: 12),
Row(
children: [
Text(
@@ -161,14 +161,14 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(width: 4),
_PriceExplanationWidget(),
const SizedBox(width: 4),
const _PriceExplanationWidget(),
],
),
SizedBox(height: 4),
const SizedBox(height: 4),
CustomTextFormField(
controller: customerPriceController,
textInputType: TextInputType.numberWithOptions(decimal: true),
textInputType: const TextInputType.numberWithOptions(decimal: true),
onChanged: (value) {
final price = double.tryParse(value.replaceAll('₽', ''));
if (price != null) {
@@ -178,7 +178,7 @@ class _OptionWidgetState extends State<OptionWidget> {
},
maxLength: 20,
),
SizedBox(height: 10),
const SizedBox(height: 10),
Text(
s.minimal_customer_price,
textAlign: TextAlign.center,
@@ -186,9 +186,9 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 16),
CustomDivider(),
SizedBox(height: 16),
const SizedBox(height: 16),
const CustomDivider(),
const SizedBox(height: 16),
Text(
s.option_content,
textAlign: TextAlign.center,
@@ -196,10 +196,10 @@ class _OptionWidgetState extends State<OptionWidget> {
softWrap: true,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 4),
const SizedBox(height: 4),
ListView.separated(
padding: EdgeInsets.zero,
separatorBuilder: (context, index) => SizedBox(height: 8),
separatorBuilder: (context, index) => const SizedBox(height: 8),
reverse: false,
itemBuilder: (context, index) {
final items = state.planData.options[selectedOptionIndex].items;
@@ -231,18 +231,18 @@ class _OptionWidgetState extends State<OptionWidget> {
},
itemCount: state.planData.options[selectedOptionIndex].items.length + 1,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
),
SizedBox(height: 16),
CustomDivider(),
SizedBox(height: 16),
const SizedBox(height: 16),
const CustomDivider(),
const SizedBox(height: 16),
Row(
children: [
Checkbox(
value: isChecked,
activeColor: appTheme.gray,
checkColor: appTheme.gray,
fillColor: WidgetStatePropertyAll(Colors.transparent),
fillColor: const WidgetStatePropertyAll(Colors.transparent),
side: WidgetStateBorderSide.resolveWith(
(Set<WidgetState> states) {
return BorderSide(width: 1, color: appTheme.gray);
@@ -283,9 +283,9 @@ class _PriceExplanationWidgetState extends State<_PriceExplanationWidget> {
Widget build(BuildContext context) {
final s = S.of(context);
return PortalTarget(
closeDuration: Duration(milliseconds: 300),
closeDuration: const Duration(milliseconds: 300),
portalFollower: AnimatedContainer(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
duration: const Duration(milliseconds: 300),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
@@ -302,7 +302,7 @@ class _PriceExplanationWidgetState extends State<_PriceExplanationWidget> {
),
),
visible: visible,
anchor: Aligned(
anchor: const Aligned(
shiftToWithinBound: AxisFlag(x: true, y: true),
follower: Alignment.bottomLeft,
target: Alignment.topRight,

View File

@@ -16,7 +16,7 @@ class OptionsCountButton extends StatelessWidget {
builder: (context, state) {
final selectedOption = state.selectedOptionIndex;
return Container(
margin: EdgeInsets.symmetric(horizontal: 16),
margin: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: appTheme.whiteA700,
borderRadius: BorderRadius.circular(100),

View File

@@ -25,9 +25,9 @@ class _PlanDurationDropDownWidgetState extends State<PlanDurationDropDownWidget>
super.didChangeDependencies();
final s = S.of(context);
if (durationDropDownTitles.isEmpty) {
durationValues.forEach((element) {
for (var element in durationValues) {
durationDropDownTitles.add('$element ${getDayForm(element, s)}');
});
}
}
}
@@ -49,11 +49,11 @@ class _PlanDurationDropDownWidgetState extends State<PlanDurationDropDownWidget>
items: durationDropDownTitles
.mapIndexed(
(index, value) => DropdownMenuItem(
value: durationDropDownTitles[index],
child: Text(
durationDropDownTitles[index],
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
value: durationDropDownTitles[index],
),
)
.toList(),

View File

@@ -30,12 +30,13 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
final picker = ImagePicker();
final image = await picker.pickImage(source: ImageSource.camera);
cubit.setImage(image);
if (!context.mounted) return;
Navigator.of(context).pop();
},
child: Row(
children: [
Icon(Icons.photo_camera),
SizedBox(width: 8),
const Icon(Icons.photo_camera),
const SizedBox(width: 8),
Text(s.photo),
],
),
@@ -45,12 +46,13 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
final picker = ImagePicker();
final image = await picker.pickImage(source: ImageSource.gallery);
cubit.setImage(image);
if (!context.mounted) return;
Navigator.of(context).pop();
},
child: Row(
children: [
Icon(Icons.photo),
SizedBox(width: 8),
const Icon(Icons.photo),
const SizedBox(width: 8),
Text(s.gallery),
],
),
@@ -82,7 +84,7 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
color: appTheme.gray50,
),
width: MediaQuery.sizeOf(context).width,
padding: state.planData.image != null ? null : EdgeInsets.all(8),
padding: state.planData.image != null ? null : const EdgeInsets.all(8),
child: state.planData.image != null
? Padding(
padding: const EdgeInsets.only(top: 6, right: 6),
@@ -99,7 +101,7 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
color: appTheme.dividerColor,
shape: BoxShape.circle,
),
child: Icon(
child: const Icon(
Icons.close_rounded,
color: Colors.grey,
size: 16,
@@ -112,20 +114,20 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
children: [
DottedBorder(
stackFit: StackFit.expand,
dashPattern: [14, 14],
dashPattern: const [14, 14],
color: appTheme.dottedBorder,
borderType: BorderType.RRect,
radius: Radius.circular(12),
child: SizedBox.expand(),
radius: const Radius.circular(12),
child: const SizedBox.expand(),
),
Center(
child: Column(
children: [
SizedBox(
const SizedBox(
height: 48,
),
SvgPicture.asset('assets/icons/eatvio_logo.svg'),
SizedBox(
const SizedBox(
height: 24,
),
Text(

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class PlanTypeChoiceWidget extends StatefulWidget {
PlanTypeChoiceWidget({super.key});
const PlanTypeChoiceWidget({super.key});
@override
State<PlanTypeChoiceWidget> createState() => _PlanTypeChoiceWidgetState();
@@ -75,12 +75,12 @@ class _PlanTypeChoiceWidgetState extends State<PlanTypeChoiceWidget> {
height: 104,
child: Column(
children: [
SizedBox(height: 16),
const SizedBox(height: 16),
Image.asset(
choiceContent[index].$1,
height: 30,
),
SizedBox(height: 8),
const SizedBox(height: 8),
Text(
choiceContent[index].$2,
overflow: TextOverflow.clip,

View File

@@ -18,7 +18,7 @@ class _SelectExactOptionWidgetState extends State<SelectExactOptionWidget> {
builder: (context, state) {
final selectedIndex = state.selectedOptionIndex;
return Container(
padding: EdgeInsets.all(4),
padding: const EdgeInsets.all(4),
width: 140,
height: 48,
decoration: BoxDecoration(