diff --git a/lib/custom_painters/language_icon.dart b/lib/custom_painters/language_icon.dart index dbc2d1d87..e7b6aea6a 100644 --- a/lib/custom_painters/language_icon.dart +++ b/lib/custom_painters/language_icon.dart @@ -319,7 +319,7 @@ class LanguageIcon extends CustomPainter { path_0.close(); final Paint paint0fill = Paint()..style = PaintingStyle.fill; - paint0fill.color = const Color(0xff737373).withOpacity(1.0); + paint0fill.color = const Color(0xff737373).withAlpha((1.0*255).toInt()); canvas.drawPath(path_0, paint0fill); } diff --git a/lib/custom_painters/talawa_logo.dart b/lib/custom_painters/talawa_logo.dart index f10f32b7e..4cd054739 100644 --- a/lib/custom_painters/talawa_logo.dart +++ b/lib/custom_painters/talawa_logo.dart @@ -166,7 +166,7 @@ class AppLogo extends CustomPainter { path_0.close(); final Paint paint0fill = Paint()..style = PaintingStyle.fill; - paint0fill.color = const Color(0xff31BB6B).withOpacity(1.0); + paint0fill.color = const Color(0xff31BB6B).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_0, paint0fill); final Path path_1 = Path(); @@ -270,7 +270,7 @@ class AppLogo extends CustomPainter { path_1.close(); final Paint paint1fill = Paint()..style = PaintingStyle.fill; - paint1fill.color = const Color(0xffFEBC59).withOpacity(1.0); + paint1fill.color = const Color(0xffFEBC59).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_1, paint1fill); final Path path_2 = Path(); @@ -342,7 +342,7 @@ class AppLogo extends CustomPainter { path_2.close(); final Paint paint2fill = Paint()..style = PaintingStyle.fill; - paint2fill.color = const Color(0xff737373).withOpacity(1.0); + paint2fill.color = const Color(0xff737373).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_2, paint2fill); final Path path_3 = Path(); @@ -422,7 +422,7 @@ class AppLogo extends CustomPainter { path_3.close(); final Paint paint3fill = Paint()..style = PaintingStyle.fill; - paint3fill.color = const Color(0xff737373).withOpacity(1.0); + paint3fill.color = const Color(0xff737373).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_3, paint3fill); } diff --git a/lib/custom_painters/telegram_logo.dart b/lib/custom_painters/telegram_logo.dart index 7519d7bb4..a1242a3a3 100644 --- a/lib/custom_painters/telegram_logo.dart +++ b/lib/custom_painters/telegram_logo.dart @@ -17,8 +17,8 @@ class TelegramLogo extends CustomPainter { paint0Fill.shader = ui.Gradient.linear( Offset(size.width * 0.6670000, size.height * 0.1670000), Offset(size.width * 0.4170000, size.height * 0.7500000), [ - const Color(0xff37aee2).withOpacity(1), - const Color(0xff1e96c8).withOpacity(1), + const Color(0xff37aee2).withAlpha((1.0 * 255).toInt()), + const Color(0xff1e96c8).withAlpha((1.0 * 255).toInt()), ], [ 0, 1, @@ -43,7 +43,7 @@ class TelegramLogo extends CustomPainter { path_1.lineTo(size.width * 0.7083333, size.height * 0.3333333); final Paint paint1Fill = Paint()..style = PaintingStyle.fill; - paint1Fill.color = const Color(0xffc8daea).withOpacity(1.0); + paint1Fill.color = const Color(0xffc8daea).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_1, paint1Fill); final Path path_2 = Path(); @@ -60,7 +60,7 @@ class TelegramLogo extends CustomPainter { path_2.lineTo(size.width * 0.4168417, size.height * 0.6016958); final Paint paint2Fill = Paint()..style = PaintingStyle.fill; - paint2Fill.color = const Color(0xffa9c9dd).withOpacity(1.0); + paint2Fill.color = const Color(0xffa9c9dd).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_2, paint2Fill); final Path path_3 = Path(); @@ -107,8 +107,8 @@ class TelegramLogo extends CustomPainter { paint3Fill.shader = ui.Gradient.linear( Offset(size.width * 0.6600000, size.height * 0.4370000), Offset(size.width * 0.8510000, size.height * 0.8020000), [ - const Color(0xffeff7fc).withOpacity(1), - const Color(0xffffffff).withOpacity(1), + const Color(0xffeff7fc).withAlpha((1.0 * 255).toInt()), + const Color(0xffffffff).withAlpha((1.0 * 255).toInt()), ], [ 0, 1, diff --git a/lib/custom_painters/whatsapp_logo.dart b/lib/custom_painters/whatsapp_logo.dart index fb150dd35..302176b37 100644 --- a/lib/custom_painters/whatsapp_logo.dart +++ b/lib/custom_painters/whatsapp_logo.dart @@ -103,7 +103,7 @@ class WhatsappLogo extends CustomPainter { ); final Paint paint0Fill = Paint()..style = PaintingStyle.fill; - paint0Fill.color = const Color(0xff40c351).withOpacity(1.0); + paint0Fill.color = const Color(0xff40c351).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_0, paint0Fill); final Path path_1 = Path(); @@ -422,7 +422,7 @@ class WhatsappLogo extends CustomPainter { path_1.close(); final Paint paint1fill = Paint()..style = PaintingStyle.fill; - paint1fill.color = const Color(0xfffcfcfc).withOpacity(1.0); + paint1fill.color = const Color(0xfffcfcfc).withAlpha((1.0 * 255).toInt()); canvas.drawPath(path_1, paint1fill); } diff --git a/lib/services/navigation_service.dart b/lib/services/navigation_service.dart index c82e033ff..78863f485 100644 --- a/lib/services/navigation_service.dart +++ b/lib/services/navigation_service.dart @@ -204,7 +204,7 @@ class NavigationService { Icons.error_outline, color: Colors.redAccent, ), - color: Colors.black.withOpacity(0.8), + color: Colors.black.withAlpha((1.0 * 255).toInt()), ); }, ).show(navigatorKey.currentContext!); diff --git a/lib/view_model/access_request_view_model.dart b/lib/view_model/access_request_view_model.dart index e630a709a..0773c77a2 100644 --- a/lib/view_model/access_request_view_model.dart +++ b/lib/view_model/access_request_view_model.dart @@ -44,7 +44,7 @@ class AccessScreenViewModel extends BaseModel { ); if (result.data != null) { final OrgInfo membershipRequest = OrgInfo.fromJson( - ((result.data!)['sendMembershipRequest'] + (result.data!['sendMembershipRequest'] as Map)['organization'] as Map, ); userConfig.updateUserMemberRequestOrg([membershipRequest]); diff --git a/lib/view_model/main_screen_view_model.dart b/lib/view_model/main_screen_view_model.dart index 44830316f..8d68f1d3b 100644 --- a/lib/view_model/main_screen_view_model.dart +++ b/lib/view_model/main_screen_view_model.dart @@ -178,7 +178,7 @@ class MainScreenViewModel extends BaseModel { currentPageIndex = mainScreenIndex; showAppTour = fromSignUp || demoMode; context = ctx; - + final appTourDialogWidget = appTourDialog(ctx); print(ctx); print(context); pluginPrototypeData = { @@ -196,7 +196,7 @@ class MainScreenViewModel extends BaseModel { Future.delayed( const Duration(seconds: 1), () => navigationService.pushDialog( - appTourDialog(ctx), + appTourDialogWidget, ), ); } diff --git a/lib/views/after_auth_screens/chat/widgets/chat_input_field.dart b/lib/views/after_auth_screens/chat/widgets/chat_input_field.dart index c9606800d..0fa2cab6e 100644 --- a/lib/views/after_auth_screens/chat/widgets/chat_input_field.dart +++ b/lib/views/after_auth_screens/chat/widgets/chat_input_field.dart @@ -51,7 +51,7 @@ class _ChatInputFieldState extends State { BoxShadow( offset: const Offset(0, 4), blurRadius: 32, - color: const Color(0xFF087949).withOpacity(0.08), + color: const Color(0xFF087949).withAlpha((0.08 * 255).toInt()), ), ], ), @@ -94,7 +94,7 @@ class _ChatInputFieldState extends State { .textTheme .bodyLarge! .color! - .withOpacity(0.64), + .withAlpha((0.64 * 255).toInt()), ), ), // Placeholder text for the text field diff --git a/lib/views/after_auth_screens/events/edit_agenda_item_page.dart b/lib/views/after_auth_screens/events/edit_agenda_item_page.dart index f620c3c63..0fd7e63bd 100644 --- a/lib/views/after_auth_screens/events/edit_agenda_item_page.dart +++ b/lib/views/after_auth_screens/events/edit_agenda_item_page.dart @@ -79,7 +79,7 @@ class _EditAgendaItemPageState extends State { Icons.error_outline, color: Colors.redAccent, ), - color: Colors.black.withOpacity(0.8), + color: Colors.black.withAlpha((0.8 * 255).toInt()), ); }, ).show(context); diff --git a/lib/views/after_auth_screens/events/manage_agenda_items_screen.dart b/lib/views/after_auth_screens/events/manage_agenda_items_screen.dart index 0c27135b0..8ef7acc3e 100644 --- a/lib/views/after_auth_screens/events/manage_agenda_items_screen.dart +++ b/lib/views/after_auth_screens/events/manage_agenda_items_screen.dart @@ -77,7 +77,7 @@ class ManageAgendaScreen extends StatelessWidget { Icons.error_outline, color: Colors.redAccent, ), - color: Colors.black.withOpacity(0.8), + color: Colors.black.withAlpha((0.8 * 255).toInt()), ); }, ).show(context); diff --git a/lib/views/after_auth_screens/feed/individual_post.dart b/lib/views/after_auth_screens/feed/individual_post.dart index 8718fe18c..885262424 100644 --- a/lib/views/after_auth_screens/feed/individual_post.dart +++ b/lib/views/after_auth_screens/feed/individual_post.dart @@ -242,7 +242,7 @@ class CommentTemplate extends StatelessWidget { Expanded( child: Container( decoration: BoxDecoration( - color: Theme.of(context).iconTheme.color!.withOpacity(0.2), + color: Theme.of(context).iconTheme.color!.withAlpha((0.2 * 255).toInt()), borderRadius: const BorderRadius.all(Radius.circular(8)), ), padding: const EdgeInsets.all(16.0), diff --git a/lib/views/after_auth_screens/org_info_screen.dart b/lib/views/after_auth_screens/org_info_screen.dart index bb34827fd..b5207b77b 100644 --- a/lib/views/after_auth_screens/org_info_screen.dart +++ b/lib/views/after_auth_screens/org_info_screen.dart @@ -99,7 +99,7 @@ class OrganisationInfoScreen extends StatelessWidget { height: imageHeight, width: double.infinity, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.55), + color: Colors.black.withAlpha((0.55 * 255).toInt()), borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(20.0), bottomRight: Radius.circular(20.0), @@ -341,7 +341,7 @@ class OrganisationInfoScreen extends StatelessWidget { borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.5), + color: Colors.grey.withAlpha((0.5 * 255).toInt()), spreadRadius: 1, blurRadius: Theme.of(context).brightness == Brightness.dark diff --git a/lib/views/after_auth_screens/profile/edit_profile_page.dart b/lib/views/after_auth_screens/profile/edit_profile_page.dart index 8dcd77fdf..27f0424ea 100644 --- a/lib/views/after_auth_screens/profile/edit_profile_page.dart +++ b/lib/views/after_auth_screens/profile/edit_profile_page.dart @@ -57,7 +57,7 @@ class _EditProfilePageState extends State { : null, backgroundColor: model.imageFile == null && model.user.image == null - ? Colors.grey.withOpacity(0.2) + ? Colors.grey.withAlpha((0.2 * 255).toInt()) : null, child: model.imageFile == null ? model.user.image == null diff --git a/lib/views/pre_auth_screens/select_language.dart b/lib/views/pre_auth_screens/select_language.dart index ef71ca2b1..9275d7404 100644 --- a/lib/views/pre_auth_screens/select_language.dart +++ b/lib/views/pre_auth_screens/select_language.dart @@ -90,7 +90,7 @@ class _SelectLanguageState extends State { decoration: BoxDecoration( color: languages[index].langCode == appLang.appLocal.languageCode - ? const Color(0xFFC4C4C4).withOpacity(0.15) + ? const Color(0xFFC4C4C4).withAlpha((0.15 * 255).toInt()) : Colors.transparent, ), child: index == 0 diff --git a/lib/views/pre_auth_screens/set_url.dart b/lib/views/pre_auth_screens/set_url.dart index ebc451f37..3314cde33 100644 --- a/lib/views/pre_auth_screens/set_url.dart +++ b/lib/views/pre_auth_screens/set_url.dart @@ -216,7 +216,7 @@ class _SetUrlState extends State { color: Theme.of(context) .colorScheme .surface - .withOpacity(0.8), + .withAlpha((0.8 * 255).toInt()), ), ), ], diff --git a/lib/widgets/agenda_item_tile.dart b/lib/widgets/agenda_item_tile.dart index 991d6ac3c..a4235c9a8 100644 --- a/lib/widgets/agenda_item_tile.dart +++ b/lib/widgets/agenda_item_tile.dart @@ -181,7 +181,7 @@ class ExpandableAgendaItemTile extends StatelessWidget { return GestureDetector( onTap: () => Navigator.of(context).pop(), child: ColoredBox( - color: Colors.black.withOpacity(0.5), + color: Colors.black.withAlpha((0.5 * 255).toInt()), child: Center( child: InteractiveViewer( panEnabled: true, diff --git a/lib/widgets/create_recurring_event_helper_widgets.dart b/lib/widgets/create_recurring_event_helper_widgets.dart index df3d0240e..b2f4fdaa7 100644 --- a/lib/widgets/create_recurring_event_helper_widgets.dart +++ b/lib/widgets/create_recurring_event_helper_widgets.dart @@ -235,7 +235,7 @@ class _EventEndOptionsState extends State { : TextStyle( color: Theme.of(context) .dividerColor - .withOpacity(0.4), + .withAlpha((0.4 * 255).toInt()), ), ), ), diff --git a/lib/widgets/custom_avatar.dart b/lib/widgets/custom_avatar.dart index 7d8ce4343..8250b971f 100644 --- a/lib/widgets/custom_avatar.dart +++ b/lib/widgets/custom_avatar.dart @@ -42,7 +42,7 @@ class CustomAvatar extends StatelessWidget { //creating the avatar with the icon-theme color when the image is null ? CircleAvatar( backgroundColor: - Theme.of(context).iconTheme.color!.withOpacity(0.2), + Theme.of(context).iconTheme.color!.withAlpha((0.2 * 255).toInt()), maxRadius: maxRadius, child: Center( child: Text( @@ -60,7 +60,7 @@ class CustomAvatar extends StatelessWidget { imageBuilder: (context, imageProvider) { return CircleAvatar( backgroundColor: - Theme.of(context).iconTheme.color!.withOpacity(0.2), + Theme.of(context).iconTheme.color!.withAlpha((0.2 * 255).toInt()), backgroundImage: imageProvider, ); }, diff --git a/lib/widgets/custom_list_tile.dart b/lib/widgets/custom_list_tile.dart index 9b0e9114a..9c9e45061 100644 --- a/lib/widgets/custom_list_tile.dart +++ b/lib/widgets/custom_list_tile.dart @@ -87,7 +87,7 @@ class CustomListTile extends StatelessWidget { borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.5), + color: Colors.grey.withAlpha((0.5 * 255).toInt()), spreadRadius: 1, blurRadius: 6, offset: const Offset(0, 3), diff --git a/lib/widgets/custom_weekday_selector.dart b/lib/widgets/custom_weekday_selector.dart index f46ef92d1..f81d66815 100644 --- a/lib/widgets/custom_weekday_selector.dart +++ b/lib/widgets/custom_weekday_selector.dart @@ -38,7 +38,7 @@ class _CustomWeekDaySelectorState extends State { height: 30, decoration: BoxDecoration( color: weekdays.contains(weekday) - ? Theme.of(context).colorScheme.primary.withOpacity(0.5) + ? Theme.of(context).colorScheme.primary.withAlpha((0.5 * 255).toInt()) : Colors.transparent, border: Border.all( width: weekdays.contains(weekday) ? 2 : 1, diff --git a/lib/widgets/event_card.dart b/lib/widgets/event_card.dart index 52480d78b..5e796478e 100644 --- a/lib/widgets/event_card.dart +++ b/lib/widgets/event_card.dart @@ -56,7 +56,7 @@ class EventCard extends StatelessWidget { height: SizeConfig.screenHeight! * 0.11, width: double.infinity, decoration: BoxDecoration( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withAlpha((0.3 * 255).toInt()), image: const DecorationImage( fit: BoxFit.fitWidth, alignment: FractionalOffset.topCenter, @@ -68,7 +68,7 @@ class EventCard extends StatelessWidget { filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), child: Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(0.0), + color: Colors.white.withAlpha((0.0 * 255).toInt()), ), ), ), diff --git a/lib/widgets/pinned_carousel_widget.dart b/lib/widgets/pinned_carousel_widget.dart index b4f5bcf58..77d41ee7e 100644 --- a/lib/widgets/pinned_carousel_widget.dart +++ b/lib/widgets/pinned_carousel_widget.dart @@ -30,7 +30,7 @@ class PinnedPostCarousel extends StatelessWidget { Container( height: 220, color: - Theme.of(context).colorScheme.primaryContainer.withOpacity(0.5), + Theme.of(context).colorScheme.primaryContainer.withAlpha((0.5 * 255).toInt()), child: CustomCarouselScroller( pinnedPosts: pinnedPosts, key: const Key('Carousel'), diff --git a/lib/widgets/venue_card.dart b/lib/widgets/venue_card.dart index 7d2a1e685..55c28be57 100644 --- a/lib/widgets/venue_card.dart +++ b/lib/widgets/venue_card.dart @@ -36,7 +36,7 @@ class VenueCard extends StatelessWidget { ), elevation: 3, color: isSelected - ? Colors.blue.withOpacity(0.3) + ? Colors.blue.withAlpha((0.3 * 255).toInt()) : Theme.of(context).primaryColor, child: Column( children: [ @@ -47,7 +47,7 @@ class VenueCard extends StatelessWidget { height: SizeConfig.screenHeight! * 0.11, width: double.infinity, decoration: BoxDecoration( - color: Colors.grey.withOpacity(0.3), + color: Colors.grey.withAlpha((0.3 * 255).toInt()), image: DecorationImage( fit: BoxFit.fitWidth, alignment: FractionalOffset.topCenter, diff --git a/talawa_lint/lib/talawa_api_doc/talawa_api_doc_fixer.dart b/talawa_lint/lib/talawa_api_doc/talawa_api_doc_fixer.dart index 09f18c32e..191bf95d0 100644 --- a/talawa_lint/lib/talawa_api_doc/talawa_api_doc_fixer.dart +++ b/talawa_lint/lib/talawa_api_doc/talawa_api_doc_fixer.dart @@ -82,7 +82,9 @@ class TalawaAPIDocFixer extends DartFix { node.offset, node.leftBracket.offset - node.offset, ), - )) return; + )) { + return; + } // The same issue exists for Functions and Methods. We can define functions // inside functions, and the same overlap of [SourceRange] occurs due to that @@ -95,7 +97,9 @@ class TalawaAPIDocFixer extends DartFix { node.name.length + node.name.offset) - node.offset, ), - )) return; + )) { + return; + } if (node is MethodDeclaration && !analysisError.sourceRange.intersects( @@ -104,7 +108,9 @@ class TalawaAPIDocFixer extends DartFix { (node.parameters?.offset ?? node.name.length + node.name.offset) - node.offset, ), - )) return; + )) { + return; + } final changeBuilder = reporter.createChangeBuilder( message: 'Insert Doc skeleton', diff --git a/test/views/after_auth_screens/events/manage_agenda_items_screen_test.dart b/test/views/after_auth_screens/events/manage_agenda_items_screen_test.dart index 93ab85ce1..7007a04bb 100644 --- a/test/views/after_auth_screens/events/manage_agenda_items_screen_test.dart +++ b/test/views/after_auth_screens/events/manage_agenda_items_screen_test.dart @@ -305,7 +305,7 @@ void main() { // Verify toast styling final ToastCard toastCard = tester.widget(find.byType(ToastCard)); - expect(toastCard.color, Colors.black.withOpacity(0.8)); + expect(toastCard.color, Colors.black.withAlpha((0.8 * 255).toInt())); // Wait for auto-dismiss await tester.pump(const Duration(seconds: 2)); diff --git a/test/widget_tests/pre_auth_screens/select_language_page_test.dart b/test/widget_tests/pre_auth_screens/select_language_page_test.dart index 9b762034f..21569c715 100644 --- a/test/widget_tests/pre_auth_screens/select_language_page_test.dart +++ b/test/widget_tests/pre_auth_screens/select_language_page_test.dart @@ -151,7 +151,7 @@ Future main() async { expect( (tester.firstWidget(findAppNameWidget) as Container).decoration, - BoxDecoration(color: const Color(0xFFC4C4C4).withOpacity(0.15)), + BoxDecoration(color: const Color(0xFFC4C4C4).withAlpha((0.15 * 255).toInt())), ); }); testWidgets("Testing to navigate to MainScreen", (tester) async { @@ -255,7 +255,7 @@ Future main() async { expect( (tester.firstWidget(findAppNameWidget) as Container).decoration, - BoxDecoration(color: const Color(0xFFC4C4C4).withOpacity(0.15)), + BoxDecoration(color: const Color(0xFFC4C4C4).withAlpha((0.15 * 255).toInt())), ); }); testWidgets("Testing to select and navigate button appears", diff --git a/test/widget_tests/widgets/agenda_item_tile_test.dart b/test/widget_tests/widgets/agenda_item_tile_test.dart index e0aed941b..5e06cb6a2 100644 --- a/test/widget_tests/widgets/agenda_item_tile_test.dart +++ b/test/widget_tests/widgets/agenda_item_tile_test.dart @@ -347,7 +347,7 @@ void main() { find.byWidgetPredicate( (widget) => widget is ColoredBox && - widget.color == Colors.black.withOpacity(0.5), + widget.color == Colors.black.withAlpha((0.5 * 255).toInt()), ), findsOneWidget, ); diff --git a/test/widget_tests/widgets/custom_avatar_test.dart b/test/widget_tests/widgets/custom_avatar_test.dart index 79419bf51..a4d2db2d7 100644 --- a/test/widget_tests/widgets/custom_avatar_test.dart +++ b/test/widget_tests/widgets/custom_avatar_test.dart @@ -134,7 +134,7 @@ void main() { Theme.of(tester.element(circleAvatarFinder)) .iconTheme .color! - .withOpacity(0.2), + .withAlpha((0.2 * 255).toInt()), ); }); @@ -322,7 +322,7 @@ void main() { Theme.of(widgetTester.binding.rootElement!) .iconTheme .color! - .withOpacity(0.2), + .withAlpha((0.2 * 255).toInt()), ), findsOneWidget, );