forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -54,13 +54,13 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
MainBackgroundBouble(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
s.label,
|
||||
textAlign: TextAlign.center,
|
||||
@@ -68,7 +68,7 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
softWrap: true,
|
||||
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
const SizedBox(height: 4),
|
||||
CustomTextFormField(
|
||||
hintText: s.plan_label_desc,
|
||||
onChanged: (value) {
|
||||
@@ -76,7 +76,7 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
},
|
||||
maxLength: 150,
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
s.plan_duration,
|
||||
textAlign: TextAlign.center,
|
||||
@@ -84,13 +84,13 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
softWrap: true,
|
||||
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
PlanDurationDropDownWidget(),
|
||||
SizedBox(height: 20),
|
||||
PlanImagePickerWidget(),
|
||||
SizedBox(height: 16),
|
||||
PlanTypeChoiceWidget(),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 4),
|
||||
const PlanDurationDropDownWidget(),
|
||||
const SizedBox(height: 20),
|
||||
const PlanImagePickerWidget(),
|
||||
const SizedBox(height: 16),
|
||||
const PlanTypeChoiceWidget(),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
s.plan_desc,
|
||||
textAlign: TextAlign.center,
|
||||
@@ -98,7 +98,7 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
softWrap: true,
|
||||
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
const SizedBox(height: 4),
|
||||
SizedBox(
|
||||
height: 132,
|
||||
child: CustomTextFormField(
|
||||
@@ -113,11 +113,11 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
child: Text(
|
||||
@@ -128,14 +128,14 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.blueGray400),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
OptionsCountButton(),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 8),
|
||||
const OptionsCountButton(),
|
||||
const SizedBox(height: 20),
|
||||
BlocBuilder<CreatePlanCubit, CreatePlanState>(
|
||||
buildWhen: (previous, current) => previous.selectedOptionIndex != current.selectedOptionIndex,
|
||||
builder: (context, state) {
|
||||
if (state.selectedOptionIndex == null) {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
@@ -146,9 +146,9 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
OptionWidget(),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 8),
|
||||
const OptionWidget(),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Column(
|
||||
@@ -159,29 +159,29 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.gray),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.dottedBorder),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
CustomOutlinedButton(
|
||||
onPressed: () async {},
|
||||
text: s.preview,
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.gray),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.dottedBorder),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
CustomOutlinedButton(
|
||||
onPressed: () {},
|
||||
text: s.publish,
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
@@ -194,10 +194,10 @@ class CreatePlanScreenContent extends StatelessWidget {
|
||||
BlocBuilder<CreatePlanCubit, CreatePlanState>(
|
||||
builder: (context, state) {
|
||||
if (state.selectedOptionIndex == null) {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24.0),
|
||||
return const Padding(
|
||||
padding: EdgeInsets.only(bottom: 24.0),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SelectExactOptionWidget(),
|
||||
|
||||
@@ -12,8 +12,7 @@ part of 'create_plan_state.dart';
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||
);
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreatePlanState {
|
||||
@@ -33,17 +32,15 @@ mixin _$CreatePlanState {
|
||||
/// @nodoc
|
||||
abstract class $CreatePlanStateCopyWith<$Res> {
|
||||
factory $CreatePlanStateCopyWith(
|
||||
CreatePlanState value,
|
||||
$Res Function(CreatePlanState) then,
|
||||
) = _$CreatePlanStateCopyWithImpl<$Res, CreatePlanState>;
|
||||
CreatePlanState value, $Res Function(CreatePlanState) then) =
|
||||
_$CreatePlanStateCopyWithImpl<$Res, CreatePlanState>;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex,
|
||||
});
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex});
|
||||
|
||||
$CreatePlanModelCopyWith<$Res> get planData;
|
||||
}
|
||||
@@ -69,36 +66,28 @@ class _$CreatePlanStateCopyWithImpl<$Res, $Val extends CreatePlanState>
|
||||
Object? durationIndex = freezed,
|
||||
Object? selectedOptionIndex = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
isLoading:
|
||||
null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage:
|
||||
freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData:
|
||||
null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex:
|
||||
freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex:
|
||||
freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData: null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex: freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
@@ -115,19 +104,17 @@ class _$CreatePlanStateCopyWithImpl<$Res, $Val extends CreatePlanState>
|
||||
/// @nodoc
|
||||
abstract class _$$CreatePlanStateImplCopyWith<$Res>
|
||||
implements $CreatePlanStateCopyWith<$Res> {
|
||||
factory _$$CreatePlanStateImplCopyWith(
|
||||
_$CreatePlanStateImpl value,
|
||||
$Res Function(_$CreatePlanStateImpl) then,
|
||||
) = __$$CreatePlanStateImplCopyWithImpl<$Res>;
|
||||
factory _$$CreatePlanStateImplCopyWith(_$CreatePlanStateImpl value,
|
||||
$Res Function(_$CreatePlanStateImpl) then) =
|
||||
__$$CreatePlanStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({
|
||||
bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex,
|
||||
});
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex});
|
||||
|
||||
@override
|
||||
$CreatePlanModelCopyWith<$Res> get planData;
|
||||
@@ -138,9 +125,8 @@ class __$$CreatePlanStateImplCopyWithImpl<$Res>
|
||||
extends _$CreatePlanStateCopyWithImpl<$Res, _$CreatePlanStateImpl>
|
||||
implements _$$CreatePlanStateImplCopyWith<$Res> {
|
||||
__$$CreatePlanStateImplCopyWithImpl(
|
||||
_$CreatePlanStateImpl _value,
|
||||
$Res Function(_$CreatePlanStateImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$CreatePlanStateImpl _value, $Res Function(_$CreatePlanStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -153,48 +139,40 @@ class __$$CreatePlanStateImplCopyWithImpl<$Res>
|
||||
Object? durationIndex = freezed,
|
||||
Object? selectedOptionIndex = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_$CreatePlanStateImpl(
|
||||
isLoading:
|
||||
null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage:
|
||||
freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData:
|
||||
null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex:
|
||||
freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex:
|
||||
freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
),
|
||||
);
|
||||
return _then(_$CreatePlanStateImpl(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData: null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex: freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreatePlanStateImpl implements _CreatePlanState {
|
||||
const _$CreatePlanStateImpl({
|
||||
required this.isLoading,
|
||||
required this.errorMessage,
|
||||
required this.planData,
|
||||
this.durationIndex,
|
||||
this.selectedOptionIndex,
|
||||
});
|
||||
const _$CreatePlanStateImpl(
|
||||
{required this.isLoading,
|
||||
required this.errorMessage,
|
||||
required this.planData,
|
||||
this.durationIndex,
|
||||
this.selectedOptionIndex});
|
||||
|
||||
@override
|
||||
final bool isLoading;
|
||||
@@ -230,14 +208,8 @@ class _$CreatePlanStateImpl implements _CreatePlanState {
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
isLoading,
|
||||
errorMessage,
|
||||
planData,
|
||||
durationIndex,
|
||||
selectedOptionIndex,
|
||||
);
|
||||
int get hashCode => Object.hash(runtimeType, isLoading, errorMessage,
|
||||
planData, durationIndex, selectedOptionIndex);
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -246,19 +218,16 @@ class _$CreatePlanStateImpl implements _CreatePlanState {
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreatePlanStateImplCopyWith<_$CreatePlanStateImpl> get copyWith =>
|
||||
__$$CreatePlanStateImplCopyWithImpl<_$CreatePlanStateImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreatePlanState implements CreatePlanState {
|
||||
const factory _CreatePlanState({
|
||||
required final bool isLoading,
|
||||
required final String? errorMessage,
|
||||
required final CreatePlanModel planData,
|
||||
final int? durationIndex,
|
||||
final int? selectedOptionIndex,
|
||||
}) = _$CreatePlanStateImpl;
|
||||
const factory _CreatePlanState(
|
||||
{required final bool isLoading,
|
||||
required final String? errorMessage,
|
||||
required final CreatePlanModel planData,
|
||||
final int? durationIndex,
|
||||
final int? selectedOptionIndex}) = _$CreatePlanStateImpl;
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user