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

@@ -31,28 +31,28 @@ class _ComplainingBottomSheetState extends State<ComplainingBottomSheet> {
return BlocProvider(
create: (context) => sl<ComplainingCubit>()..setContentTypeAndIdentifier(contentType: widget.complainedContentType, slug: widget.slug, id: widget.id),
child: Container(
padding: EdgeInsets.only(top: 8, bottom: 24, left: 16, right: 16),
decoration: BoxDecoration(
padding: const EdgeInsets.only(top: 8, bottom: 24, left: 16, right: 16),
decoration: const BoxDecoration(
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
),
child: BlocBuilder<ComplainingCubit, ComplainingState>(
builder: (context, state) {
final category = state.category;
if (state.wasSentSuccessfully == true) {
return _ComplaintSentWidget();
return const _ComplaintSentWidget();
} else if (state.wasSentSuccessfully == false) {
return _ComplaintFailedWidget();
return const _ComplaintFailedWidget();
}
if (category != null) {
return switch (category) {
ComplainType.spam => _SpamWidget(),
ComplainType.lawViolation => _LawViolationWidget(),
ComplainType.deception => _DeceptionWidget(),
ComplainType.violenceDndHostility => _ViolenceAndHostility(),
ComplainType.explicitImage => _ExplicitImageWidget(),
ComplainType.spam => const _SpamWidget(),
ComplainType.lawViolation => const _LawViolationWidget(),
ComplainType.deception => const _DeceptionWidget(),
ComplainType.violenceDndHostility => const _ViolenceAndHostility(),
ComplainType.explicitImage => const _ExplicitImageWidget(),
};
}
return _CategoryWidget();
return const _CategoryWidget();
},
),
),
@@ -69,19 +69,19 @@ class _CategoryWidget extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.complaint,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
Text(
s.complaint_question,
textAlign: TextAlign.center,
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
SizedBox(height: 24),
const SizedBox(height: 24),
...List.generate(
categories.length,
(index) => Column(
@@ -92,11 +92,11 @@ class _CategoryWidget extends StatelessWidget {
context.read<ComplainingCubit>().setCategory(categories[index]);
},
),
if (index != categories.length - 1) SizedBox(height: 20),
if (index != categories.length - 1) const SizedBox(height: 20),
],
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
],
);
}
@@ -111,13 +111,13 @@ class _SpamWidget extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.spam,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -126,8 +126,8 @@ class _SpamWidget extends StatelessWidget {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
_ComplainButton(),
const SizedBox(height: 24),
const _ComplainButton(),
],
);
}
@@ -142,13 +142,13 @@ class _ExplicitImageWidget extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.explicitImages,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -157,8 +157,8 @@ class _ExplicitImageWidget extends StatelessWidget {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
_ComplainButton(),
const SizedBox(height: 24),
const _ComplainButton(),
],
);
}
@@ -197,13 +197,13 @@ class _LawViolationWidgetState extends State<_LawViolationWidget> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.lawViolation,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -212,7 +212,7 @@ class _LawViolationWidgetState extends State<_LawViolationWidget> {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
...tags.mapIndexed((index, element) {
return Row(
children: [
@@ -238,9 +238,9 @@ class _LawViolationWidgetState extends State<_LawViolationWidget> {
),
],
);
}).toList(),
}),
if (tags.last.$1) ...[
SizedBox(height: 12),
const SizedBox(height: 12),
CustomTextFormField(
hintText: s.type_here_your_complaint,
onChanged: (value) {
@@ -248,8 +248,8 @@ class _LawViolationWidgetState extends State<_LawViolationWidget> {
},
),
],
SizedBox(height: 20),
_ComplainButton(),
const SizedBox(height: 20),
const _ComplainButton(),
],
);
}
@@ -287,13 +287,13 @@ class _ViolenceAndHostilityState extends State<_ViolenceAndHostility> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.lawViolation,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -302,7 +302,7 @@ class _ViolenceAndHostilityState extends State<_ViolenceAndHostility> {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
...tags.mapIndexed((index, element) {
return Row(
children: [
@@ -327,9 +327,9 @@ class _ViolenceAndHostilityState extends State<_ViolenceAndHostility> {
),
],
);
}).toList(),
SizedBox(height: 20),
_ComplainButton(),
}),
const SizedBox(height: 20),
const _ComplainButton(),
],
);
}
@@ -369,13 +369,13 @@ class _DeceptionWidgetState extends State<_DeceptionWidget> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.lawViolation,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -384,7 +384,7 @@ class _DeceptionWidgetState extends State<_DeceptionWidget> {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
...tags.mapIndexed((index, element) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -406,7 +406,7 @@ class _DeceptionWidgetState extends State<_DeceptionWidget> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 8),
const SizedBox(height: 8),
Text(
element.$2,
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
@@ -422,9 +422,9 @@ class _DeceptionWidgetState extends State<_DeceptionWidget> {
),
],
);
}).toList(),
SizedBox(height: 20),
_ComplainButton(),
}),
const SizedBox(height: 20),
const _ComplainButton(),
],
);
}
@@ -439,13 +439,13 @@ class _ComplaintSentWidget extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.complaint_sent,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -454,13 +454,13 @@ class _ComplaintSentWidget extends StatelessWidget {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
CustomOutlinedButton(
text: s.ok,
height: 52,
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
onPressed: () {
@@ -481,13 +481,13 @@ class _ComplaintFailedWidget extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
BottomSheetHandlerBar(),
SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(height: 20),
Text(
s.could_not_send_complain,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 8),
const SizedBox(height: 8),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: Text(
@@ -496,13 +496,13 @@ class _ComplaintFailedWidget extends StatelessWidget {
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
),
SizedBox(height: 24),
const SizedBox(height: 24),
CustomOutlinedButton(
text: s.ok,
height: 52,
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
onPressed: () {
@@ -523,14 +523,14 @@ class _ComplainButton extends StatelessWidget {
return BlocBuilder<ComplainingCubit, ComplainingState>(
builder: (context, state) {
if (state.isLoading) {
return Loader();
return const Loader();
}
return CustomOutlinedButton(
text: s.send_complain,
height: 52,
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
onPressed: () async {
@@ -558,7 +558,7 @@ class _CategoryButton extends StatelessWidget {
category.getTranslatedText(),
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
),
Spacer(),
const Spacer(),
SvgPicture.asset('assets/icons/right_arrow.svg'),
],
),

View File

@@ -12,8 +12,7 @@ part of 'complaining_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 _$ComplainingState {
@@ -35,19 +34,17 @@ mixin _$ComplainingState {
/// @nodoc
abstract class $ComplainingStateCopyWith<$Res> {
factory $ComplainingStateCopyWith(
ComplainingState value,
$Res Function(ComplainingState) then,
) = _$ComplainingStateCopyWithImpl<$Res, ComplainingState>;
ComplainingState value, $Res Function(ComplainingState) then) =
_$ComplainingStateCopyWithImpl<$Res, ComplainingState>;
@useResult
$Res call({
bool isLoading,
bool? wasSentSuccessfully,
ComplainType? category,
ComplainedContent? contentType,
int? contentId,
String? contentSlug,
ComplainModel complainInfo,
});
$Res call(
{bool isLoading,
bool? wasSentSuccessfully,
ComplainType? category,
ComplainedContent? contentType,
int? contentId,
String? contentSlug,
ComplainModel complainInfo});
$ComplainModelCopyWith<$Res> get complainInfo;
}
@@ -75,46 +72,36 @@ class _$ComplainingStateCopyWithImpl<$Res, $Val extends ComplainingState>
Object? contentSlug = freezed,
Object? complainInfo = null,
}) {
return _then(
_value.copyWith(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
wasSentSuccessfully:
freezed == wasSentSuccessfully
? _value.wasSentSuccessfully
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
as bool?,
category:
freezed == category
? _value.category
: category // ignore: cast_nullable_to_non_nullable
as ComplainType?,
contentType:
freezed == contentType
? _value.contentType
: contentType // ignore: cast_nullable_to_non_nullable
as ComplainedContent?,
contentId:
freezed == contentId
? _value.contentId
: contentId // ignore: cast_nullable_to_non_nullable
as int?,
contentSlug:
freezed == contentSlug
? _value.contentSlug
: contentSlug // ignore: cast_nullable_to_non_nullable
as String?,
complainInfo:
null == complainInfo
? _value.complainInfo
: complainInfo // ignore: cast_nullable_to_non_nullable
as ComplainModel,
)
as $Val,
);
return _then(_value.copyWith(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
wasSentSuccessfully: freezed == wasSentSuccessfully
? _value.wasSentSuccessfully
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
as bool?,
category: freezed == category
? _value.category
: category // ignore: cast_nullable_to_non_nullable
as ComplainType?,
contentType: freezed == contentType
? _value.contentType
: contentType // ignore: cast_nullable_to_non_nullable
as ComplainedContent?,
contentId: freezed == contentId
? _value.contentId
: contentId // ignore: cast_nullable_to_non_nullable
as int?,
contentSlug: freezed == contentSlug
? _value.contentSlug
: contentSlug // ignore: cast_nullable_to_non_nullable
as String?,
complainInfo: null == complainInfo
? _value.complainInfo
: complainInfo // ignore: cast_nullable_to_non_nullable
as ComplainModel,
) as $Val);
}
/// Create a copy of ComplainingState
@@ -131,21 +118,19 @@ class _$ComplainingStateCopyWithImpl<$Res, $Val extends ComplainingState>
/// @nodoc
abstract class _$$ComplainingStateImplCopyWith<$Res>
implements $ComplainingStateCopyWith<$Res> {
factory _$$ComplainingStateImplCopyWith(
_$ComplainingStateImpl value,
$Res Function(_$ComplainingStateImpl) then,
) = __$$ComplainingStateImplCopyWithImpl<$Res>;
factory _$$ComplainingStateImplCopyWith(_$ComplainingStateImpl value,
$Res Function(_$ComplainingStateImpl) then) =
__$$ComplainingStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
bool isLoading,
bool? wasSentSuccessfully,
ComplainType? category,
ComplainedContent? contentType,
int? contentId,
String? contentSlug,
ComplainModel complainInfo,
});
$Res call(
{bool isLoading,
bool? wasSentSuccessfully,
ComplainType? category,
ComplainedContent? contentType,
int? contentId,
String? contentSlug,
ComplainModel complainInfo});
@override
$ComplainModelCopyWith<$Res> get complainInfo;
@@ -155,10 +140,9 @@ abstract class _$$ComplainingStateImplCopyWith<$Res>
class __$$ComplainingStateImplCopyWithImpl<$Res>
extends _$ComplainingStateCopyWithImpl<$Res, _$ComplainingStateImpl>
implements _$$ComplainingStateImplCopyWith<$Res> {
__$$ComplainingStateImplCopyWithImpl(
_$ComplainingStateImpl _value,
$Res Function(_$ComplainingStateImpl) _then,
) : super(_value, _then);
__$$ComplainingStateImplCopyWithImpl(_$ComplainingStateImpl _value,
$Res Function(_$ComplainingStateImpl) _then)
: super(_value, _then);
/// Create a copy of ComplainingState
/// with the given fields replaced by the non-null parameter values.
@@ -173,60 +157,50 @@ class __$$ComplainingStateImplCopyWithImpl<$Res>
Object? contentSlug = freezed,
Object? complainInfo = null,
}) {
return _then(
_$ComplainingStateImpl(
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
wasSentSuccessfully:
freezed == wasSentSuccessfully
? _value.wasSentSuccessfully
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
as bool?,
category:
freezed == category
? _value.category
: category // ignore: cast_nullable_to_non_nullable
as ComplainType?,
contentType:
freezed == contentType
? _value.contentType
: contentType // ignore: cast_nullable_to_non_nullable
as ComplainedContent?,
contentId:
freezed == contentId
? _value.contentId
: contentId // ignore: cast_nullable_to_non_nullable
as int?,
contentSlug:
freezed == contentSlug
? _value.contentSlug
: contentSlug // ignore: cast_nullable_to_non_nullable
as String?,
complainInfo:
null == complainInfo
? _value.complainInfo
: complainInfo // ignore: cast_nullable_to_non_nullable
as ComplainModel,
),
);
return _then(_$ComplainingStateImpl(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
wasSentSuccessfully: freezed == wasSentSuccessfully
? _value.wasSentSuccessfully
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
as bool?,
category: freezed == category
? _value.category
: category // ignore: cast_nullable_to_non_nullable
as ComplainType?,
contentType: freezed == contentType
? _value.contentType
: contentType // ignore: cast_nullable_to_non_nullable
as ComplainedContent?,
contentId: freezed == contentId
? _value.contentId
: contentId // ignore: cast_nullable_to_non_nullable
as int?,
contentSlug: freezed == contentSlug
? _value.contentSlug
: contentSlug // ignore: cast_nullable_to_non_nullable
as String?,
complainInfo: null == complainInfo
? _value.complainInfo
: complainInfo // ignore: cast_nullable_to_non_nullable
as ComplainModel,
));
}
}
/// @nodoc
class _$ComplainingStateImpl implements _ComplainingState {
_$ComplainingStateImpl({
this.isLoading = false,
this.wasSentSuccessfully = null,
this.category = null,
this.contentType = null,
this.contentId = null,
this.contentSlug = null,
this.complainInfo = const ComplainModel(),
});
_$ComplainingStateImpl(
{this.isLoading = false,
this.wasSentSuccessfully = null,
this.category = null,
this.contentType = null,
this.contentId = null,
this.contentSlug = null,
this.complainInfo = const ComplainModel()});
@override
@JsonKey()
@@ -277,16 +251,8 @@ class _$ComplainingStateImpl implements _ComplainingState {
}
@override
int get hashCode => Object.hash(
runtimeType,
isLoading,
wasSentSuccessfully,
category,
contentType,
contentId,
contentSlug,
complainInfo,
);
int get hashCode => Object.hash(runtimeType, isLoading, wasSentSuccessfully,
category, contentType, contentId, contentSlug, complainInfo);
/// Create a copy of ComplainingState
/// with the given fields replaced by the non-null parameter values.
@@ -295,21 +261,18 @@ class _$ComplainingStateImpl implements _ComplainingState {
@pragma('vm:prefer-inline')
_$$ComplainingStateImplCopyWith<_$ComplainingStateImpl> get copyWith =>
__$$ComplainingStateImplCopyWithImpl<_$ComplainingStateImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _ComplainingState implements ComplainingState {
factory _ComplainingState({
final bool isLoading,
final bool? wasSentSuccessfully,
final ComplainType? category,
final ComplainedContent? contentType,
final int? contentId,
final String? contentSlug,
final ComplainModel complainInfo,
}) = _$ComplainingStateImpl;
factory _ComplainingState(
{final bool isLoading,
final bool? wasSentSuccessfully,
final ComplainType? category,
final ComplainedContent? contentType,
final int? contentId,
final String? contentSlug,
final ComplainModel complainInfo}) = _$ComplainingStateImpl;
@override
bool get isLoading;