fix: fixed analyzer issues and merge conflicts

This commit is contained in:
Username1548
2025-07-02 19:01:37 +07:00
parent d42604dc87
commit e80b660210
85 changed files with 276 additions and 272 deletions

View File

@@ -20,12 +20,12 @@ abstract class CredentialsStorage {
};
}
static saveCredentials(String email, String password) async {
static Future<void> saveCredentials(String email, String password) async {
await const FlutterSecureStorage().write(key: 'email', value: email);
await const FlutterSecureStorage().write(key: 'password', value: password);
}
static removeCredentials() async {
static Future<void> removeCredentials() async {
await const FlutterSecureStorage().delete(key: 'email');
await const FlutterSecureStorage().delete(key: 'password');
}

View File

@@ -7,162 +7,162 @@ import 'package:flutter/material.dart';
class CustomTextStyles {
// Headline style
static get headlineSmallMulish => theme.textTheme.headlineSmall!.mulish;
static TextStyle get headlineSmallMulish => theme.textTheme.headlineSmall!.mulish;
// Title text style
static get titleMediumSegoeUI => theme.textTheme.titleMedium!.segoeUI.copyWith(
static TextStyle get titleMediumSegoeUI => theme.textTheme.titleMedium!.segoeUI.copyWith(
fontWeight: FontWeight.w600,
);
static get bodyMediumBlack900 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumBlack900 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.black900,
);
static get bodyMediumBlack90013 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumBlack90013 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.black900,
fontSize: 13,
);
static get bodyMediumBluegray800 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumBluegray800 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.black,
);
static get bodyMediumBluegray800_1 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumBluegray800_1 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.black,
);
static get bodyMediumBluegray800_2 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumBluegray800_2 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.black,
);
static get bodyMediumWhiteA700 => theme.textTheme.bodyMedium!.copyWith(
static TextStyle get bodyMediumWhiteA700 => theme.textTheme.bodyMedium!.copyWith(
color: appTheme.whiteA700,
);
static get bodySmallMulishBlack900 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishBlack900 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.black900,
fontSize: 12,
);
static get bodySmallMulishBluegray800 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishBluegray800 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.black,
fontSize: 12,
);
static get bodySmallMulishBluegray80012 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishBluegray80012 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.black,
fontSize: 12,
);
static get bodySmallMulishBluegray80012_1 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishBluegray80012_1 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.black,
fontSize: 12,
);
static get bodySmallMulishBluegray900 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishBluegray900 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.blueGray900,
fontSize: 12,
);
static get bodySmallMulishGray600 => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishGray600 => theme.textTheme.bodySmall!.mulish.copyWith(
color: appTheme.gray600,
);
static get bodySmallMulishPrimary => theme.textTheme.bodySmall!.mulish.copyWith(
static TextStyle get bodySmallMulishPrimary => theme.textTheme.bodySmall!.mulish.copyWith(
color: theme.colorScheme.primary,
fontSize: 12,
);
static get bodySmallSegoeUIBlack900 => theme.textTheme.bodySmall!.segoeUI.copyWith(
static TextStyle get bodySmallSegoeUIBlack900 => theme.textTheme.bodySmall!.segoeUI.copyWith(
color: appTheme.black900,
fontSize: 12,
);
// Label text style
static get labelLargeGray60003 => theme.textTheme.labelLarge!.copyWith(
static TextStyle get labelLargeGray60003 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.gray60003,
);
static get labelLargeWhiteA700 => theme.textTheme.labelLarge!.copyWith(
static TextStyle get labelLargeWhiteA700 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.whiteA700,
);
// Title text style
static get titleMedium16 => theme.textTheme.titleMedium!.copyWith(
static TextStyle get titleMedium16 => theme.textTheme.titleMedium!.copyWith(
fontSize: 16,
);
static get titleMediumBlack => theme.textTheme.titleMedium!.copyWith(
static TextStyle get titleMediumBlack => theme.textTheme.titleMedium!.copyWith(
fontSize: 17,
fontWeight: FontWeight.w900,
);
static get titleMediumBlack900 => theme.textTheme.titleMedium!.copyWith(
static TextStyle get titleMediumBlack900 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.black900,
);
static get titleMediumSemiBold => theme.textTheme.titleMedium!.copyWith(
static TextStyle get titleMediumSemiBold => theme.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w600,
);
static get titleMediumWhiteA700 => theme.textTheme.titleMedium!.copyWith(
static TextStyle get titleMediumWhiteA700 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.whiteA700,
fontWeight: FontWeight.w600,
);
static get titleSmallBlue800 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallBlue800 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.blue800,
fontWeight: FontWeight.w800,
);
static get titleSmallBluegray800 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallBluegray800 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.black,
);
static get titleSmallBluegray800Bold => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallBluegray800Bold => theme.textTheme.titleSmall!.copyWith(
color: appTheme.black,
fontWeight: FontWeight.w700,
);
static get titleSmallBluegray800ExtraBold => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallBluegray800ExtraBold => theme.textTheme.titleSmall!.copyWith(
color: appTheme.black,
fontWeight: FontWeight.w800,
);
static get titleSmallBold => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallBold => theme.textTheme.titleSmall!.copyWith(
fontSize: 15,
fontWeight: FontWeight.w700,
);
static get titleSmallGreenA70001 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallGreenA70001 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.greenA70001,
);
static get titleSmallGreenA70001ExtraBold => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallGreenA70001ExtraBold => theme.textTheme.titleSmall!.copyWith(
color: appTheme.greenA70001,
fontWeight: FontWeight.w800,
);
static get titleSmallLightgreen300 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallLightgreen300 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.lightGreen300,
fontWeight: FontWeight.w800,
);
static get titleSmallRed200 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallRed200 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.red200,
fontWeight: FontWeight.w800,
);
static get titleSmallSecondaryContainer => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallSecondaryContainer => theme.textTheme.titleSmall!.copyWith(
color: theme.colorScheme.secondaryContainer,
fontWeight: FontWeight.w800,
);
static get titleSmallSecondaryContainer_1 => theme.textTheme.titleSmall!.copyWith(
static TextStyle get titleSmallSecondaryContainer_1 => theme.textTheme.titleSmall!.copyWith(
color: theme.colorScheme.secondaryContainer,
);
static get titleSmallSegoeUIOnPrimary => theme.textTheme.titleSmall!.segoeUI.copyWith(
static TextStyle get titleSmallSegoeUIOnPrimary => theme.textTheme.titleSmall!.segoeUI.copyWith(
color: theme.colorScheme.onPrimary,
);
}

View File

@@ -15,7 +15,7 @@ abstract class TokenStorage {
static Future<String?> getTokenFromStorage() async => await const FlutterSecureStorage().read(key: 'token');
static saveTokenInStorage(String token) async {
static Future<void> saveTokenInStorage(String token) async {
await const FlutterSecureStorage().write(key: 'token', value: token);
}

View File

@@ -56,7 +56,7 @@ class CustomDropDown extends StatelessWidget {
: _buildDropDownWidget(context);
}
_buildDropDownWidget(BuildContext context) {
DropdownButtonFormField<SelectionPopupModel> _buildDropDownWidget(BuildContext context) {
return DropdownButtonFormField<SelectionPopupModel>(
focusNode: focusNode ?? FocusNode(),
icon: const Icon(Icons.keyboard_arrow_down_rounded),
@@ -84,7 +84,7 @@ class CustomDropDown extends StatelessWidget {
);
}
void onDropDownChanged(value) {
void onDropDownChanged(dynamic value) {
onChanged!(value!);
}

View File

@@ -76,7 +76,7 @@ class CustomPopup extends StatelessWidget {
);
}
List<PopupMenuEntry> _buildMenuItems(s, context) {
List<PopupMenuEntry> _buildMenuItems(S s,BuildContext context) {
final entries = <PopupMenuEntry>[];
void addItem(String icon, String text, Function() onTap) {
@@ -110,28 +110,28 @@ class CustomPopup extends StatelessWidget {
addItem('assets/icons/red_trash.svg', 'Удалить', () async {
if (complainedContentType == ComplainedContent.posts) {
final result = await sl<BlogPostCreateCubit>().deleteBlogPost(id!);
if (!result) {
if (!result && context.mounted) {
showErrorDialog(context, title: S.current.could_not_delete_blog_post);
return;
}
showSuccessToast('Пост удален, обновите ленту');
} else if (complainedContentType == ComplainedContent.recipe) {
final result = await sl<RecipesCubit>().deleteRecipe(slug!);
if (!result) {
if (!result && context.mounted) {
showErrorDialog(context, title: 'Не удалось удалить рецепт');
return;
}
showSuccessToast('Рецепт удален, обновите ленту');
} else if (complainedContentType == ComplainedContent.diet) {
final result = await sl<DietsCubit>().deleteDiet(id!);
if (!result) {
if (!result && context.mounted) {
showErrorDialog(context, title: 'Не удалось удалить диету');
return;
}
showSuccessToast('Диета удалена, обновите ленту');
} else if (complainedContentType == ComplainedContent.plan) {
final result = await sl<MyPlansCubit>().deletePlan(slug!);
if (!result) {
if (!result && context.mounted) {
showErrorDialog(context, title: 'Не удалось удалить план');
return;
}

View File

@@ -7,7 +7,7 @@ class ResetPasswordCubit extends Cubit<ResetPasswordState> {
ResetPasswordCubit({required this.resetPasswordRepository}) : super(const ResetPasswordState.empty());
trySendEmailCode(String email) async {
Future<void> trySendEmailCode(String email) async {
emit(const ResetPasswordState.loadingSendEmailCode());
try {
if (await resetPasswordRepository.sendEmailCodeForPasswordChange(email)) {
@@ -20,7 +20,7 @@ class ResetPasswordCubit extends Cubit<ResetPasswordState> {
}
}
tryResetPassword(String email, String code, String password, String passwordConfirmation) async {
Future<void> tryResetPassword(String email, String code, String password, String passwordConfirmation) async {
emit(const ResetPasswordState.loadingResetPassword());
try {
if (await resetPasswordRepository.confirmPasswordChange(code, password, passwordConfirmation, email)) {

View File

@@ -319,7 +319,7 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
);
}
_iconButton({required IconData icon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) {
InkWell _iconButton({required IconData icon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) {
return InkWell(
onTap: onTap ?? () {},
borderRadius: BorderRadius.circular(16),

View File

@@ -80,7 +80,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
);
}
_showImagePicker() {
void _showImagePicker() {
showCupertinoModalPopup<void>(
context: context,
builder: (context) {
@@ -145,7 +145,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
);
}
_buildBlogPostCreate(BuildContext context) {
Scaffold _buildBlogPostCreate(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(),
@@ -253,7 +253,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
);
}
_buildAddPhoto() {
GestureDetector _buildAddPhoto() {
return GestureDetector(
onTap: () {
_showImagePicker();

View File

@@ -6,7 +6,7 @@ class NewMessagesCubit extends Cubit<NewMessagesState> {
NewMessagesCubit() : super(const NewMessagesState.empty());
incrementCounter() {
void incrementCounter() {
_messagesCount++;
emit(NewMessagesState.loaded(messagesCount: _messagesCount));
}

View File

@@ -11,7 +11,7 @@ class ProfileAvatarCubit extends Cubit<ProfileAvatarState> {
required this.profileRepository,
}) : super(const ProfileAvatarState.loading());
getMyProfile() async {
Future<void> getMyProfile() async {
emit(const ProfileAvatarState.loading());
try {
emit(

View File

@@ -7,7 +7,7 @@ class CalendarCubit extends Cubit<CalendarState> {
CalendarCubit({required this.calendarRepository}) : super(const CalendarState.loading());
loadCalendarList() async {
Future<void> loadCalendarList() async {
emit(const CalendarState.loading());
try {
final calendarList = await calendarRepository.getCalendar();

View File

@@ -89,7 +89,7 @@ class CalendarScreen extends StatelessWidget {
);
}
_buildCalendarBody(BuildContext context, CalendarStateLoaded state) {
ListView _buildCalendarBody(BuildContext context, CalendarStateLoaded state) {
return ListView.separated(
padding: const EdgeInsets.all(8),
shrinkWrap: true,

View File

@@ -47,7 +47,7 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
_timer?.cancel();
}
loadNextPage(String chatId) async {
Future<void> loadNextPage(String chatId) async {
if (currentPage < lastPage && !isLoading) {
isLoading = true;
@@ -89,7 +89,7 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
}
}
initChat(String chatId, {bool sendInitialMessage = false}) async {
Future<void> initChat(String chatId, {bool sendInitialMessage = false}) async {
try {
final chatRoom = await chatRepository.getChatRoom(chatId);
ChosenPlanModel? chosenPlan;

View File

@@ -69,7 +69,7 @@ class _ChatScreenState extends State<ChatScreen> {
_listener = AppLifecycleListener(onHide: _onHide, onResume: _onResume);
}
_onScroll() {
void _onScroll() {
if (scrollController.offset >= scrollController.position.maxScrollExtent && !scrollController.position.outOfRange) {
chatRoomCubit.loadNextPage(widget.chatId);
}
@@ -102,7 +102,7 @@ class _ChatScreenState extends State<ChatScreen> {
);
}
_buildChat(BuildContext context, ChatRoomStateLoaded state) {
Scaffold _buildChat(BuildContext context, ChatRoomStateLoaded state) {
final chosenPlan = state.chatRoom.chosenPlan;
final amIConsultant = chosenPlan?.consultantId == state.chatRoom.users.sender.id;
final showUserDetailsButton = [
@@ -560,7 +560,7 @@ class _ChatScreenState extends State<ChatScreen> {
return 0;
}
showImagePicker(String slug) {
void showImagePicker(String slug) {
showCupertinoModalPopup<void>(
context: context,
builder: (context) => CupertinoActionSheet(
@@ -661,7 +661,7 @@ class _ChatScreenState extends State<ChatScreen> {
);
}
_messageDate(DateTime date) {
Center _messageDate(DateTime date) {
return Center(
child: Padding(
padding: const EdgeInsets.only(top: 32),

View File

@@ -83,7 +83,7 @@ class _ChatsScreenState extends State<ChatsScreen> {
);
}
_buildChatList(BuildContext context, ChatsState state) {
NotificationListener<ScrollNotification> _buildChatList(BuildContext context, ChatsState state) {
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
loadNewContent(notification, context.read<ChatsCubit>().loadMoreChatRooms);

View File

@@ -167,7 +167,7 @@ class _EmptyChatScreenState extends State<EmptyChatScreen> {
);
}
showImagePicker(String slug) {
void showImagePicker(String slug) {
showCupertinoModalPopup<void>(
context: context,
builder: (context) => CupertinoActionSheet(

View File

@@ -78,7 +78,7 @@ class ChatSearchBarWidget extends StatelessWidget {
return searchViewWidget(context);
}
searchViewWidget(BuildContext context) => SizedBox(
SizedBox searchViewWidget(BuildContext context) => SizedBox(
width: width ?? MediaQuery.of(context).size.width,
child: TextFormField(
textCapitalization: TextCapitalization.sentences,

View File

@@ -37,7 +37,7 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
}
}
getMyRequestStatus(String slug) async {
Future<void> getMyRequestStatus(String slug) async {
_update = true;
final myRequestStatus = await consultantRepository.getMyRequestStatus(slug);
@@ -81,11 +81,11 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
);
}
disableLoading() {
void disableLoading() {
emit(state.copyWith(loading: false));
}
updateConsultantProfileModel(ConsultantProfileModel consultant, [bool acceptOffer = false]) {
void updateConsultantProfileModel(ConsultantProfileModel consultant, [bool acceptOffer = false]) {
emit(
state.copyWith(
consultant: consultant,
@@ -95,7 +95,7 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
);
}
registerConsultant() async {
Future<void> registerConsultant() async {
if (state.consultant.photos != null) {
updateConsultantProfileModel(
state.consultant.copyWith(

View File

@@ -76,7 +76,7 @@ class _AdditionalSettingsScreenState extends State<AdditionalSettingsScreen> {
);
}
_tile({
ListTile _tile({
required String title,
required Function() onTap,
required bool value,
@@ -102,7 +102,7 @@ class _AdditionalSettingsScreenState extends State<AdditionalSettingsScreen> {
);
}
_divider(BuildContext context) {
Center _divider(BuildContext context) {
return Center(
child: Container(
height: 0.4,

View File

@@ -35,7 +35,7 @@ class _BecomeConsultantScreenState extends State<BecomeConsultantScreen> {
);
}
_startRegistrationButton() {
InkWell _startRegistrationButton() {
return InkWell(
onTap: () => GoRouter.of(context).pushReplacementNamed('stepperBecomeConsultantScreen'),
borderRadius: BorderRadius.circular(20),

View File

@@ -82,7 +82,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
);
}
_divider(BuildContext context) {
Container _divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,
@@ -93,7 +93,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
);
}
_diplomaInfo({
Column _diplomaInfo({
required DiplomaEntity diploma,
}) {
return Column(
@@ -159,7 +159,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
);
}
onTapCalendar(BuildContext context, DiplomaEntity diploma) {
Null Function() onTapCalendar(BuildContext context, DiplomaEntity diploma) {
return () {
_showDialog(
CupertinoDatePicker(
@@ -198,7 +198,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
);
}
checkLast() {
void checkLast() {
if (diplomasList.last.textEditingController.text.isNotEmpty || diplomasList.last.date != null) {
setState(() {
diplomasList.add(
@@ -219,7 +219,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
}
}
enableDeleteButton(DiplomaEntity diploma) {
void enableDeleteButton(DiplomaEntity diploma) {
if (diploma.textEditingController.text.isNotEmpty || diploma.date != null) {
setState(() {
diplomasList[diplomasList.indexOf(diploma)].enableDeleteButton = true;
@@ -228,7 +228,7 @@ class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasS
_saveState();
}
_saveState() {
void _saveState() {
context.read<RegisterConsultantCubit>().updateConsultantProfileModel(
context.read<RegisterConsultantCubit>().state.consultant.copyWith(
certificates: diplomasList.map((e) => CertificatesModel(title: e.textEditingController.text, date: e.date.toString())).toList().sublist(

View File

@@ -80,7 +80,7 @@ class _LastStepScreenState extends State<LastStepScreen> {
);
}
_divider(BuildContext context) {
Container _divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,

View File

@@ -148,7 +148,7 @@ class _PhotoOrScansScreenState extends State<PhotoOrScansScreen> {
);
}
_saveState() {
void _saveState() {
context.read<RegisterConsultantCubit>().updateConsultantProfileModel(
context.read<RegisterConsultantCubit>().state.consultant.copyWith(
photos: imagesPaths,

View File

@@ -104,7 +104,7 @@ class _RegistrationAsScreenState extends State<RegistrationAsScreen> {
);
}
_divider(BuildContext context) {
Container _divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,

View File

@@ -158,7 +158,7 @@ class _SocialNetworksScreenState extends State<SocialNetworksScreen> {
);
}
setLinksState({
void setLinksState({
String? tgLink,
String? vkLink,
String? personalSiteLink,

View File

@@ -354,7 +354,7 @@ class _ConsultationCardWidgetState extends State<ConsultationCardWidget> {
);
}
_legendTitle(String text, Color color) {
Row _legendTitle(String text, Color color) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View File

@@ -348,7 +348,7 @@ class _DietPreviewScreenState extends State<DietPreviewScreen> {
);
}
_dayOfPlan(Map<int, Map<int, DailySchedule>> day, int dayNumber, S s) {
Padding _dayOfPlan(Map<int, Map<int, DailySchedule>> day, int dayNumber, S s) {
choiceChipWidget(int index) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
@@ -435,7 +435,7 @@ class _DietPreviewScreenState extends State<DietPreviewScreen> {
);
}
_daily(DailySchedule? daily, S s) {
SingleChildRenderObjectWidget _daily(DailySchedule? daily, S s) {
if (daily == null) return const SizedBox.shrink();
return Padding(
padding: const EdgeInsets.only(bottom: 12),

View File

@@ -289,7 +289,7 @@ class _DayWidgetState extends State<DayWidget> {
);
}
_product(int index, String product, int quantity, String portion, int dayIndex, int mealIndex) {
Material _product(int index, String product, int quantity, String portion, int dayIndex, int mealIndex) {
return Material(
child: ListTile(
onTap: () {
@@ -313,7 +313,7 @@ class _DayWidgetState extends State<DayWidget> {
);
}
_modalBottomSheet({
Future _modalBottomSheet({
required CreateDietCubit createDietCubit,
required int dayIndex,
required int mealIndex,

View File

@@ -32,7 +32,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
),
);
addStep() {
void addStep() {
emit(
state.copyWith.entity(
steps: [
@@ -43,13 +43,13 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
);
}
removeStep(StepEntity step) {
void removeStep(StepEntity step) {
List<StepEntity> steps = [...state.entity.steps];
steps.remove(step);
emit(state.copyWith.entity(steps: steps));
}
addIngredient(i.Ingredient entity) {
void addIngredient(i.Ingredient entity) {
emit(
state.copyWith.entity(
ingredients: [
@@ -60,7 +60,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
);
}
removeIngredient(int index) {
void removeIngredient(int index) {
List<i.Ingredient> ingredients = [...state.entity.ingredients];
ingredients.removeAt(index);
@@ -73,26 +73,26 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
emit(state.copyWith.entity(ingredients: ingredients));
}
replaceIngredientPosition(int oldIndex, int newIndex) {
void replaceIngredientPosition(int oldIndex, int newIndex) {
List<i.Ingredient> ingredients = [...state.entity.ingredients];
final item = ingredients.removeAt(oldIndex);
ingredients.insert(newIndex, item);
emit(state.copyWith.entity(ingredients: ingredients));
}
replaceTitle(String title) {
void replaceTitle(String title) {
emit(state.copyWith.entity(title: title == '' ? null : title));
}
replaceDescription(String description) {
void replaceDescription(String description) {
emit(state.copyWith.entity(description: description == '' ? null : description));
}
changeType(TypeOfRecipe typeOfRecipe) {
void changeType(TypeOfRecipe typeOfRecipe) {
emit(state.copyWith.entity(typeOfRecipe: typeOfRecipe));
}
addTag(String tag) {
void addTag(String tag) {
emit(
state.copyWith.entity(
tags: [
@@ -103,46 +103,46 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
);
}
removeTag(String tag) {
void removeTag(String tag) {
List<String> tags = [...state.entity.tags];
tags.remove(tag);
emit(state.copyWith.entity(tags: tags));
}
replacePortionsCount(int count) {
void replacePortionsCount(int count) {
emit(state.copyWith.entity(countOfPortions: count));
}
replaceEnegryInPortion(double energy) {
void replaceEnegryInPortion(double energy) {
emit(state.copyWith.entity(energyInOnePortion: energy));
}
setTotalCookingMinutes(int minutes) {
void setTotalCookingMinutes(int minutes) {
emit(state.copyWith.entity(totalCookMinutes: minutes));
}
setTotalCookingHours(int hours) {
void setTotalCookingHours(int hours) {
emit(state.copyWith.entity(totalCookHours: hours));
}
setActiveCookingMinutes(int minutes) {
void setActiveCookingMinutes(int minutes) {
emit(state.copyWith.entity(activeCookMinutes: minutes));
}
setActiveCookingHours(int hours) {
void setActiveCookingHours(int hours) {
emit(state.copyWith.entity(activeCookHours: hours));
}
replaceVideoUrl(String videoUrl) {
void replaceVideoUrl(String videoUrl) {
emit(state.copyWith.entity(videoUrl: videoUrl));
}
replaceImage(File? image) {
void replaceImage(File? image) {
emit(state.copyWith.entity(image: image));
}
replaceDescriptionInStep(String description, int index) {
void replaceDescriptionInStep(String description, int index) {
List<StepEntity> steps = [...state.entity.steps];
steps[index] = steps[index].copyWith(description: description);
@@ -150,7 +150,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
emit(state.copyWith.entity(steps: steps));
}
replaceImageInStep(File? image, int index) {
void replaceImageInStep(File? image, int index) {
List<StepEntity> steps = [...state.entity.steps];
steps[index] = steps[index].copyWith(image: image);
@@ -182,7 +182,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
}
}
disableLoading() {
void disableLoading() {
emit(state.copyWith(loading: false));
}

View File

@@ -69,7 +69,7 @@ class _ImageWidgetState extends State<ImageWidget> {
);
}
_showImagePicker() {
void _showImagePicker() {
showCupertinoModalPopup<void>(
context: context,
builder: (context) {

View File

@@ -112,7 +112,7 @@ class _IngredientsWidgetState extends State<IngredientsWidget> {
);
}
_modalBottomSheet({
Future _modalBottomSheet({
required CreateRecipeCubit createRecipeCubit,
int? portionIndex,
String? productNameControllerText,

View File

@@ -82,7 +82,7 @@ class _StepImageWidgetState extends State<StepImageWidget> {
);
}
_showImagePicker() {
void _showImagePicker() {
showCupertinoModalPopup<void>(
context: context,
builder: (context) {

View File

@@ -168,7 +168,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
});
showErrorToast('${testCases[index].name} failed');
// Show AlertDialog with error description
if (mounted) {
if (context.mounted) {
showDialog(
context: context,
builder: (context) => AlertDialog(
@@ -190,12 +190,12 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
});
showErrorToast('${testCases[index].name} failed');
// Show AlertDialog with error description
if (mounted) {
if (context.mounted) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('Test Failed'),
content: SingleChildScrollView(child: Text(e.toString() + '\n' + stack.toString())),
content: SingleChildScrollView(child: Text('$e\n$stack')),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),

View File

@@ -70,14 +70,14 @@ class CreateRecipeTask implements TestCases {
steps: [Step(description: 'desc')],
),
);
} on DioError catch (e) {
} on DioException catch (e) {
final res = e.response;
if (res != null && (res.statusCode == null || res.statusCode! < 200 || res.statusCode! >= 300)) {
return TestResult(false, 'DioError: statusCode=${res.statusCode}\n${res.data}');
}
return TestResult(false, e.toString());
} catch (e, stack) {
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
return TestResult(true);
}
@@ -107,7 +107,7 @@ class Test850task implements TestCases {
await dietsService.cancelDiet(id: lastChosenDiet?.dietId ?? 0);
} catch (e, stack) {
log('unexpected error7: $e');
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
await Future.delayed(const Duration(seconds: 3));
}
@@ -121,24 +121,24 @@ class Test850task implements TestCases {
await dietsService.startDiet(id: diet.id, body: {'date': today.format('yyyy-MM-dd')});
} catch (e, stack) {
log('unexpected error2: $e');
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
try {
await dietsService.cancelDiet(id: diet.id);
} catch (e, stack) {
log('unexpected error3: $e');
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
await Future.delayed(const Duration(seconds: 3));
try {
await dietsService.startDiet(id: diet.id, body: {'date': tomorrow.format('yyyy-MM-dd')});
} catch (e, stack) {
log('unexpected error4: $e');
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
try {
await dietsService.cancelDiet(id: diet.id);
} catch (e, stack) {
} catch (e) {
log('unexpected error5: $e');
}
break;
@@ -147,7 +147,7 @@ class Test850task implements TestCases {
return TestResult(true);
} catch (e, stack) {
log('unexpected error6: $e');
return TestResult(false, e.toString() + '\n' + stack.toString());
return TestResult(false, '$e\n$stack');
}
}
}

View File

@@ -64,7 +64,7 @@ abstract class DiaryFutureDietDayModel with _$DiaryFutureDietDayModel {
factory DiaryFutureDietDayModel.fromJson(Map<String, dynamic> json) => _$DiaryFutureDietDayModelFromJson(json);
}
DiaryDietModel? _parseDiet(json) {
DiaryDietModel? _parseDiet(dynamic json) {
if (json == null) return null;
return DiaryDietModel.fromJson(json['diet']);
}
@@ -80,7 +80,7 @@ abstract class DiaryDietModel with _$DiaryDietModel {
factory DiaryDietModel.fromJson(Map<String, dynamic> json) => _$DiaryDietModelFromJson(json);
}
TypeOfDiaryModel _parseDayTypeForFutureDay(json) {
TypeOfDiaryModel _parseDayTypeForFutureDay(dynamic json) {
return TypeOfDiaryModel(
hasChosenDiet: json['has_chosen_diet'] as bool,
hasChosenPlan: json['has_chosen_plan'] as bool,

View File

@@ -55,7 +55,7 @@ class DiaryCubit extends Cubit<DiaryState> {
return null;
}
setSelectedMeal(int meal) {
void setSelectedMeal(int meal) {
selectedMeal = meal;
final currentState = state;
if (currentState is DiaryStateLoaded) {
@@ -154,7 +154,7 @@ class DiaryCubit extends Cubit<DiaryState> {
return false;
}
fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
Future<void> fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
this.diaryId ??= diaryId;
if (needLoading) {
@@ -215,7 +215,7 @@ class DiaryCubit extends Cubit<DiaryState> {
}
}
finishDiaryDay({
Future<void> finishDiaryDay({
required int diaryId,
required String wakeUp,
required String retire,
@@ -233,7 +233,7 @@ class DiaryCubit extends Cubit<DiaryState> {
return (await diaryRepository.getNutritionData(index));
}
addProductToMeal({
Future<void> addProductToMeal({
required int diaryId,
required int mealId,
required String productName,
@@ -252,7 +252,7 @@ class DiaryCubit extends Cubit<DiaryState> {
await fetchDiary();
}
updateProductInMeal({
Future<void> updateProductInMeal({
required int diaryId,
required int mealId,
required int portionId,
@@ -286,22 +286,22 @@ class DiaryCubit extends Cubit<DiaryState> {
await fetchDiary();
}
markEaten({required int diaryId, required int mealId, required int portionId}) async {
Future<void> markEaten({required int diaryId, required int mealId, required int portionId}) async {
await diaryRepository.markEaten(diaryId: diaryId, mealId: mealId, portionId: portionId);
await fetchDiary();
}
unmarkEaten({required int diaryId, required int mealId, required int portionId}) async {
Future<void> unmarkEaten({required int diaryId, required int mealId, required int portionId}) async {
await diaryRepository.unmarkEaten(diaryId: diaryId, mealId: mealId, portionId: portionId);
await fetchDiary();
}
restore({required int diaryId, required int mealId, required int portionId}) async {
Future<void> restore({required int diaryId, required int mealId, required int portionId}) async {
await diaryRepository.restore(diaryId: diaryId, mealId: mealId, portionId: portionId);
await fetchDiary();
}
deleteProductFromMeal({required int diaryId, required int mealId, required int portionId}) async {
Future<void> deleteProductFromMeal({required int diaryId, required int mealId, required int portionId}) async {
await diaryRepository.deleteProductFromMeal(diaryId: diaryId, mealId: mealId, portionId: portionId);
await fetchDiary();
}
@@ -310,12 +310,12 @@ class DiaryCubit extends Cubit<DiaryState> {
return await glossaryRepository.getGlossaryListByQuery(query);
}
uploadPhotos({required List<File> files, required int diaryId}) async {
Future<void> uploadPhotos({required List<File> files, required int diaryId}) async {
await diaryRepository.uploadPhotos(files: await ImageCompressUtility.compressFilesList(files), diaryId: diaryId, mealId: selectedMeal);
await fetchDiary();
}
deletePhoto({required DiaryPhotoModel photo, required int diaryId}) async {
Future<void> deletePhoto({required DiaryPhotoModel photo, required int diaryId}) async {
await diaryRepository.deletePhoto(photo: photo, diaryId: diaryId, mealId: selectedMeal);
await fetchDiary();
}
@@ -335,32 +335,32 @@ class DiaryCubit extends Cubit<DiaryState> {
return null;
}
fillTime({required int diaryId, required String time}) async {
Future<void> fillTime({required int diaryId, required String time}) async {
await diaryRepository.fillTime(diaryId: diaryId, mealId: selectedMeal, time: time);
await fetchDiary();
}
fillWakeup({required int diaryId, required String time}) async {
Future<void> fillWakeup({required int diaryId, required String time}) async {
await diaryRepository.fillWakeup(diaryId: diaryId, time: time);
await fetchDiary();
}
fillRetire({required int diaryId, required String time}) async {
Future<void> fillRetire({required int diaryId, required String time}) async {
await diaryRepository.fillRetire(diaryId: diaryId, time: time);
await fetchDiary();
}
fillSatiety({required int diaryId, required int satiety}) async {
Future<void> fillSatiety({required int diaryId, required int satiety}) async {
await diaryRepository.fillSatiety(diaryId: diaryId, mealId: selectedMeal, satiety: satiety);
await fetchDiary();
}
fillMood({required int diaryId, required int mood}) async {
Future<void> fillMood({required int diaryId, required int mood}) async {
await diaryRepository.fillMood(diaryId: diaryId, mealId: selectedMeal, mood: mood);
await fetchDiary();
}
fillComment(String comment) {
void fillComment(String comment) {
this.comment = comment;
}
}

View File

@@ -21,7 +21,7 @@ class _AddProductButtonWidgetState extends State<AddProductButtonWidget> {
diaryCubit = context.read<DiaryCubit>();
}
addProductInMeal(DiaryStateLoaded state, [int? portionId]) {
Future addProductInMeal(DiaryStateLoaded state, [int? portionId]) {
return showModalBottomSheet(
useRootNavigator: true,
context: context,

View File

@@ -134,13 +134,13 @@ class _CalendarWidgetState extends State<CalendarWidget> {
);
}
_nextCalendarFormat() {
void _nextCalendarFormat() {
setState(() {
_calendarFormat = CalendarFormat.values[(_calendarFormat.index - 1) % CalendarFormat.values.length];
});
}
_arrowDown() {
GestureDetector _arrowDown() {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onVerticalDragStart: (_) {

View File

@@ -242,7 +242,7 @@ class CaloriesChartWidget extends StatelessWidget {
);
}
_chartData(String title, String value) {
Row _chartData(String title, String value) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [

View File

@@ -46,7 +46,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
productNameController.text = widget.productName;
}
_alert() {
Padding _alert() {
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
@@ -137,7 +137,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
);
}
_success() {
Padding _success() {
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
@@ -189,7 +189,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
);
}
_addNewGlossaryProduct() {
Padding _addNewGlossaryProduct() {
return Padding(
padding: const EdgeInsets.all(16),
child: Column(

View File

@@ -34,7 +34,7 @@ class _PhotoGalleryWidgetState extends State<PhotoGalleryWidget> {
diaryCubit = context.read<DiaryCubit>();
}
showImagePicker(DiaryDayModel diaryDay) {
void showImagePicker(DiaryDayModel diaryDay) {
showCupertinoModalPopup<void>(
context: context,
builder: (context) {

View File

@@ -44,7 +44,7 @@ class _ProductWidgetState extends State<ProductWidget> {
isEaten = widget.portion.portionState == PortionState.eatenFromDiet ? true : false;
}
updateProductInMeal(DiaryStateLoaded state, PortionModel portion) {
Future updateProductInMeal(DiaryStateLoaded state, PortionModel portion) {
return showModalBottomSheet(
useRootNavigator: true,
context: context,

View File

@@ -23,7 +23,7 @@ class _TimeOfMealPickerWidgetState extends State<TimeOfMealPickerWidget> {
diaryCubit = context.read<DiaryCubit>();
}
showTimePicker(int diaryId) {
void showTimePicker(int diaryId) {
showModalBottomSheet<void>(
context: context,
useRootNavigator: true,

View File

@@ -26,7 +26,7 @@ class _WakeupAndRetireWidgetState extends State<WakeupAndRetireWidget> {
diaryCubit = context.read<DiaryCubit>();
}
showTimePicker(int diaryId, bool isWakeup) {
void showTimePicker(int diaryId, bool isWakeup) {
showModalBottomSheet<void>(
context: context,
useRootNavigator: true,

View File

@@ -561,7 +561,7 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
);
}
_dayOfPlan(Map<int, Map<int, DailySchedule>> day, int dayNumber, S s, List<int> selectedIndexes, Diet diet) {
Padding _dayOfPlan(Map<int, Map<int, DailySchedule>> day, int dayNumber, S s, List<int> selectedIndexes, Diet diet) {
choiceChipWidget(int index) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
@@ -646,7 +646,7 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
);
}
_daily(DailySchedule? daily, S s) {
SingleChildRenderObjectWidget _daily(DailySchedule? daily, S s) {
if (daily == null) return const SizedBox();
return Padding(
padding: const EdgeInsets.only(bottom: 12),

View File

@@ -46,7 +46,7 @@ abstract class PlanModel with _$PlanModel {
factory PlanModel.fromJson(Map<String, dynamic> json) => _$PlanModelFromJson(json);
}
PacketOptions? parseOption(json) {
PacketOptions? parseOption(dynamic json) {
if (json is Map<String, dynamic>) {
return PacketOptions.fromJson(json);
}
@@ -74,7 +74,7 @@ abstract class PacketOptions with _$PacketOptions {
factory PacketOptions.empty() => PacketOptions(items: [], price: double.parse('1200'), short: '', description: '');
}
List<String> _parseItems(json) {
List<String> _parseItems(dynamic json) {
if (json is Map<String, dynamic>) {
return json.values.map((e) => e as String).toList();
}

View File

@@ -53,7 +53,7 @@ abstract class Ingredient with _$Ingredient {
factory Ingredient.fromJson(Map<String, Object?> json) => _$IngredientFromJson(json);
}
int _parseProductId(json) {
int _parseProductId(dynamic json) {
if (json is String) {
return int.parse(json);
}

View File

@@ -10,11 +10,11 @@ class CommentsCubit extends Cubit<CommentsState> {
required this.feedRepository,
}) : super(const CommentsState());
setReplyId(int? replyId) {
void setReplyId(int? replyId) {
emit((state as CommentsStateLoaded).copyWith(replyId: replyId));
}
getComments(String id, CommentSourceType commentSourceType, [bool isFirstFetch = false]) async {
Future<void> getComments(String id, CommentSourceType commentSourceType, [bool isFirstFetch = false]) async {
if (isFirstFetch) emit(const CommentsState.loading());
try {
switch (commentSourceType) {
@@ -36,7 +36,7 @@ class CommentsCubit extends Cubit<CommentsState> {
}
}
sendComment({
Future<void> sendComment({
required String id,
required String commentText,
required CommentSourceType commentSourceType,

View File

@@ -11,7 +11,7 @@ class ConsultantsCubit extends Cubit<ConsultantsState> {
required this.feedRepository,
}) : super(const ConsultantsState());
getConsultants() async {
Future<void> getConsultants() async {
emit(const ConsultantsState.loading());
try {
emit(

View File

@@ -86,7 +86,7 @@ class DietsCubit extends Cubit<DietsState> {
);
}
loadDiets({
Future<void> loadDiets({
String? query,
}) async {
try {

View File

@@ -16,7 +16,7 @@ class FeedCubit extends Cubit<FeedState> {
required this.feedRepository,
}) : super(const FeedState.loading());
updateFeedBlogPostList(FeedBlogPostModel? feedBlogPostModel, bool wasLikedByMe) {
void updateFeedBlogPostList(FeedBlogPostModel? feedBlogPostModel, bool wasLikedByMe) {
if (feedBlogPostModel == null) return;
List<FeedBlogPostModel> feedBlogPostList = [...(state as FeedStateLoaded).feedBlogPostList];
final int index = feedBlogPostList.indexOf(feedBlogPostModel);
@@ -32,7 +32,7 @@ class FeedCubit extends Cubit<FeedState> {
);
}
loadFeedBlogPostList({
Future<void> loadFeedBlogPostList({
String? query,
}) async {
try {
@@ -80,7 +80,7 @@ class FeedCubit extends Cubit<FeedState> {
}
}
likePost(int id) async {
Future<void> likePost(int id) async {
try {
await feedRepository.likeBlogPost(id: id);
} catch (e, st) {
@@ -88,10 +88,10 @@ class FeedCubit extends Cubit<FeedState> {
}
}
unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id);
Future<void> unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id);
viewPost(int id) async => await feedRepository.viewPost(id);
viewRecipe(String slug) async => await feedRepository.viewRecipe(slug);
viewDiet(int id) async => await feedRepository.viewDiet(id);
viewPlan(String slug) async => await feedRepository.viewPlan(slug);
Future<void> viewPost(int id) async => await feedRepository.viewPost(id);
Future<void> viewRecipe(String slug) async => await feedRepository.viewRecipe(slug);
Future<void> viewDiet(int id) async => await feedRepository.viewDiet(id);
Future<void> viewPlan(String slug) async => await feedRepository.viewPlan(slug);
}

View File

@@ -132,7 +132,7 @@ class PlansCubit extends Cubit<PlansState> {
);
}
loadPlans({
Future<void> loadPlans({
String? query,
}) async {
try {

View File

@@ -40,7 +40,7 @@ class RecipesCubit extends Cubit<RecipesState> {
});
}
loadRecipesList({
Future<void> loadRecipesList({
String? query,
}) async {
try {
@@ -99,7 +99,7 @@ class RecipesCubit extends Cubit<RecipesState> {
}
}
updateTags(RecipeTag tag) {
void updateTags(RecipeTag tag) {
_selectedTags.contains(tag.id) ? _selectedTags.remove(tag.id) : _selectedTags.add(tag.id);
emit(
state.copyWith(

View File

@@ -85,7 +85,7 @@ class _FeedScreenContentState extends State<FeedScreenContent> {
_onScrollConsultants() {
void _onScrollConsultants() {
if (consultantsScrollController.offset >= consultantsScrollController.position.maxScrollExtent && !consultantsScrollController.position.outOfRange) {}
}

View File

@@ -53,7 +53,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
);
}
_comment(S s, Comment comment, [double radius = 18, bool isChild = false]) {
Container _comment(S s, Comment comment, [double radius = 18, bool isChild = false]) {
return Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(

View File

@@ -121,7 +121,7 @@ class ConsultantWidget extends StatelessWidget {
);
}
_badges(List<BadgeModel> badges, BuildContext context) {
SingleChildScrollView _badges(List<BadgeModel> badges, BuildContext context) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(

View File

@@ -262,7 +262,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
);
}
_iconButton(String iconPath, [String? text]) {
Container _iconButton(String iconPath, [String? text]) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(

View File

@@ -42,7 +42,7 @@ class _TagsModalWidgetState extends State<TagsModalWidget> {
);
}
_tagChip({
ChoiceChip _tagChip({
required RecipeTag tag,
required bool isSelected,
}) {

View File

@@ -19,7 +19,7 @@ abstract class ConsultantFinanceModel with _$ConsultantFinanceModel {
factory ConsultantFinanceModel.fromJson(Map<String, dynamic> json) => _$ConsultantFinanceModelFromJson(json);
}
String _parsePayment(json) {
String _parsePayment(dynamic json) {
return ((json as int) / 100).toStringAsFixed(2);
}

View File

@@ -9,7 +9,7 @@ class BlockedUsersCubit extends Cubit<BlockedUsersState> {
required this.blockedUsersRepository,
}) : super(const BlockedUsersState());
getBlockedUsers() async {
Future<void> getBlockedUsers() async {
try {
emit(BlockedUsersState.loaded(profilesList: await blockedUsersRepository.getBlockedUsers()));
} catch (e, st) {
@@ -17,12 +17,12 @@ class BlockedUsersCubit extends Cubit<BlockedUsersState> {
}
}
blockUser(String slug) async {
Future<void> blockUser(String slug) async {
await blockedUsersRepository.blockUserBySlug(slug);
await getBlockedUsers();
}
unblockUser(String slug) async {
Future<void> unblockUser(String slug) async {
await blockedUsersRepository.unblockUserBySlug(slug);
await getBlockedUsers();
}

View File

@@ -71,7 +71,7 @@ class MenuScreen extends StatelessWidget {
);
}
_tile({required String title, required String leading, required Function() onTap}) {
ListTile _tile({required String title, required String leading, required Function() onTap}) {
return ListTile(
onTap: onTap,
leading: SvgPicture.asset(leading, height: 24, width: 24, colorFilter: ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn)),
@@ -80,7 +80,7 @@ class MenuScreen extends StatelessWidget {
);
}
_divider(BuildContext context) {
Container _divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,
@@ -88,7 +88,7 @@ class MenuScreen extends StatelessWidget {
);
}
_onTapLogout(BuildContext context) {
Future<Null> Function() _onTapLogout(BuildContext context) {
return () async {
showDialog(
context: context,

View File

@@ -19,7 +19,7 @@ class BlockedUsersRepository {
}
}
blockUserBySlug(String slug) async {
Future<void> blockUserBySlug(String slug) async {
try {
return await blockedUserService.blockUser(
data: {
@@ -32,7 +32,7 @@ class BlockedUsersRepository {
}
}
unblockUserBySlug(String slug) async {
Future<void> unblockUserBySlug(String slug) async {
try {
return await blockedUserService.unblockUser(
data: {

View File

@@ -14,7 +14,7 @@ abstract class CardModel with _$CardModel {
factory CardModel.fromJson(Map<String, dynamic> json) => _$CardModelFromJson(json);
}
bool parseBool(json) {
bool parseBool(dynamic json) {
if (json == 1 || json == true || json == '1') {
return true;
}

View File

@@ -21,7 +21,7 @@ abstract class ChosenPlanModel with _$ChosenPlanModel {
factory ChosenPlanModel.fromJson(Map<String, dynamic> json) => _$ChosenPlanModelFromJson(json);
}
ChosenPlanModel? parseChosenPlan(json) {
ChosenPlanModel? parseChosenPlan(dynamic json) {
if (json is Map<String, dynamic>) {
return ChosenPlanModel.fromJson(json);
}

View File

@@ -72,7 +72,7 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
@override
Widget build(BuildContext context) {
final s = S.of(context);
return PopScope(
return PopScope(
child: MultiBlocProvider(
providers: [
BlocProvider<CommentsCubit>(
@@ -102,14 +102,14 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
return Scaffold(
appBar: AppBar(
leading: BackButton(
onPressed: () {
if (context.canPop()) {
GoRouter.of(context).pop();
return;
}
GoRouter.of(context).go('/feed-screen');
},
),
onPressed: () {
if (context.canPop()) {
GoRouter.of(context).pop();
return;
}
GoRouter.of(context).go('/feed-screen');
},
),
centerTitle: true,
title: Text(
'',
@@ -132,14 +132,14 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
return Scaffold(
appBar: AppBar(
leading: BackButton(
onPressed: () {
if (context.canPop()) {
GoRouter.of(context).pop();
return;
}
GoRouter.of(context).go('/feed-screen');
},
),
onPressed: () {
if (context.canPop()) {
GoRouter.of(context).pop();
return;
}
GoRouter.of(context).go('/feed-screen');
},
),
centerTitle: true,
title: Text(
state.planModel?.name ?? '',
@@ -154,7 +154,7 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
isAuthor: state.planModel?.author.authorIsMe ?? false,
path: 'plan/${widget.slug}',
complainedContentType: ComplainedContent.plan,
slug: widget.slug,
userSlug: state.planModel?.author.authorSlug ?? '',
),
const SizedBox(width: 16),
],
@@ -329,7 +329,7 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
textEditingController.clear();
replyId = null;
});
Future.delayed(const Duration(milliseconds: 500), () {
if (context.mounted) {
context.read<AboutPlanCubit>().getPlan(widget.slug);
@@ -382,7 +382,7 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
isAuthor: state.planModel?.author.authorIsMe ?? false,
path: 'plan/${widget.slug}',
complainedContentType: ComplainedContent.plan,
slug: widget.slug,
userSlug: state.planModel?.author.authorSlug ?? '',
),
const SizedBox(width: 16),
],
@@ -436,7 +436,8 @@ class _AboutPlanScreenState extends State<AboutPlanScreen> {
'assets/icons/heart.svg',
width: 14,
height: 12,
colorFilter: state.planModel?.wasLikedByMe == true ? ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn) : null,
colorFilter:
state.planModel?.wasLikedByMe == true ? ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn) : null,
),
const SizedBox(width: 8),
Text(

View File

@@ -26,7 +26,7 @@ abstract class ChosenDietModel with _$ChosenDietModel {
factory ChosenDietModel.fromJson(Map<String, dynamic> json) => _$ChosenDietModelFromJson(json);
}
int? _parseDietId(json) {
int? _parseDietId(dynamic json) {
if (json == null) return null;
return json['id'] as int?;
}

View File

@@ -11,7 +11,7 @@ class PlansCubit extends Cubit<PlansState> {
required this.plansRepository,
}) : super(const PlansState());
getPlans(String slug) async {
Future<void> getPlans(String slug) async {
emit(const PlansState.loading());
try {
emit(PlansState.loaded(plansList: await plansRepository.getPlansBySlug(slug)));

View File

@@ -63,7 +63,7 @@ class ProfileCubit extends Cubit<ProfileState> {
}
}
updateFeedBlogPostList(FeedBlogPostModel feedBlogPostModel, bool wasLikedByMe) {
void updateFeedBlogPostList(FeedBlogPostModel feedBlogPostModel, bool wasLikedByMe) {
List<FeedBlogPostModel> feedBlogPostList = [...(state as ProfileStateLoaded).blogPosts];
final int index = feedBlogPostList.indexOf(feedBlogPostModel);
feedBlogPostList[index] = feedBlogPostModel.copyWith(
@@ -79,7 +79,7 @@ class ProfileCubit extends Cubit<ProfileState> {
);
}
addCircumference({
Future<void> addCircumference({
required int chestCircumference,
required int waistCircumference,
required int hipCircumference,
@@ -96,7 +96,7 @@ class ProfileCubit extends Cubit<ProfileState> {
}
}
addWeight({
Future<void> addWeight({
required double weight,
}) async {
try {
@@ -107,7 +107,7 @@ class ProfileCubit extends Cubit<ProfileState> {
}
}
getChatRoomIdBySlug({
Future<String?> getChatRoomIdBySlug({
required Author author,
}) async {
try {
@@ -126,19 +126,21 @@ class ProfileCubit extends Cubit<ProfileState> {
'chatId': chatIdOrError,
},
);
return chatIdOrError;
}
} catch (e, st) {
log(e.toString(), stackTrace: st);
return '';
}
return null;
}
uploadPhoto(File file) async {
Future<void> uploadPhoto(File file) async {
await profileRepository.uploadPhoto(await ImageCompressUtility.compressFile(file));
return await getMyProfile();
}
deletePhoto() async {
Future<void> deletePhoto() async {
await profileRepository.deletePhoto();
return await getMyProfile();
}

View File

@@ -9,7 +9,7 @@ class SubCubit extends Cubit<SubState> {
required this.profileRepository,
}) : super(const SubState());
getSubscriptions(String slug, [String? query]) async {
Future<void> getSubscriptions(String slug, [String? query]) async {
emit(const SubState.loading());
try {
emit(SubState.loaded(subList: await profileRepository.getSubscriptionsBySlug(slug, query)));
@@ -18,7 +18,7 @@ class SubCubit extends Cubit<SubState> {
}
}
getSubscribers(String slug, [String? query]) async {
Future<void> getSubscribers(String slug, [String? query]) async {
emit(const SubState.loading());
try {
emit(SubState.loaded(subList: await profileRepository.getSubscribersBySlug(slug, query)));
@@ -27,11 +27,11 @@ class SubCubit extends Cubit<SubState> {
}
}
subscribe(String slug) async {
Future<void> subscribe(String slug) async {
return await profileRepository.subscribe(slug);
}
unsubscribe(String slug) async {
Future<void> unsubscribe(String slug) async {
return await profileRepository.unsubscribe(slug);
}
}

View File

@@ -119,7 +119,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_profileScreen(ProfileStateLoaded state) {
Scaffold _profileScreen(ProfileStateLoaded state) {
return Scaffold(
backgroundColor: Colors.grey.shade200,
appBar: AppBar(),
@@ -213,7 +213,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_myProfileScreen(ProfileStateLoaded state) {
Scaffold _myProfileScreen(ProfileStateLoaded state) {
return Scaffold(
backgroundColor: Colors.grey.shade200,
appBar: AppBar(toolbarHeight: 0),
@@ -306,7 +306,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_activePlans(ProfileStateLoaded state) {
Widget _activePlans(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant')) {
return const SizedBox.shrink();
}
@@ -365,7 +365,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_bullets(int currentBullet, int bulletCount) {
Container _bullets(int currentBullet, int bulletCount) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
@@ -384,7 +384,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_bullet(bool isActive) {
AnimatedContainer _bullet(bool isActive) {
return AnimatedContainer(
width: isActive ? 10 : 8,
height: isActive ? 10 : 8,
@@ -396,7 +396,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_newBlogPostButton() {
Material _newBlogPostButton() {
return Material(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
@@ -437,7 +437,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_diplomasAndCertificates(ProfileStateLoaded state) {
SingleChildRenderObjectWidget _diplomasAndCertificates(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant') || state.consultantInfo!.photos.isEmpty) {
return const SizedBox.shrink();
}
@@ -510,7 +510,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_diplomaImage(String url) {
GestureDetector _diplomaImage(String url) {
return GestureDetector(
onTap: () {
context.pushTransparentRoute(
@@ -536,7 +536,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_education(ProfileStateLoaded state) {
SingleChildRenderObjectWidget _education(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant') ||
state.consultantInfo!.educationModel.completedCourses == null ||
(state.consultantInfo!.educationModel.completedCourses?.isEmpty ?? false)) {
@@ -603,7 +603,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_educationBlock(String title, String date) {
SizedBox _educationBlock(String title, String date) {
final parsedDate = DateTime.tryParse(date);
final formattedDate = parsedDate != null ? DateFormat('d MMMM y', 'ru_RU').format(parsedDate) : date;
@@ -643,7 +643,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_socialLinks(ProfileStateLoaded state) {
SingleChildRenderObjectWidget _socialLinks(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant')) {
return const SizedBox.shrink();
}
@@ -701,7 +701,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_socialLinkButton(Function() onTap, String icon, bool disabled) {
InkWell _socialLinkButton(Function() onTap, String icon, bool disabled) {
return InkWell(
onTap: disabled ? null : onTap,
borderRadius: BorderRadius.circular(20),
@@ -723,7 +723,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_badges(ProfileStateLoaded state) {
Padding _badges(ProfileStateLoaded state) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
@@ -815,7 +815,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_subscriptionsAndSubscribers(ProfileStateLoaded state) {
Padding _subscriptionsAndSubscribers(ProfileStateLoaded state) {
return Padding(
padding: const EdgeInsets.all(4),
child: Row(
@@ -924,7 +924,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_miniAvatars(List<String> urls) {
Row _miniAvatars(List<String> urls) {
int maxLength = urls.length > 2 ? 3 : urls.length;
return Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -944,7 +944,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_blogPosts(ProfileStateLoaded state) {
ListView _blogPosts(ProfileStateLoaded state) {
return ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 16),
shrinkWrap: true,
@@ -958,7 +958,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_additionalInfo(ProfileStateLoaded state) {
Container _additionalInfo(ProfileStateLoaded state) {
String text = state.profileDetails.additionalInfo;
if (state.profileDetails.additionalInfo.length > 250) {
text = state.profileDetails.additionalInfo.substring(0, 250);
@@ -976,7 +976,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_header(ProfileStateLoaded state) {
Padding _header(ProfileStateLoaded state) {
return Padding(
padding: const EdgeInsets.all(16),
child: Row(
@@ -1212,7 +1212,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_additional(String title, String value) {
Row _additional(String title, String value) {
return Row(
children: [
Text(
@@ -1235,7 +1235,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_messageAndSubscribe(ProfileStateLoaded state) {
Row _messageAndSubscribe(ProfileStateLoaded state) {
return Row(
children: [
const SizedBox(width: 16),
@@ -1286,7 +1286,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_charts() {
Material _charts() {
return Material(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
@@ -1350,7 +1350,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_choiceIntervalChipWidget(int index) {
ChoiceChip _choiceIntervalChipWidget(int index) {
return ChoiceChip(
selectedColor: Colors.grey.withValues(alpha: 0.1),
pressElevation: 0,
@@ -1376,7 +1376,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_choiceChipWidget(int index) {
ChoiceChip _choiceChipWidget(int index) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
pressElevation: 0,

View File

@@ -79,7 +79,7 @@ class _SubsScreenState extends State<SubsScreen> {
);
}
_buildStates(SubState state) {
StatelessWidget? _buildStates(SubState state) {
if (state is SubStateLoading) {
return const Loader();
}
@@ -94,5 +94,6 @@ class _SubsScreenState extends State<SubsScreen> {
itemCount: state.subList.length,
);
}
return null;
}
}

View File

@@ -191,7 +191,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
isLiked
? await context.read<FeedCubit>().likePost(state.blogPosts[widget.index].id)
: await context.read<FeedCubit>().unlikedPost(state.blogPosts[widget.index].id);
await widget.profileCubit.updateFeedBlogPostList(
widget.profileCubit.updateFeedBlogPostList(
state.blogPosts[widget.index],
isLiked ? false : true,
);

View File

@@ -17,7 +17,7 @@ class MyRecipesCubit extends Cubit<MyRecipesState> {
required this.aboutRecipeRepository,
}) : super(const MyRecipesState.loading());
getMyRecipes() async {
Future<void> getMyRecipes() async {
emit(const MyRecipesState.loading());
try {
final myRecipes = await myRecipesRepository.getMyRecipes();
@@ -28,7 +28,7 @@ class MyRecipesCubit extends Cubit<MyRecipesState> {
}
}
setActiveState() async {
Future<void> setActiveState() async {
emit(const MyRecipesState.loading());
try {
final myRecipes = await myRecipesRepository.getMyRecipes();
@@ -39,7 +39,7 @@ class MyRecipesCubit extends Cubit<MyRecipesState> {
}
}
setArchivedState() async {
Future<void> setArchivedState() async {
emit(const MyRecipesState.loading());
try {
final myRecipes = await myRecipesRepository.getMyRecipes();

View File

@@ -187,7 +187,7 @@ class _MyRecipeWidgetState extends State<MyRecipeWidget> {
);
}
_iconButton(String iconPath, [String? text]) {
Container _iconButton(String iconPath, [String? text]) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(

View File

@@ -48,7 +48,7 @@ class RegistrationCubit extends Cubit<RegistrationState> {
),
);
updateSheet(UserRegistrationSheet sheet) => emit(RegistrationState(sheet: sheet));
void updateSheet(UserRegistrationSheet sheet) => emit(RegistrationState(sheet: sheet));
Future<void> tryRegistration() async {
if (await registrationRepository.emailIsReachable(state.sheet.email)) {

View File

@@ -9,7 +9,7 @@ class VerifyEmailCubit extends Cubit<VerifyEmailState> {
required this.profileRepository,
}) : super(const VerifyEmailState.loading());
sendEmailCode() async {
Future<void> sendEmailCode() async {
try {
final profile = await profileRepository.getMyProfile();
await profileRepository.sendEmailCode();
@@ -19,7 +19,7 @@ class VerifyEmailCubit extends Cubit<VerifyEmailState> {
}
}
tryVerify(String code) async {
Future<void> tryVerify(String code) async {
try {
emit(const VerifyEmailState.verifyLoading());
final result = await profileRepository.tryVerifyEmailByCode(code);

View File

@@ -61,7 +61,7 @@ class _DateOfBirthScreenState extends State<DateOfBirthScreen> {
);
}
onTapCalendar(BuildContext context) {
Null Function() onTapCalendar(BuildContext context) {
return () {
_showDialog(
CupertinoDatePicker(

View File

@@ -40,7 +40,7 @@ class SettingsCubit extends Cubit<SettingsState> {
}
}
updateProfileDetails({
Future<void> updateProfileDetails({
required ProfileDetailsModel profileDetailsModel,
}) async {
try {
@@ -54,7 +54,7 @@ class SettingsCubit extends Cubit<SettingsState> {
}
}
updateProfileSettings({
Future<void> updateProfileSettings({
required ProfileSettingsModel profileSettingsModel,
}) async {
try {

View File

@@ -151,7 +151,7 @@ class _GeneralInfoScreenState extends State<GeneralInfoScreen> {
);
}
onTapCalendar(BuildContext context) {
Null Function() onTapCalendar(BuildContext context) {
return () {
_showDialog(
CupertinoDatePicker(
@@ -187,7 +187,7 @@ class _GeneralInfoScreenState extends State<GeneralInfoScreen> {
);
}
_saveButton() {
InkWell _saveButton() {
return InkWell(
onTap: () {
widget.settingsEntity.settingsCubit.updateProfileDetails(

View File

@@ -129,7 +129,7 @@ class _OtherInfoScreenState extends State<OtherInfoScreen> {
);
}
_saveButton() {
InkWell _saveButton() {
return InkWell(
onTap: () {
widget.settingsEntity.settingsCubit.updateProfileDetails(

View File

@@ -116,7 +116,7 @@ class _PhysicalActivityScreenState extends State<PhysicalActivityScreen> {
);
}
_saveButton() {
InkWell _saveButton() {
return InkWell(
onTap: () {
late final double activityCoefficient;

View File

@@ -100,7 +100,7 @@ class _PhysicalFormScreenState extends State<PhysicalFormScreen> {
);
}
_saveButton() {
InkWell _saveButton() {
return InkWell(
onTap: () {
widget.settingsEntity.settingsCubit.updateProfileDetails(

View File

@@ -106,7 +106,7 @@ class _PressureScreenState extends State<PressureScreen> {
);
}
_saveButton() {
InkWell _saveButton() {
return InkWell(
onTap: () {
widget.settingsEntity.settingsCubit.updateProfileDetails(

View File

@@ -86,7 +86,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_additionalInfo(SettingsStateLoaded state) {
Column _additionalInfo(SettingsStateLoaded state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -189,7 +189,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_notifications(SettingsStateLoaded state) {
Column _notifications(SettingsStateLoaded state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -323,7 +323,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_aboutEatvio(SettingsStateLoaded state) {
Column _aboutEatvio(SettingsStateLoaded state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -351,7 +351,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_becomeConsultantButton(SettingsStateLoaded state) {
SingleChildRenderObjectWidget _becomeConsultantButton(SettingsStateLoaded state) {
if (state.consultationRequestModel == null) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16) + const EdgeInsets.only(bottom: 8),
@@ -432,7 +432,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
return const SizedBox.shrink();
}
_deleteAccountButton(SettingsStateLoaded state) {
Padding _deleteAccountButton(SettingsStateLoaded state) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: InkWell(
@@ -460,7 +460,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_tile({
ListTile _tile({
required String title,
required Function() onTap,
Widget? trailing,
@@ -486,7 +486,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_divider(BuildContext context) {
Center _divider(BuildContext context) {
return Center(
child: Container(
height: 0.4,

View File

@@ -421,7 +421,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
);
}
_charts() {
Material _charts() {
return Material(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
@@ -483,7 +483,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
);
}
_choiceIntervalChipWidget(int index) {
ChoiceChip _choiceIntervalChipWidget(int index) {
return ChoiceChip(
selectedColor: Colors.grey.withValues(alpha: 0.1),
pressElevation: 0,
@@ -509,7 +509,7 @@ class _UserDetailsContentState extends State<UserDetailsContent> {
);
}
_choiceChipWidget(int index) {
ChoiceChip _choiceChipWidget(int index) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
pressElevation: 0,