diff --git a/lib/features/add_photo/cubit/add_photo_cubit.dart b/lib/features/add_photo/cubit/add_photo_cubit.dart index 393b68e..c23f7ec 100644 --- a/lib/features/add_photo/cubit/add_photo_cubit.dart +++ b/lib/features/add_photo/cubit/add_photo_cubit.dart @@ -1,4 +1,3 @@ -import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:image_picker/image_picker.dart'; diff --git a/lib/main.dart b/lib/main.dart index d17b5a7..bada8f1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,13 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +// ignore: depend_on_referenced_packages import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:proxibuy/data/models/datasources/offer_data_source.dart'; import 'package:proxibuy/data/repositories/offer_repository.dart'; import 'package:proxibuy/presentation/auth/bloc/auth_bloc.dart'; import 'package:proxibuy/presentation/notification_preferences/bloc/notification_preferences_bloc.dart'; import 'package:proxibuy/presentation/notification_preferences/bloc/notification_preferences_event.dart'; -import 'package:proxibuy/presentation/offer/bloc/offer_bloc.dart'; // ✅ مسیر BLoC آفر +import 'package:proxibuy/presentation/offer/bloc/offer_bloc.dart'; import 'package:proxibuy/presentation/reservation/cubit/reservation_cubit.dart'; import 'core/config/app_colors.dart'; import 'presentation/pages/onboarding_page.dart'; @@ -98,6 +99,7 @@ class MyApp extends StatelessWidget { ), ), labelStyle: const TextStyle(color: Colors.black), + // ignore: deprecated_member_use hintStyle: TextStyle(color: Colors.black.withOpacity(0.8)), ), outlinedButtonTheme: OutlinedButtonThemeData( diff --git a/lib/presentation/auth/bloc/auth_bloc.dart b/lib/presentation/auth/bloc/auth_bloc.dart index 842d12d..7518fd0 100644 --- a/lib/presentation/auth/bloc/auth_bloc.dart +++ b/lib/presentation/auth/bloc/auth_bloc.dart @@ -1,4 +1,6 @@ +// ignore: depend_on_referenced_packages import 'package:bloc/bloc.dart'; +// ignore: depend_on_referenced_packages import 'package:meta/meta.dart'; import 'dart:async'; @@ -30,9 +32,7 @@ class AuthBloc extends Bloc { on((event, emit) async { emit(AuthLoading()); await Future.delayed(const Duration(milliseconds: 500)); - - print('User info to save: Name: ${event.name}, Gender: ${event.gender}'); - + if (event.name.trim().isEmpty) { emit(AuthFailure('لطفاً نام خود را وارد کنید.')); } else { diff --git a/lib/presentation/offer/bloc/offer_bloc.dart b/lib/presentation/offer/bloc/offer_bloc.dart index 7c42783..0c1b20f 100644 --- a/lib/presentation/offer/bloc/offer_bloc.dart +++ b/lib/presentation/offer/bloc/offer_bloc.dart @@ -1,3 +1,4 @@ +// ignore: depend_on_referenced_packages import 'package:bloc/bloc.dart'; import 'package:proxibuy/data/repositories/offer_repository.dart'; import 'package:proxibuy/presentation/offer/bloc/offer_event.dart'; diff --git a/lib/presentation/offer/bloc/widgets/offer_card.dart b/lib/presentation/offer/bloc/widgets/offer_card.dart index eee6d5d..5552257 100644 --- a/lib/presentation/offer/bloc/widgets/offer_card.dart +++ b/lib/presentation/offer/bloc/widgets/offer_card.dart @@ -80,6 +80,7 @@ class _OfferCardState extends State { ), boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, diff --git a/lib/presentation/pages/add_photo_screen.dart b/lib/presentation/pages/add_photo_screen.dart index e0b713d..112d82c 100644 --- a/lib/presentation/pages/add_photo_screen.dart +++ b/lib/presentation/pages/add_photo_screen.dart @@ -188,6 +188,7 @@ class AddPhotoScreen extends StatelessWidget { ), boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.08), blurRadius: 10, offset: const Offset(0, 4), @@ -321,6 +322,7 @@ class AddPhotoScreen extends StatelessWidget { shape: BoxShape.circle, boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.3), blurRadius: 8, offset: const Offset(0, 4), diff --git a/lib/presentation/pages/notification_preferences_page.dart b/lib/presentation/pages/notification_preferences_page.dart index 7c9c129..978fc50 100644 --- a/lib/presentation/pages/notification_preferences_page.dart +++ b/lib/presentation/pages/notification_preferences_page.dart @@ -8,6 +8,8 @@ import 'package:proxibuy/presentation/notification_preferences/bloc/notification import 'package:proxibuy/presentation/offer/bloc/offer_bloc.dart'; import 'package:proxibuy/presentation/offer/bloc/offer_event.dart'; import 'package:proxibuy/presentation/pages/offers_page.dart'; +import 'package:proxibuy/presentation/pages/reserved_list_page.dart'; +import 'package:proxibuy/presentation/reservation/cubit/reservation_cubit.dart'; import 'package:proxibuy/presentation/widgets/category_selection_card.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -31,17 +33,65 @@ class NotificationPreferencesPage extends StatelessWidget { child: Assets.icons.logoWithName.svg(height: 40, width: 200), ), actions: [ - IconButton( - onPressed: () { - // TODO: Navigate to notifications page + IconButton(onPressed: () {}, icon: Assets.icons.notification.svg()), + BlocBuilder( + builder: (context, state) { + final reservedCount = state.reservedProductIds.length; + + return Stack( + alignment: Alignment.center, + children: [ + IconButton( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const ReservedListPage(), + ), + ); + }, + icon: Assets.icons.scanBarcode.svg(), + ), + if (reservedCount > 0) + Positioned( + top: 0, + right: 2, + child: GestureDetector( + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const ReservedListPage(), + ), + ); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.green, + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 1.5), + ), + constraints: const BoxConstraints( + minWidth: 18, + minHeight: 18, + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(2, 4, 2, 2), + child: Text( + '$reservedCount', + style: const TextStyle( + color: Colors.white, + fontSize: 11, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + ), + ), + ), + ), + ], + ); }, - icon: Assets.icons.notification.svg(), - ), - IconButton( - onPressed: () { - // TODO: Navigate to QR codes page - }, - icon: Assets.icons.scanBarcode.svg(), ), const SizedBox(width: 8), ], @@ -73,7 +123,7 @@ class NotificationPreferencesPage extends StatelessWidget { TextSpan( text: 'ترجیح می‌دی از کدام دسته‌بندی‌ها اعلان تخفیف دریافت کنی؟ ', - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14), ), TextSpan(text: '(حداقل یک مورد رو انتخاب کن).'), ], @@ -105,33 +155,39 @@ class NotificationPreferencesPage extends StatelessWidget { final itemHeight = itemWidth / childAspectRatio; return SingleChildScrollView( - child: Wrap( - alignment: WrapAlignment.center, - spacing: crossAxisSpacing, - runSpacing: mainAxisSpacing, - children: - state.categories.map((category) { - final isSelected = state.selectedCategoryIds - .contains(category.id); - return SizedBox( - width: itemWidth, - height: itemHeight, - child: CategorySelectionCard( - name: category.name, - icon: category.icon, - isSelected: isSelected, - showSelectableIndicator: - state.selectedCategoryIds.isNotEmpty, - onTap: () { - context - .read() - .add( - ToggleCategorySelection(category.id), - ); - }, - ), - ); - }).toList(), + child: Center( + child: Wrap( + alignment: WrapAlignment.center, + spacing: crossAxisSpacing, + runSpacing: mainAxisSpacing, + children: + state.categories.map((category) { + final isSelected = state.selectedCategoryIds + .contains(category.id); + return SizedBox( + width: 100, + height: itemHeight, + child: Center( + child: CategorySelectionCard( + name: category.name, + icon: category.icon, + isSelected: isSelected, + showSelectableIndicator: + state.selectedCategoryIds.isNotEmpty, + onTap: () { + context + .read() + .add( + ToggleCategorySelection( + category.id, + ), + ); + }, + ), + ), + ); + }).toList(), + ), ), ); }, @@ -212,7 +268,7 @@ class NotificationPreferencesPage extends StatelessWidget { ); }, ), - const SizedBox(height: 40), + const SizedBox(height: 20), ], ), ), diff --git a/lib/presentation/pages/offers_page.dart b/lib/presentation/pages/offers_page.dart index 1c1594f..203148c 100644 --- a/lib/presentation/pages/offers_page.dart +++ b/lib/presentation/pages/offers_page.dart @@ -158,58 +158,71 @@ class _OffersPageState extends State { child: Assets.icons.logoWithName.svg(height: 40, width: 200), ), actions: [ - IconButton(onPressed: () {}, icon: Assets.icons.notification.svg()), - BlocBuilder( - builder: (context, state) { - final reservedCount = state.reservedProductIds.length; + IconButton(onPressed: () {}, icon: Assets.icons.notification.svg()), + BlocBuilder( + builder: (context, state) { + final reservedCount = state.reservedProductIds.length; - return Stack( - alignment: Alignment.center, - children: [ - IconButton( - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (_) => const ReservedListPage()), - ); - }, - icon: Assets.icons.scanBarcode.svg(), - ), - if (reservedCount > 0) - Positioned( - top: 0, - right: 2, - child: Container( - padding: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: Colors.green, - shape: BoxShape.circle, - border: Border.all(color: Colors.white, width: 1.5), - ), - constraints: const BoxConstraints( - minWidth: 18, - minHeight: 18, - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(2, 4, 2, 2), - child: Text( - '$reservedCount', - style: const TextStyle( - color: Colors.white, - fontSize: 11, - fontWeight: FontWeight.bold, + return Stack( + alignment: Alignment.center, + children: [ + IconButton( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const ReservedListPage(), + ), + ); + }, + icon: Assets.icons.scanBarcode.svg(), + ), + if (reservedCount > 0) + Positioned( + top: 0, + right: 2, + child: GestureDetector( + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => const ReservedListPage(), + ), + ); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.green, + shape: BoxShape.circle, + border: Border.all( + color: Colors.white, + width: 1.5, + ), + ), + constraints: const BoxConstraints( + minWidth: 18, + minHeight: 18, + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(2, 4, 2, 2), + child: Text( + '$reservedCount', + style: const TextStyle( + color: Colors.white, + fontSize: 11, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), ), - textAlign: TextAlign.center, ), ), ), - ), - ], - ); - }, - ), - const SizedBox(width: 8), - ], + ], + ); + }, + ), + const SizedBox(width: 8), + ], ), body: SingleChildScrollView( child: Column( diff --git a/lib/presentation/pages/onboarding_page.dart b/lib/presentation/pages/onboarding_page.dart index f569cdf..80fbbd9 100644 --- a/lib/presentation/pages/onboarding_page.dart +++ b/lib/presentation/pages/onboarding_page.dart @@ -157,12 +157,11 @@ class _OnboardingPageState extends State { ), ),), Positioned( - bottom: 85, + bottom: 90, left: 24, right: 24, child: Column( children: [ - const SizedBox(height: 40), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -173,7 +172,7 @@ class _OnboardingPageState extends State { context, ).textTheme.headlineSmall?.copyWith( fontWeight: FontWeight.bold, - fontSize: 20, + fontSize: 18, color: Colors.white ), @@ -183,7 +182,9 @@ class _OnboardingPageState extends State { onboardingPages[_currentPage].description, textAlign: TextAlign.right, style: Theme.of(context).textTheme.bodyLarge?.copyWith( + // ignore: deprecated_member_use color: Colors.white.withOpacity(0.8), + fontSize: 16, height: 1.5, ), ), diff --git a/lib/presentation/pages/otp_page.dart b/lib/presentation/pages/otp_page.dart index ede236b..b8d3340 100644 --- a/lib/presentation/pages/otp_page.dart +++ b/lib/presentation/pages/otp_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/svg.dart'; @@ -18,8 +17,10 @@ class OtpPage extends StatefulWidget { class _OtpPageState extends State { final List _focusNodes = List.generate(5, (_) => FocusNode()); - final List _controllers = - List.generate(5, (_) => TextEditingController()); + final List _controllers = List.generate( + 5, + (_) => TextEditingController(), + ); late final OtpTimerHelper _otpTimer; bool _hasError = false; @@ -54,7 +55,6 @@ class _OtpPageState extends State { return Directionality( textDirection: TextDirection.rtl, child: Scaffold( - appBar: AppBar(backgroundColor: Colors.transparent, elevation: 0), body: SafeArea( child: SingleChildScrollView( padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16), @@ -70,14 +70,28 @@ class _OtpPageState extends State { ), ), const SizedBox(height: 12), - Text( - "کد تایید به شماره ${widget.phoneNumber} ارسال شد.", - style: textTheme.titleMedium?.copyWith( - color: Colors.grey, - height: 1.5, + Text.rich( + TextSpan( + style: textTheme.titleMedium?.copyWith( + color: Colors.grey, + height: 1.5, + ), + children: [ + const TextSpan(text: 'کد تایید به شماره ',style: TextStyle(fontSize: 15)), + TextSpan( + text: widget.phoneNumber, + style: const TextStyle( + fontWeight: + FontWeight.bold, + fontSize: 15 + ), + ), + const TextSpan(text: ' ارسال شد.',style: TextStyle(fontSize: 15)), + ], ), + textDirection: TextDirection.rtl, // جهت متن برای RichText ), - SizedBox(height: 15,), + SizedBox(height: 15), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -85,7 +99,10 @@ class _OtpPageState extends State { const SizedBox(width: 4), TextButton( onPressed: () => Navigator.of(context).pop(), - child: const Text("ویرایش شماره همراه",style: TextStyle(color: AppColors.active),), + child: const Text( + "ویرایش شماره همراه", + style: TextStyle(color: AppColors.active), + ), ), ], ), @@ -118,9 +135,7 @@ class _OtpPageState extends State { } if (state is AuthVerified) { Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute( - builder: (_) => const UserInfoPage(), - ), + MaterialPageRoute(builder: (_) => const UserInfoPage()), (route) => false, ); } @@ -155,16 +170,20 @@ class _OtpPageState extends State { builder: (context, canResend, child) { return canResend ? TextButton( - onPressed: _resendOtp, - child: const Text("ارسال مجدد کد",style: TextStyle(color: AppColors.active),), - ) + onPressed: _resendOtp, + child: const Text( + "ارسال مجدد کد", + style: TextStyle(color: AppColors.active), + ), + ) : ValueListenableBuilder( - valueListenable: _otpTimer.remainingSeconds, - builder: (context, seconds, child) => Text( - "${_otpTimer.formatTime()} تا دریافت مجدد", - style: const TextStyle(color: Colors.grey), - ), - ); + valueListenable: _otpTimer.remainingSeconds, + builder: + (context, seconds, child) => Text( + "${_otpTimer.formatTime()} تا دریافت مجدد", + style: const TextStyle(color: Colors.grey), + ), + ); }, ), ], @@ -202,14 +221,15 @@ class _OtpPageState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide( - color: _hasError - ? Colors.red - : (Theme.of(context) - .inputDecorationTheme - .enabledBorder - ?.borderSide - .color ?? - Colors.grey), + color: + _hasError + ? Colors.red + : (Theme.of(context) + .inputDecorationTheme + .enabledBorder + ?.borderSide + .color ?? + Colors.grey), ), ), focusedBorder: OutlineInputBorder( @@ -264,4 +284,4 @@ class _OtpPageState extends State { context.read().add(SendOTPEvent(phoneNumber: widget.phoneNumber)); _otpTimer.resetTimer(); } -} \ No newline at end of file +} diff --git a/lib/presentation/pages/product_detail_page.dart b/lib/presentation/pages/product_detail_page.dart index 97146c6..2c5143d 100644 --- a/lib/presentation/pages/product_detail_page.dart +++ b/lib/presentation/pages/product_detail_page.dart @@ -263,6 +263,7 @@ class _ProductDetailViewState extends State { borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.15), blurRadius: 7, spreadRadius: 0, diff --git a/lib/presentation/pages/reservation_details_screen.dart b/lib/presentation/pages/reservation_details_screen.dart index f3efe74..3d0aece 100644 --- a/lib/presentation/pages/reservation_details_screen.dart +++ b/lib/presentation/pages/reservation_details_screen.dart @@ -63,44 +63,46 @@ class _ReservationConfirmationPageState extends State { ), boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.08), blurRadius: 10, offset: const Offset(0, 4), diff --git a/lib/presentation/pages/user_info_page.dart b/lib/presentation/pages/user_info_page.dart index 1eae480..d239d82 100644 --- a/lib/presentation/pages/user_info_page.dart +++ b/lib/presentation/pages/user_info_page.dart @@ -76,6 +76,7 @@ class _UserInfoPageState extends State { width: 50, height: 5, decoration: BoxDecoration( + // ignore: deprecated_member_use color:Colors.grey.withOpacity(0.5), borderRadius: BorderRadius.circular(12), ), @@ -113,7 +114,7 @@ class _UserInfoPageState extends State { _buildGenderRadio('تمایلی به پاسخ ندارم', 'نامشخص'), ], ), - const SizedBox(height: 70), + const SizedBox(height: 55), BlocConsumer( listener: (context, state) { @@ -154,7 +155,7 @@ class _UserInfoPageState extends State { Center( child: TextButton( onPressed: () { - Navigator.of(context).push(NotificationPreferencesPage.route()); + Navigator.of(context).pushReplacement(NotificationPreferencesPage.route()); }, child: const Text( "رد شدن", diff --git a/lib/presentation/product_detail/bloc/product_detail_bloc.dart b/lib/presentation/product_detail/bloc/product_detail_bloc.dart index bdbc23e..f4cba02 100644 --- a/lib/presentation/product_detail/bloc/product_detail_bloc.dart +++ b/lib/presentation/product_detail/bloc/product_detail_bloc.dart @@ -1,3 +1,4 @@ +// ignore: depend_on_referenced_packages import 'package:bloc/bloc.dart'; import 'package:proxibuy/data/repositories/offer_repository.dart'; import 'package:proxibuy/presentation/product_detail/bloc/product_detail_event.dart'; diff --git a/lib/presentation/reservation/cubit/reservation_cubit.dart b/lib/presentation/reservation/cubit/reservation_cubit.dart index f3e5c00..7ef449d 100644 --- a/lib/presentation/reservation/cubit/reservation_cubit.dart +++ b/lib/presentation/reservation/cubit/reservation_cubit.dart @@ -1,3 +1,4 @@ +// ignore: depend_on_referenced_packages import 'package:bloc/bloc.dart'; part 'reservation_state.dart'; @@ -10,10 +11,8 @@ class ReservationCubit extends Cubit { final updatedList = List.from(state.reservedProductIds)..add(productId); emit(state.copyWith(reservedProductIds: updatedList)); - // در اینجا می‌توانید لاگیک مربوط به ارسال درخواست به API را نیز اضافه کنید } - // متد برای بررسی اینکه آیا یک محصول خاص رزرو شده است یا نه bool isProductReserved(String productId) { return state.reservedProductIds.contains(productId); } diff --git a/lib/presentation/widgets/category_selection_card.dart b/lib/presentation/widgets/category_selection_card.dart index f1fcd9f..4511b1b 100644 --- a/lib/presentation/widgets/category_selection_card.dart +++ b/lib/presentation/widgets/category_selection_card.dart @@ -11,13 +11,13 @@ class CategorySelectionCard extends StatelessWidget { final VoidCallback onTap; const CategorySelectionCard({ - Key? key, + super.key, required this.name, required this.icon, required this.isSelected, required this.showSelectableIndicator, required this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -44,6 +44,7 @@ class CategorySelectionCard extends StatelessWidget { boxShadow: isSelected ? [ BoxShadow( + // ignore: deprecated_member_use color: AppColors.confirm.withOpacity(0.25), blurRadius: 8, spreadRadius: 2, diff --git a/lib/presentation/widgets/flutter_staggered_grid_view.dart b/lib/presentation/widgets/flutter_staggered_grid_view.dart index f09e039..78adabd 100644 --- a/lib/presentation/widgets/flutter_staggered_grid_view.dart +++ b/lib/presentation/widgets/flutter_staggered_grid_view.dart @@ -35,8 +35,9 @@ class PhotoGalleryView extends StatelessWidget { child: Stack( fit: StackFit.expand, children: [ - _buildSmartImage(imageUrl), // از ویجت هوشمند استفاده می‌کنیم + _buildSmartImage(imageUrl), Container( + // ignore: deprecated_member_use color: Colors.white.withOpacity(0.7), child: Center( child: Text( diff --git a/lib/presentation/widgets/gps_dialog.dart b/lib/presentation/widgets/gps_dialog.dart index 320dc47..117232e 100644 --- a/lib/presentation/widgets/gps_dialog.dart +++ b/lib/presentation/widgets/gps_dialog.dart @@ -8,6 +8,7 @@ Future showGPSDialog(BuildContext context) async { bool isLocationEnabled = await Geolocator.isLocationServiceEnabled(); if (!isLocationEnabled) { await showDialog( + // ignore: use_build_context_synchronously context: context, barrierDismissible: false, builder: (BuildContext context) { @@ -67,6 +68,7 @@ Future showGPSDialog(BuildContext context) async { ), onPressed: () async { await Geolocator.openLocationSettings(); + // ignore: use_build_context_synchronously Navigator.of(context).pop(); }, child: const Text( @@ -86,6 +88,7 @@ Future showGPSDialog(BuildContext context) async { shape: BoxShape.circle, boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.3), blurRadius: 8, offset: const Offset(0, 4), diff --git a/lib/presentation/widgets/notification_permission_dialog.dart b/lib/presentation/widgets/notification_permission_dialog.dart index be952c7..3e72a46 100644 --- a/lib/presentation/widgets/notification_permission_dialog.dart +++ b/lib/presentation/widgets/notification_permission_dialog.dart @@ -11,6 +11,7 @@ Future showNotificationPermissionDialog(BuildContext context) async { } await showDialog( + // ignore: use_build_context_synchronously context: context, barrierDismissible: false, builder: (BuildContext dialogContext) { @@ -77,6 +78,7 @@ Future showNotificationPermissionDialog(BuildContext context) async { final result = await Permission.notification.request(); if (result.isGranted) { + // ignore: use_build_context_synchronously Navigator.of(dialogContext).pop(); } else { openAppSettings(); @@ -99,6 +101,7 @@ Future showNotificationPermissionDialog(BuildContext context) async { shape: BoxShape.circle, boxShadow: [ BoxShadow( + // ignore: deprecated_member_use color: Colors.black.withOpacity(0.3), blurRadius: 8, offset: const Offset(0, 4), diff --git a/lib/presentation/widgets/reserved_list_item_card.dart b/lib/presentation/widgets/reserved_list_item_card.dart index 9411ce4..3a471b2 100644 --- a/lib/presentation/widgets/reserved_list_item_card.dart +++ b/lib/presentation/widgets/reserved_list_item_card.dart @@ -55,6 +55,7 @@ class _ReservedListItemCardState extends State { super.dispose(); } + // ignore: unused_element String _formatDuration(Duration duration) { if (duration.inSeconds <= 0) return "پایان یافته"; final hours = duration.inHours.toString().padLeft(2, '0'); diff --git a/lib/presentation/widgets/user_comment_card.dart b/lib/presentation/widgets/user_comment_card.dart index ef49d08..f33a59b 100644 --- a/lib/presentation/widgets/user_comment_card.dart +++ b/lib/presentation/widgets/user_comment_card.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +// ignore: depend_on_referenced_packages import 'package:intl/intl.dart' as intl; import 'package:proxibuy/core/config/app_colors.dart'; import 'package:proxibuy/core/gen/assets.gen.dart';