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'),
],
),