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

@@ -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,