forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -15,11 +15,11 @@ class DietDeletedBottomSheet extends StatelessWidget {
|
||||
final s = S.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
BottomSheetHandlerBar(),
|
||||
SizedBox(
|
||||
const BottomSheetHandlerBar(),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
@@ -30,7 +30,7 @@ class DietDeletedBottomSheet extends StatelessWidget {
|
||||
s.deleted,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Padding(
|
||||
@@ -43,12 +43,12 @@ class DietDeletedBottomSheet extends StatelessWidget {
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -16,11 +16,11 @@ class DietDraftedBottomSheet extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
BottomSheetHandlerBar(),
|
||||
SizedBox(
|
||||
const BottomSheetHandlerBar(),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
@@ -32,7 +32,7 @@ class DietDraftedBottomSheet extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Padding(
|
||||
@@ -45,12 +45,12 @@ class DietDraftedBottomSheet extends StatelessWidget {
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -51,9 +51,9 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
InkWell(
|
||||
onTap: () => GoRouter.of(context).pushNamed('aboutDietScreen', extra: {'diet': widget.diet, 'navigateToComments': false}),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: baseUrl + '/storage/' + widget.diet.image,
|
||||
imageUrl: '$baseUrl/storage/${widget.diet.image}',
|
||||
fit: BoxFit.fitWidth,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
),
|
||||
@@ -68,7 +68,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -80,13 +80,13 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
),
|
||||
),
|
||||
if (widget.diet.details.isNotEmpty) ...[
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Html(
|
||||
data: widget.diet.details.length > 200 ? widget.diet.details.substring(0, 200) + '...' : widget.diet.details,
|
||||
data: widget.diet.details.length > 200 ? '${widget.diet.details.substring(0, 200)}...' : widget.diet.details,
|
||||
style: {
|
||||
"*": Style(
|
||||
margin: Margins.zero,
|
||||
@@ -100,7 +100,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
],
|
||||
],
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
BlocBuilder<MyDietsCubit, MyDietsState>(
|
||||
builder: (context, state) {
|
||||
return Padding(
|
||||
@@ -115,9 +115,10 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
if (state.selectedStateIndex == 1) {
|
||||
final result = await context.read<MyDietsCubit>().publishDiet(widget.diet.id);
|
||||
if (result) {
|
||||
if (!context.mounted) return;
|
||||
showBottomSheetWithBlur(
|
||||
context: context,
|
||||
child: SuccessPublishedDietBottomSheet(title: '${widget.diet.name}'),
|
||||
child: SuccessPublishedDietBottomSheet(title: widget.diet.name),
|
||||
);
|
||||
await context.read<MyDietsCubit>().loadAllDiets();
|
||||
} else {
|
||||
@@ -138,18 +139,18 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
buttonStyle: ButtonStyle(
|
||||
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (state.selectedStateIndex == 0) ...[
|
||||
SizedBox(width: 6),
|
||||
const SizedBox(width: 6),
|
||||
CustomOutlinedButton(
|
||||
onPressed: () async {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
await Share.shareUri(
|
||||
Uri.parse(
|
||||
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
|
||||
'$baseUrl/ru/diet/${widget.diet.id}',
|
||||
),
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
@@ -166,14 +167,14 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
buttonStyle: ButtonStyle(
|
||||
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
),
|
||||
text: '',
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -182,10 +183,11 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
if (state.selectedStateIndex == 0) {
|
||||
final result = await context.read<MyDietsCubit>().unpublishDiet(widget.diet.id);
|
||||
if (result) {
|
||||
if (!context.mounted) return;
|
||||
showBottomSheetWithBlur(
|
||||
context: context,
|
||||
height: 250,
|
||||
child: DietDraftedBottomSheet(title: '${widget.diet.name}'),
|
||||
child: DietDraftedBottomSheet(title: widget.diet.name),
|
||||
);
|
||||
await context.read<MyDietsCubit>().loadAllDiets();
|
||||
} else {
|
||||
@@ -204,15 +206,16 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
buttonStyle: ButtonStyle(
|
||||
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.lightGray0),
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 6),
|
||||
const SizedBox(width: 6),
|
||||
CustomOutlinedButton(
|
||||
onPressed: () async {
|
||||
final result = await context.read<MyDietsCubit>().deleteDiet(widget.diet.id);
|
||||
if (result) {
|
||||
if (!context.mounted) return;
|
||||
showBottomSheetWithBlur(
|
||||
context: context,
|
||||
child: DietDeletedBottomSheet(title: widget.diet.name),
|
||||
@@ -231,13 +234,13 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
||||
buttonStyle: ButtonStyle(
|
||||
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.lightGray0),
|
||||
side: WidgetStatePropertyAll(BorderSide.none),
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
),
|
||||
text: '',
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user