trailing comma rule added

This commit is contained in:
Username1548
2024-11-12 19:05:30 +07:00
parent c5e1c5d9b8
commit 4d8f6464d7
43 changed files with 1923 additions and 459 deletions

View File

@@ -70,10 +70,10 @@ class AuthorCard extends StatelessWidget {
fontSize: 16,
fontWeight: FontWeight.w500,
),
)
])
),
],),
],
)
),
],
),
),
@@ -99,7 +99,7 @@ class AuthorCard extends StatelessWidget {
),
),
),
)
),
],
),
);

View File

@@ -0,0 +1,90 @@
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
class CalendarWidget extends StatefulWidget {
const CalendarWidget({super.key});
@override
State<CalendarWidget> createState() => _CalendarWidgetState();
}
class _CalendarWidgetState extends State<CalendarWidget> {
CalendarFormat _calendarFormat = CalendarFormat.month;
DateTime _focusedDay = DateTime.now();
DateTime? _selectedDay = DateTime.now();
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.only(top: 5),
child: TableCalendar(
firstDay: DateTime.utc(2010, 10, 16),
lastDay: DateTime.utc(2030, 3, 14),
locale: 'ru_RU',
startingDayOfWeek: StartingDayOfWeek.monday,
focusedDay: _focusedDay,
rangeStartDay: _selectedDay,
rangeEndDay: _selectedDay?.add(const Duration(days: 6)),
calendarFormat: _calendarFormat,
headerStyle: HeaderStyle(
titleCentered: true,
formatButtonVisible: false,
leftChevronVisible: false,
rightChevronVisible: false,
),
rowHeight: 40,
selectedDayPredicate: (day) {
return isSameDay(_selectedDay, day);
},
onDaySelected: (selectedDay, focusedDay) {
if (!isSameDay(_selectedDay, selectedDay)) {
setState(() {
_selectedDay = selectedDay;
_focusedDay = focusedDay;
});
}
},
onFormatChanged: (format) {
if (_calendarFormat != format) {
setState(() {
_calendarFormat = format;
});
}
},
onPageChanged: (focusedDay) {
_focusedDay = focusedDay;
},
calendarStyle: CalendarStyle(
weekendDecoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
defaultDecoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
selectedDecoration: BoxDecoration(
color: appTheme.blueA400,
shape: BoxShape.circle,
),
todayTextStyle: TextStyle(
color: Colors.black,
),
todayDecoration: BoxDecoration(
border: Border.all(
color: appTheme.blueA400,
width: 2,
),
color: Colors.white,
shape: BoxShape.circle,
),
),
),
),
],
);
}
}

View File

@@ -39,8 +39,8 @@ class CpfcContainer extends StatelessWidget {
Text('$carbohydrates', style: TextStyle(color: appTheme.blueGray800, fontSize: 16, fontWeight: FontWeight.w600)),
Text(s.carbohydrates, style: TextStyle(color: appTheme.blueGray800, fontSize: 12, fontWeight: FontWeight.w500)),
],
)
]),
),
],),
);
}
}

View File

@@ -14,7 +14,7 @@ class InfoBouble extends StatelessWidget {
color: backgroundColor ?? appTheme.gray50,
borderRadius: BorderRadius.circular(radius),
),
child: Row(children: children),
child: Row(mainAxisSize: MainAxisSize.min, children: children),
);
}
}

View File

@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class MainBackgroundBouble extends StatelessWidget {
const MainBackgroundBouble(
{super.key, required this.child, this.width, this.padding, this.enableShadow = false});
{super.key, required this.child, this.width, this.padding, this.enableShadow = false,});
final double? width;
final Widget child;
final bool enableShadow;
@@ -21,7 +21,7 @@ class MainBackgroundBouble extends StatelessWidget {
offset: Offset(0, 0),
),
]
: null),
: null,),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Container(

View File

@@ -7,6 +7,7 @@ import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:share_plus/share_plus.dart';
class MoreOptions extends StatelessWidget {
@@ -72,7 +73,9 @@ class MoreOptions extends StatelessWidget {
child: CustomDivider(),
),
GestureDetector(
onTap: () {},
onTap: () {
context.push('complainingScreen');
},
child: Row(
children: [
Text(
@@ -87,10 +90,10 @@ class MoreOptions extends StatelessWidget {
SvgPicture.asset('assets/icons/complain.svg', width: 16, height: 20),
],
),
)
),
],
),
),
width: 272);
width: 272,);
}
}

View File

@@ -0,0 +1,56 @@
import 'package:eatvio_app/features/diets/presentation/widgets/calendar_widget.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
import 'package:flutter/material.dart';
class StartDietBottomSheet extends StatelessWidget {
const StartDietBottomSheet({super.key});
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 5),
Container(
height: 4,
width: 40,
decoration: BoxDecoration(color: appTheme.lightGrey, borderRadius: BorderRadius.circular(20)),
),
SizedBox(height: 22),
Text(s.startDiet,
style: TextStyle(
color: appTheme.blueGray800,
fontSize: 20,
fontWeight: FontWeight.w600,
),),
SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Text(s.choose_start_diet_date,
textAlign: TextAlign.center,
style: TextStyle(
color: appTheme.blueGray800,
fontSize: 16,
fontWeight: FontWeight.w500,
),),
),
CalendarWidget(),
Padding(
padding: EdgeInsets.only(left: 16, right: 16, top: 20, bottom: 25),
child: CustomOutlinedButton(
height: 52,
text: s.continue_,
buttonStyle: ButtonStyle(
textStyle: WidgetStatePropertyAll(TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600)),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
side: WidgetStatePropertyAll(BorderSide.none),
),
),
),
],
);
}
}

View File

@@ -29,7 +29,7 @@ class _TypeBadgesState extends State<TypeBadges> {
title: s.alko_type,
description: s.alko_type_desc,
)
));
),);
}
if (widget.type.veg == true) {
badgeSource.add((
@@ -40,7 +40,7 @@ class _TypeBadgesState extends State<TypeBadges> {
title: s.vegan_type,
description: s.vegan_type_desc,
)
));
),);
}
if (widget.type.corb == true) {
badgeSource.add((
@@ -51,7 +51,7 @@ class _TypeBadgesState extends State<TypeBadges> {
title: s.corb_type,
description: s.corb_type_desc,
)
));
),);
}
if (widget.type.meat == true) {
badgeSource.add((
@@ -62,7 +62,7 @@ class _TypeBadgesState extends State<TypeBadges> {
title: s.meat_type,
description: s.meat_type_desc,
)
));
),);
}
return Row(
children: List.generate(
@@ -117,7 +117,7 @@ class _TypeBadgesState extends State<TypeBadges> {
}
class _InfoOverlayEntry extends StatelessWidget {
const _InfoOverlayEntry({super.key, required this.title, required this.description, required this.assetPath, required this.onClose});
const _InfoOverlayEntry({required this.title, required this.description, required this.assetPath, required this.onClose});
final String title;
final String description;
final assetPath;