From ad3a778fb9c1940f79a75adba0eb213809cf6af2 Mon Sep 17 00:00:00 2001 From: validcube Date: Sat, 11 Nov 2023 19:07:32 +0700 Subject: [PATCH] refactor: apply lint from analyzer --- lib/main.dart | 2 +- lib/ui/theme/dynamic_theme_builder.dart | 4 +- .../views/app_selector/app_selector_view.dart | 6 +-- .../views/contributors/contributors_view.dart | 2 +- lib/ui/views/home/home_view.dart | 2 +- lib/ui/views/installer/installer_view.dart | 2 +- lib/ui/views/navigation/navigation_view.dart | 2 +- .../patch_options_viewmodel.dart | 4 +- lib/ui/views/patcher/patcher_view.dart | 2 +- .../patches_selector_view.dart | 2 +- lib/ui/views/settings/settings_view.dart | 2 +- lib/ui/views/settings/settings_viewmodel.dart | 2 +- lib/ui/widgets/appInfoView/app_info_view.dart | 4 +- .../appSelectorView/app_skeleton_loader.dart | 2 +- .../appSelectorView/installed_app_item.dart | 4 +- .../not_installed_app_item.dart | 4 +- .../contributorsView/contributors_card.dart | 4 +- .../widgets/homeView/installed_apps_card.dart | 2 +- .../widgets/homeView/latest_commit_card.dart | 4 +- .../patcherView/app_selector_card.dart | 4 +- .../patcherView/patch_selector_card.dart | 4 +- .../patchesSelectorView/patch_item.dart | 4 +- lib/ui/widgets/settingsView/about_widget.dart | 2 +- .../widgets/settingsView/custom_switch.dart | 4 +- .../settingsView/custom_switch_tile.dart | 4 +- .../settingsView/custom_text_field.dart | 4 +- ...ettings_require_suggested_app_version.dart | 2 +- .../settingsView/settings_section.dart | 4 +- .../settingsView/settings_tile_dialog.dart | 4 +- .../settingsView/social_media_item.dart | 4 +- .../settingsView/social_media_widget.dart | 4 +- lib/ui/widgets/shared/application_item.dart | 4 +- lib/ui/widgets/shared/custom_card.dart | 4 +- lib/ui/widgets/shared/custom_chip.dart | 4 +- .../shared/custom_material_button.dart | 8 ++-- lib/ui/widgets/shared/custom_popup_menu.dart | 39 ------------------- .../widgets/shared/custom_sliver_app_bar.dart | 4 +- .../shared/open_container_wrapper.dart | 4 +- lib/ui/widgets/shared/search_bar.dart | 4 +- pubspec.yaml | 2 +- 40 files changed, 67 insertions(+), 106 deletions(-) delete mode 100644 lib/ui/widgets/shared/custom_popup_menu.dart diff --git a/lib/main.dart b/lib/main.dart index c81701ba..b38cb4c7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,7 +30,7 @@ Future main() async { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/theme/dynamic_theme_builder.dart b/lib/ui/theme/dynamic_theme_builder.dart index 233c78b5..8f9fc98b 100644 --- a/lib/ui/theme/dynamic_theme_builder.dart +++ b/lib/ui/theme/dynamic_theme_builder.dart @@ -12,11 +12,11 @@ import 'package:stacked_services/stacked_services.dart'; class DynamicThemeBuilder extends StatefulWidget { const DynamicThemeBuilder({ - Key? key, + super.key, required this.title, required this.home, required this.localizationsDelegates, - }) : super(key: key); + }); final String title; final Widget home; final Iterable localizationsDelegates; diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 3d1d92ca..55890f17 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -8,7 +8,7 @@ import 'package:revanced_manager/ui/widgets/shared/search_bar.dart'; import 'package:stacked/stacked.dart' hide SkeletonLoader; class AppSelectorView extends StatefulWidget { - const AppSelectorView({Key? key}) : super(key: key); + const AppSelectorView({super.key}); @override State createState() => _AppSelectorViewState(); @@ -114,7 +114,7 @@ class _AppSelectorViewState extends State { ), ), ) - .toList(), + , ...model .getFilteredAppsNames(_query) .map( @@ -128,7 +128,7 @@ class _AppSelectorViewState extends State { }, ), ) - .toList(), + , const SizedBox(height: 70.0), ], ), diff --git a/lib/ui/views/contributors/contributors_view.dart b/lib/ui/views/contributors/contributors_view.dart index a409c17e..2d9c8b74 100644 --- a/lib/ui/views/contributors/contributors_view.dart +++ b/lib/ui/views/contributors/contributors_view.dart @@ -7,7 +7,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class ContributorsView extends StatelessWidget { - const ContributorsView({Key? key}) : super(key: key); + const ContributorsView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 06ed6e9f..b2fdcd86 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -9,7 +9,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class HomeView extends StatelessWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 4093258e..d1626ed5 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -8,7 +8,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class InstallerView extends StatelessWidget { - const InstallerView({Key? key}) : super(key: key); + const InstallerView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/navigation/navigation_view.dart b/lib/ui/views/navigation/navigation_view.dart index 7089d069..13a4457e 100644 --- a/lib/ui/views/navigation/navigation_view.dart +++ b/lib/ui/views/navigation/navigation_view.dart @@ -6,7 +6,7 @@ import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:stacked/stacked.dart'; class NavigationView extends StatelessWidget { - const NavigationView({Key? key}) : super(key: key); + const NavigationView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/patch_options/patch_options_viewmodel.dart b/lib/ui/views/patch_options/patch_options_viewmodel.dart index c1da7992..520fd9c6 100644 --- a/lib/ui/views/patch_options/patch_options_viewmodel.dart +++ b/lib/ui/views/patch_options/patch_options_viewmodel.dart @@ -38,11 +38,11 @@ class PatchOptionsViewModel extends BaseViewModel { option.required && !savedOptions.any((sOption) => sOption.key == option.key), ) - .toList(), + , ]; } else { visibleOptions = [ - ...options.where((option) => option.required).toList(), + ...options.where((option) => option.required), ]; } } diff --git a/lib/ui/views/patcher/patcher_view.dart b/lib/ui/views/patcher/patcher_view.dart index c15a6943..0921bb1d 100644 --- a/lib/ui/views/patcher/patcher_view.dart +++ b/lib/ui/views/patcher/patcher_view.dart @@ -9,7 +9,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class PatcherView extends StatelessWidget { - const PatcherView({Key? key}) : super(key: key); + const PatcherView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index eb20cf82..29489078 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -7,7 +7,7 @@ import 'package:revanced_manager/ui/widgets/shared/search_bar.dart'; import 'package:stacked/stacked.dart'; class PatchesSelectorView extends StatefulWidget { - const PatchesSelectorView({Key? key}) : super(key: key); + const PatchesSelectorView({super.key}); @override State createState() => _PatchesSelectorViewState(); diff --git a/lib/ui/views/settings/settings_view.dart b/lib/ui/views/settings/settings_view.dart index fb623440..0d5b8e30 100644 --- a/lib/ui/views/settings/settings_view.dart +++ b/lib/ui/views/settings/settings_view.dart @@ -13,7 +13,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class SettingsView extends StatelessWidget { - const SettingsView({Key? key}) : super(key: key); + const SettingsView({super.key}); static const _settingsDivider = Divider(thickness: 1.0, indent: 20.0, endIndent: 20.0); diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 721ee78e..d1dbfd7e 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -145,7 +145,7 @@ class SettingsViewModel extends BaseViewModel { } Future? showRequireSuggestedAppVersionDialog( - BuildContext context, bool value) { + BuildContext context, bool value,) { if (!value) { return showDialog( context: context, diff --git a/lib/ui/widgets/appInfoView/app_info_view.dart b/lib/ui/widgets/appInfoView/app_info_view.dart index 283beb12..0e7bed3d 100644 --- a/lib/ui/widgets/appInfoView/app_info_view.dart +++ b/lib/ui/widgets/appInfoView/app_info_view.dart @@ -9,9 +9,9 @@ import 'package:stacked/stacked.dart'; class AppInfoView extends StatelessWidget { const AppInfoView({ - Key? key, + super.key, required this.app, - }) : super(key: key); + }); final PatchedApplication app; @override diff --git a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart index 0cb80428..2f98d2a8 100644 --- a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart +++ b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart @@ -3,7 +3,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; import 'package:skeletons/skeletons.dart'; class AppSkeletonLoader extends StatelessWidget { - const AppSkeletonLoader({Key? key}) : super(key: key); + const AppSkeletonLoader({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index ae129cbf..9147e1d0 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -5,7 +5,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class InstalledAppItem extends StatefulWidget { const InstalledAppItem({ - Key? key, + super.key, required this.name, required this.pkgName, required this.icon, @@ -13,7 +13,7 @@ class InstalledAppItem extends StatefulWidget { required this.suggestedVersion, required this.installedVersion, this.onTap, - }) : super(key: key); + }); final String name; final String pkgName; final Uint8List icon; diff --git a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart index c2f3f52e..48e134ea 100644 --- a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart @@ -4,12 +4,12 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class NotInstalledAppItem extends StatefulWidget { const NotInstalledAppItem({ - Key? key, + super.key, required this.name, required this.patchesCount, required this.suggestedVersion, this.onTap, - }) : super(key: key); + }); final String name; final int patchesCount; final String suggestedVersion; diff --git a/lib/ui/widgets/contributorsView/contributors_card.dart b/lib/ui/widgets/contributorsView/contributors_card.dart index d0a4c624..d039e5b7 100644 --- a/lib/ui/widgets/contributorsView/contributors_card.dart +++ b/lib/ui/widgets/contributorsView/contributors_card.dart @@ -7,10 +7,10 @@ import 'package:url_launcher/url_launcher.dart'; class ContributorsCard extends StatefulWidget { const ContributorsCard({ - Key? key, + super.key, required this.title, required this.contributors, - }) : super(key: key); + }); final String title; final List contributors; diff --git a/lib/ui/widgets/homeView/installed_apps_card.dart b/lib/ui/widgets/homeView/installed_apps_card.dart index ec825340..e6ac9a02 100644 --- a/lib/ui/widgets/homeView/installed_apps_card.dart +++ b/lib/ui/widgets/homeView/installed_apps_card.dart @@ -10,7 +10,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; //ignore: must_be_immutable class InstalledAppsCard extends StatelessWidget { - InstalledAppsCard({Key? key}) : super(key: key); + InstalledAppsCard({super.key}); List apps = locator().patchedInstalledApps; final ManagerAPI _managerAPI = locator(); diff --git a/lib/ui/widgets/homeView/latest_commit_card.dart b/lib/ui/widgets/homeView/latest_commit_card.dart index cb263e25..9d0625ce 100644 --- a/lib/ui/widgets/homeView/latest_commit_card.dart +++ b/lib/ui/widgets/homeView/latest_commit_card.dart @@ -7,10 +7,10 @@ import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; class LatestCommitCard extends StatefulWidget { const LatestCommitCard({ - Key? key, + super.key, required this.model, required this.parentContext, - }) : super(key: key); + }); final HomeViewModel model; final BuildContext parentContext; diff --git a/lib/ui/widgets/patcherView/app_selector_card.dart b/lib/ui/widgets/patcherView/app_selector_card.dart index e97a004d..2fb0e803 100644 --- a/lib/ui/widgets/patcherView/app_selector_card.dart +++ b/lib/ui/widgets/patcherView/app_selector_card.dart @@ -7,9 +7,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class AppSelectorCard extends StatelessWidget { const AppSelectorCard({ - Key? key, + super.key, required this.onPressed, - }) : super(key: key); + }); final Function() onPressed; @override diff --git a/lib/ui/widgets/patcherView/patch_selector_card.dart b/lib/ui/widgets/patcherView/patch_selector_card.dart index 56da8570..ceea41c9 100644 --- a/lib/ui/widgets/patcherView/patch_selector_card.dart +++ b/lib/ui/widgets/patcherView/patch_selector_card.dart @@ -7,9 +7,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class PatchSelectorCard extends StatelessWidget { const PatchSelectorCard({ - Key? key, + super.key, required this.onPressed, - }) : super(key: key); + }); final Function() onPressed; @override diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index 92fe1454..11fd0839 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -10,7 +10,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; // ignore: must_be_immutable class PatchItem extends StatefulWidget { PatchItem({ - Key? key, + super.key, required this.name, required this.simpleName, required this.description, @@ -23,7 +23,7 @@ class PatchItem extends StatefulWidget { required this.onChanged, required this.navigateToOptions, required this.isChangeEnabled, - }) : super(key: key); + }); final String name; final String simpleName; final String description; diff --git a/lib/ui/widgets/settingsView/about_widget.dart b/lib/ui/widgets/settingsView/about_widget.dart index ebad5f92..1884b5e3 100644 --- a/lib/ui/widgets/settingsView/about_widget.dart +++ b/lib/ui/widgets/settingsView/about_widget.dart @@ -4,7 +4,7 @@ import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/utils/about_info.dart'; class AboutWidget extends StatefulWidget { - const AboutWidget({Key? key, this.padding}) : super(key: key); + const AboutWidget({super.key, this.padding}); final EdgeInsetsGeometry? padding; diff --git a/lib/ui/widgets/settingsView/custom_switch.dart b/lib/ui/widgets/settingsView/custom_switch.dart index 8328c90b..75229bb0 100644 --- a/lib/ui/widgets/settingsView/custom_switch.dart +++ b/lib/ui/widgets/settingsView/custom_switch.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; class CustomSwitch extends StatelessWidget { const CustomSwitch({ - Key? key, + super.key, required this.onChanged, required this.value, - }) : super(key: key); + }); final ValueChanged onChanged; final bool value; diff --git a/lib/ui/widgets/settingsView/custom_switch_tile.dart b/lib/ui/widgets/settingsView/custom_switch_tile.dart index f17f9670..3bf563a5 100644 --- a/lib/ui/widgets/settingsView/custom_switch_tile.dart +++ b/lib/ui/widgets/settingsView/custom_switch_tile.dart @@ -3,13 +3,13 @@ import 'package:revanced_manager/ui/widgets/settingsView/custom_switch.dart'; class CustomSwitchTile extends StatelessWidget { const CustomSwitchTile({ - Key? key, + super.key, required this.title, required this.subtitle, required this.value, required this.onTap, this.padding, - }) : super(key: key); + }); final Widget title; final Widget subtitle; final bool value; diff --git a/lib/ui/widgets/settingsView/custom_text_field.dart b/lib/ui/widgets/settingsView/custom_text_field.dart index 6f2b8a76..986b2ac6 100644 --- a/lib/ui/widgets/settingsView/custom_text_field.dart +++ b/lib/ui/widgets/settingsView/custom_text_field.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomTextField extends StatelessWidget { const CustomTextField({ - Key? key, + super.key, required this.inputController, required this.label, required this.hint, this.leadingIcon, required this.onChanged, - }) : super(key: key); + }); final TextEditingController inputController; final Widget label; final String hint; diff --git a/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart b/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart index a46ee10d..1d431e60 100644 --- a/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart +++ b/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart @@ -29,7 +29,7 @@ class _SRequireSuggestedAppVersionState extends State children; diff --git a/lib/ui/widgets/settingsView/settings_tile_dialog.dart b/lib/ui/widgets/settingsView/settings_tile_dialog.dart index ce3a817d..822ffe6f 100644 --- a/lib/ui/widgets/settingsView/settings_tile_dialog.dart +++ b/lib/ui/widgets/settingsView/settings_tile_dialog.dart @@ -3,12 +3,12 @@ import 'package:flutter_i18n/flutter_i18n.dart'; class SettingsTileDialog extends StatelessWidget { const SettingsTileDialog({ - Key? key, + super.key, required this.title, required this.subtitle, required this.onTap, this.padding, - }) : super(key: key); + }); final String title; final String subtitle; final Function()? onTap; diff --git a/lib/ui/widgets/settingsView/social_media_item.dart b/lib/ui/widgets/settingsView/social_media_item.dart index 86971a27..78e8eb94 100644 --- a/lib/ui/widgets/settingsView/social_media_item.dart +++ b/lib/ui/widgets/settingsView/social_media_item.dart @@ -3,12 +3,12 @@ import 'package:url_launcher/url_launcher.dart'; class SocialMediaItem extends StatelessWidget { const SocialMediaItem({ - Key? key, + super.key, this.icon, required this.title, this.subtitle, this.url, - }) : super(key: key); + }); final Widget? icon; final Widget title; final Widget? subtitle; diff --git a/lib/ui/widgets/settingsView/social_media_widget.dart b/lib/ui/widgets/settingsView/social_media_widget.dart index 4431ac6a..c42c526d 100644 --- a/lib/ui/widgets/settingsView/social_media_widget.dart +++ b/lib/ui/widgets/settingsView/social_media_widget.dart @@ -8,9 +8,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_icon.dart'; class SocialMediaWidget extends StatelessWidget { const SocialMediaWidget({ - Key? key, + super.key, this.padding, - }) : super(key: key); + }); final EdgeInsetsGeometry? padding; @override diff --git a/lib/ui/widgets/shared/application_item.dart b/lib/ui/widgets/shared/application_item.dart index b7336435..5f527eb1 100644 --- a/lib/ui/widgets/shared/application_item.dart +++ b/lib/ui/widgets/shared/application_item.dart @@ -8,12 +8,12 @@ import 'package:timeago/timeago.dart'; class ApplicationItem extends StatefulWidget { const ApplicationItem({ - Key? key, + super.key, required this.icon, required this.name, required this.patchDate, required this.onPressed, - }) : super(key: key); + }); final Uint8List icon; final String name; final DateTime patchDate; diff --git a/lib/ui/widgets/shared/custom_card.dart b/lib/ui/widgets/shared/custom_card.dart index 34b3c728..17b3d0e1 100644 --- a/lib/ui/widgets/shared/custom_card.dart +++ b/lib/ui/widgets/shared/custom_card.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomCard extends StatelessWidget { const CustomCard({ - Key? key, + super.key, this.isFilled = true, required this.child, this.onTap, this.padding, this.backgroundColor, - }) : super(key: key); + }); final bool isFilled; final Widget child; final Function()? onTap; diff --git a/lib/ui/widgets/shared/custom_chip.dart b/lib/ui/widgets/shared/custom_chip.dart index 8f3bb418..c0567ce2 100644 --- a/lib/ui/widgets/shared/custom_chip.dart +++ b/lib/ui/widgets/shared/custom_chip.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; class CustomChip extends StatelessWidget { const CustomChip({ - Key? key, + super.key, required this.label, this.isSelected = false, this.onSelected, - }) : super(key: key); + }); final Widget label; final bool isSelected; final Function(bool)? onSelected; diff --git a/lib/ui/widgets/shared/custom_material_button.dart b/lib/ui/widgets/shared/custom_material_button.dart index 2ff80e4c..c861a709 100644 --- a/lib/ui/widgets/shared/custom_material_button.dart +++ b/lib/ui/widgets/shared/custom_material_button.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class CustomMaterialButton extends StatelessWidget { const CustomMaterialButton({ - Key? key, + super.key, required this.label, this.isFilled = true, this.isExpanded = false, required this.onPressed, - }) : super(key: key); + }); final Widget label; final bool isFilled; final bool isExpanded; @@ -49,13 +49,13 @@ class CustomMaterialButton extends StatelessWidget { // ignore: must_be_immutable class TimerButton extends StatefulWidget { TimerButton({ - Key? key, + super.key, required this.seconds, required this.isRunning, required this.onTimerEnd, this.label = const Text(''), this.isFilled = true, - }) : super(key: key); + }); Widget label; bool isFilled; int seconds; diff --git a/lib/ui/widgets/shared/custom_popup_menu.dart b/lib/ui/widgets/shared/custom_popup_menu.dart deleted file mode 100644 index aaf24125..00000000 --- a/lib/ui/widgets/shared/custom_popup_menu.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomPopupMenu extends StatelessWidget { - const CustomPopupMenu({ - Key? key, - required this.onSelected, - required this.children, - }) : super(key: key); - final Function(dynamic) onSelected; - final Map children; - - @override - Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(useMaterial3: false), - child: PopupMenuButton( - icon: Icon( - Icons.more_vert, - color: Theme.of(context).colorScheme.secondary, - ), - onSelected: onSelected, - itemBuilder: (context) => children.entries - .map( - (entry) => PopupMenuItem( - padding: const EdgeInsets.all(16.0).copyWith(right: 20), - value: entry.key, - child: entry.value, - ), - ) - .toList(), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: Theme.of(context).colorScheme.secondaryContainer, - position: PopupMenuPosition.under, - ), - ); - } -} diff --git a/lib/ui/widgets/shared/custom_sliver_app_bar.dart b/lib/ui/widgets/shared/custom_sliver_app_bar.dart index 144bd6ab..08b75af2 100644 --- a/lib/ui/widgets/shared/custom_sliver_app_bar.dart +++ b/lib/ui/widgets/shared/custom_sliver_app_bar.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomSliverAppBar extends StatelessWidget { const CustomSliverAppBar({ - Key? key, + super.key, required this.title, this.actions, this.bottom, this.isMainView = false, this.onBackButtonPressed, - }) : super(key: key); + }); final Widget title; final List? actions; final PreferredSizeWidget? bottom; diff --git a/lib/ui/widgets/shared/open_container_wrapper.dart b/lib/ui/widgets/shared/open_container_wrapper.dart index f5b1c642..458e8937 100644 --- a/lib/ui/widgets/shared/open_container_wrapper.dart +++ b/lib/ui/widgets/shared/open_container_wrapper.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; class OpenContainerWrapper extends StatelessWidget { const OpenContainerWrapper({ - Key? key, + super.key, required this.openBuilder, required this.closedBuilder, - }) : super(key: key); + }); final OpenContainerBuilder openBuilder; final CloseContainerBuilder closedBuilder; diff --git a/lib/ui/widgets/shared/search_bar.dart b/lib/ui/widgets/shared/search_bar.dart index e48e3031..862584af 100644 --- a/lib/ui/widgets/shared/search_bar.dart +++ b/lib/ui/widgets/shared/search_bar.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class SearchBar extends StatefulWidget { const SearchBar({ - Key? key, + super.key, required this.hintText, this.showSelectIcon = false, this.onSelectAll, required this.onQueryChanged, - }) : super(key: key); + }); final String? hintText; final bool showSelectIcon; final Function(bool)? onSelectAll; diff --git a/pubspec.yaml b/pubspec.yaml index e5d5c80b..36320b65 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,7 +86,7 @@ dev_dependencies: json_serializable: ^6.6.1 build_runner: any flutter_launcher_icons: ^0.13.0 - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.1 flutter_test: sdk: flutter injectable_generator: ^2.1.5