diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 713f1655..e0f3a806 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -11,7 +11,7 @@ "patchedSubtitle": "Patched Applications", "updatesAvailable": "Updates Available", "noUpdates": "No updates available", - "noInstallations": "No patched apps installed", + "noInstallations": "No patched applications installed", "installed": "Installed", "notificationTitle": "ReVanced Manager was updated!", "notificationText": "Tap to open the app", @@ -40,7 +40,7 @@ "widgetTitle": "Select application", "widgetTitleSelected": "Selected application", "widgetSubtitle": "No application selected.", - "noAppsLabel": "No apps found." + "noAppsLabel": "No applications found." }, "patchSelectorCard": { "widgetTitle": "Select patches", @@ -48,8 +48,16 @@ "widgetSubtitle": "Select an application first.", "widgetEmptySubtitle": "No patches selected." }, - "socialMediaCards": { - "widgetTitle": "Social Media" + "socialMediaCard": { + "widgetTitle": "Social Media", + "widgetSubtitle": "We are online!" + }, + "sourcesCard": { + "widgetTitle": "Sources", + "widgetSubtitle": "Add your custom sources", + "organizationLabel": "Organization", + "patchesSourceLabel" : "Patches Source", + "integrationsSourceLabel": "Integrations Source" }, "appSelectorView": { "searchBarHint": "Search applications", @@ -75,19 +83,21 @@ }, "settingsView": { "widgetTitle": "Settings", - "languageLabel": "Language", + "appearanceSectionTitle": "Appearance", + "patcherSectionTitle": "Patcher", + "teamSectionTitle": "Team", + "infoSectionTitle": "Info", "themeLabel": "Theme", "themeHint": "Change the theme of the app", - "darkThemeLabel": "Dark", - "lightThemeLabel": "Light", - "versionLabel": "Version", - "aboutLabel": "About", - "contributorsLabel": "Contributors", + "languageLabel": "Language", + "englishOption": "English", + "frenchOption": "French", "rootModeLabel": "Root Mode", - "rootModeHint": "Enable this if you want to patch applications as rooted.", - "organizationLabel": "Organization", - "patchesSourceLabel" : "Patches Source", - "integrationsSourceLabel": "Integrations Source" + "rootModeHint": "Do you want to patch applications as rooted?", + "contributorsLabel": "Contributors", + "contributorsHint": "A list of contributors of ReVanced", + "aboutLabel": "About", + "versionLabel": "Version" }, "rootCheckerView": { "widgetTitle": "Is your device rooted?", diff --git a/assets/images/github.png b/assets/images/github.png deleted file mode 100644 index 8b25551a..00000000 Binary files a/assets/images/github.png and /dev/null differ diff --git a/assets/images/twitter.png b/assets/images/twitter.png deleted file mode 100644 index 040ca169..00000000 Binary files a/assets/images/twitter.png and /dev/null differ diff --git a/assets/images/youtube.png b/assets/images/youtube.png deleted file mode 100644 index e9d99668..00000000 Binary files a/assets/images/youtube.png and /dev/null differ diff --git a/lib/theme.dart b/lib/theme.dart index 6086d85d..3e8e537e 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -32,6 +32,7 @@ var lightTheme = ThemeData.light().copyWith( ), ), ), + toggleableActiveColor: const Color(0xff3868AF), colorScheme: const ColorScheme.light( primary: Color.fromRGBO(154, 193, 252, 0.18), secondary: Color(0xff3868AF), @@ -69,6 +70,7 @@ var darkTheme = ThemeData.dark().copyWith( ), ), ), + toggleableActiveColor: const Color(0xff7792BA), colorScheme: const ColorScheme.dark( primary: Color(0xff11161C), secondary: Color(0xff7792BA), diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 7e875080..9494997f 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -50,7 +50,7 @@ class _AppSelectorViewState extends State { ), ) : Column( - children: [ + children: [ SearchBar( showSelectIcon: false, fillColor: isDark diff --git a/lib/ui/views/contributors/contributors_view.dart b/lib/ui/views/contributors/contributors_view.dart index 459b7a1f..49045a55 100644 --- a/lib/ui/views/contributors/contributors_view.dart +++ b/lib/ui/views/contributors/contributors_view.dart @@ -15,7 +15,7 @@ class ContributorsView extends StatelessWidget { body: SafeArea( child: SingleChildScrollView( child: Column( - children: [ + children: [ ContributorsCard( title: 'Patcher Contributors', contributors: model.patcherContributors, diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 200d2b94..a3218d2b 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -8,6 +8,7 @@ import 'package:revanced_manager/ui/widgets/homeView/available_updates_card.dart import 'package:revanced_manager/ui/widgets/homeView/dashboard_raw_chip.dart'; import 'package:revanced_manager/ui/widgets/homeView/installed_apps_card.dart'; import 'package:revanced_manager/ui/widgets/homeView/latest_commit_card.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class HomeView extends StatelessWidget { @@ -22,32 +23,14 @@ class HomeView extends StatelessWidget { builder: (context, model, child) => Scaffold( body: CustomScrollView( slivers: [ - SliverAppBar( - pinned: true, - snap: false, - floating: false, - expandedHeight: 100.0, - automaticallyImplyLeading: false, - backgroundColor: MaterialStateColor.resolveWith( - (states) => states.contains(MaterialState.scrolledUnder) - ? isDark - ? Theme.of(context).colorScheme.primary - : Theme.of(context).navigationBarTheme.backgroundColor! - : Theme.of(context).scaffoldBackgroundColor, - ), - flexibleSpace: FlexibleSpaceBar( - titlePadding: const EdgeInsets.symmetric( - vertical: 23.0, - horizontal: 20.0, - ), - title: I18nText( - 'homeView.widgetTitle', - child: Text( - '', - style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline5!.color, - fontWeight: FontWeight.w500, - ), + CustomSliverAppBar( + title: I18nText( + 'homeView.widgetTitle', + child: Text( + '', + style: GoogleFonts.inter( + color: Theme.of(context).textTheme.headline5!.color, + fontWeight: FontWeight.w500, ), ), ), @@ -89,9 +72,9 @@ class HomeView extends StatelessWidget { ), const SizedBox(height: 8), Row( - children: [ + children: [ DashboardChip( - label: 'homeView.updatesAvailable', + label: I18nText('homeView.updatesAvailable'), isSelected: model.showUpdatableApps, onSelected: (value) { model.toggleUpdatableApps(true); @@ -99,7 +82,7 @@ class HomeView extends StatelessWidget { ), const SizedBox(width: 10), DashboardChip( - label: 'homeView.installed', + label: I18nText('homeView.installed'), isSelected: !model.showUpdatableApps, onSelected: (value) { model.toggleUpdatableApps(false); diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 0bba79ab..a856ab9d 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:revanced_manager/theme.dart'; import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class InstallerView extends StatelessWidget { @@ -18,32 +19,12 @@ class InstallerView extends StatelessWidget { body: CustomScrollView( controller: model.scrollController, slivers: [ - SliverAppBar( - pinned: true, - snap: false, - floating: false, - expandedHeight: 100.0, - automaticallyImplyLeading: false, - backgroundColor: MaterialStateColor.resolveWith( - (states) => states.contains(MaterialState.scrolledUnder) - ? isDark - ? Theme.of(context).colorScheme.primary - : Theme.of(context) - .navigationBarTheme - .backgroundColor! - : Theme.of(context).scaffoldBackgroundColor, - ), - flexibleSpace: FlexibleSpaceBar( - titlePadding: const EdgeInsets.symmetric( - vertical: 23.0, - horizontal: 20.0, - ), - title: Text( - model.headerLogs, - style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline5!.color, - fontWeight: FontWeight.w500, - ), + CustomSliverAppBar( + title: Text( + model.headerLogs, + style: GoogleFonts.inter( + color: Theme.of(context).textTheme.headline5!.color, + fontWeight: FontWeight.w500, ), ), bottom: PreferredSize( @@ -84,17 +65,17 @@ class InstallerView extends StatelessWidget { visible: !model.isPatching, child: Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ CustomMaterialButton( - text: 'installerView.shareButton', + label: I18nText('installerView.shareButton'), isFilled: false, onPressed: () => model.shareResult(), ), const SizedBox(width: 16), CustomMaterialButton( - text: model.isInstalled - ? 'installerView.openButton' - : 'installerView.installButton', + label: model.isInstalled + ? I18nText('installerView.openButton') + : I18nText('installerView.installButton'), isFilled: true, isExpanded: true, onPressed: () { diff --git a/lib/ui/views/patcher/patcher_view.dart b/lib/ui/views/patcher/patcher_view.dart index e8f11fb0..5d360906 100644 --- a/lib/ui/views/patcher/patcher_view.dart +++ b/lib/ui/views/patcher/patcher_view.dart @@ -9,6 +9,7 @@ import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_view.dart'; import 'package:revanced_manager/ui/widgets/patcherView/app_selector_card.dart'; import 'package:revanced_manager/ui/widgets/patcherView/patch_selector_card.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:revanced_manager/ui/widgets/shared/open_container_wrapper.dart'; import 'package:stacked/stacked.dart'; @@ -39,32 +40,14 @@ class PatcherView extends StatelessWidget { ), body: CustomScrollView( slivers: [ - SliverAppBar( - pinned: true, - snap: false, - floating: false, - expandedHeight: 100.0, - automaticallyImplyLeading: false, - backgroundColor: MaterialStateColor.resolveWith( - (states) => states.contains(MaterialState.scrolledUnder) - ? isDark - ? Theme.of(context).colorScheme.primary - : Theme.of(context).navigationBarTheme.backgroundColor! - : Theme.of(context).scaffoldBackgroundColor, - ), - flexibleSpace: FlexibleSpaceBar( - titlePadding: const EdgeInsets.symmetric( - vertical: 23.0, - horizontal: 20.0, - ), - title: I18nText( - 'patcherView.widgetTitle', - child: Text( - '', - style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline5!.color, - fontWeight: FontWeight.w500, - ), + CustomSliverAppBar( + title: I18nText( + 'patcherView.widgetTitle', + child: Text( + '', + style: GoogleFonts.inter( + color: Theme.of(context).textTheme.headline5!.color, + fontWeight: FontWeight.w500, ), ), ), diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index cbeb626d..052a99bc 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -49,7 +49,7 @@ class _PatchesSelectorViewState extends State { ), ) : Column( - children: [ + children: [ SearchBar( showSelectIcon: true, fillColor: diff --git a/lib/ui/views/root_checker/root_checker_view.dart b/lib/ui/views/root_checker/root_checker_view.dart index 895b0879..f2d311a4 100644 --- a/lib/ui/views/root_checker/root_checker_view.dart +++ b/lib/ui/views/root_checker/root_checker_view.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:revanced_manager/ui/views/root_checker/root_checker_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/rootCheckerView/magisk_button.dart'; @@ -27,7 +27,7 @@ class RootCheckerView extends StatelessWidget { height: double.infinity, padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 28.0), child: Column( - children: [ + children: [ const SizedBox(height: 120), I18nText( 'rootCheckerView.widgetTitle', @@ -53,7 +53,7 @@ class RootCheckerView extends StatelessWidget { Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ MagiskButton( onPressed: () => model.navigateAsRoot(), ), diff --git a/lib/ui/views/settings/settings_view.dart b/lib/ui/views/settings/settings_view.dart index ffe6126f..ecb4b5cc 100644 --- a/lib/ui/views/settings/settings_view.dart +++ b/lib/ui/views/settings/settings_view.dart @@ -3,11 +3,16 @@ import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/theme.dart'; +import 'package:revanced_manager/ui/views/contributors/contributors_view.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/about_info_widget.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/custom_text_field.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/settings_switch_item.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/social_media_cards.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/about_widget.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/social_media_widget.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/sources_widget.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; +import 'package:revanced_manager/ui/widgets/shared/open_container_wrapper.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_themes/stacked_themes.dart'; @@ -22,149 +27,124 @@ class SettingsView extends StatelessWidget { @override Widget build(BuildContext context) { return ViewModelBuilder.reactive( - disposeViewModel: false, viewModelBuilder: () => SettingsViewModel(), - onModelReady: (model) => model.initialize(), builder: (context, SettingsViewModel model, child) => Scaffold( body: CustomScrollView( slivers: [ - SliverAppBar( - pinned: true, - snap: false, - floating: false, - expandedHeight: 100.0, - automaticallyImplyLeading: false, - backgroundColor: MaterialStateColor.resolveWith( - (states) => states.contains(MaterialState.scrolledUnder) - ? isDark - ? Theme.of(context).colorScheme.primary - : Theme.of(context).navigationBarTheme.backgroundColor! - : Theme.of(context).scaffoldBackgroundColor, - ), - flexibleSpace: FlexibleSpaceBar( - titlePadding: const EdgeInsets.symmetric( - vertical: 23.0, - horizontal: 20.0, - ), - title: I18nText( - 'settingsView.widgetTitle', - child: Text( - '', - style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline5!.color, - fontWeight: FontWeight.w500, - ), + CustomSliverAppBar( + title: I18nText( + 'settingsView.widgetTitle', + child: Text( + '', + style: GoogleFonts.inter( + color: Theme.of(context).textTheme.headline5!.color, + fontWeight: FontWeight.w500, ), ), ), ), SliverPadding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + padding: const EdgeInsets.symmetric( + vertical: 10.0, + horizontal: 20.0, + ), sliver: SliverList( delegate: SliverChildListDelegate.fixed( [ - SettingsSwitchItem( - title: 'settingsView.themeLabel', - subtitle: 'settingsView.themeHint', - value: isDark, - onTap: (value) { - isDark = value; - getThemeManager(context).toggleDarkLightTheme(); - }, - ), - ListTile( - title: I18nText( - 'settingsView.rootModeLabel', - child: Text( - '', - style: kSettingItemTextStyle, - ), - ), - subtitle: I18nText('settingsView.rootModeHint'), - trailing: GestureDetector( - onTap: () { - model.navigateToRootChecker(); - }, - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 16, vertical: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - border: Border.all( - width: 1, - color: Theme.of(context).colorScheme.secondary, + SettingsSection( + title: 'settingsView.appearanceSectionTitle', + children: [ + CustomSwitchTile( + title: I18nText( + 'settingsView.themeLabel', + child: Text( + '', + style: kSettingItemTextStyle, ), ), - child: Text( - model.isRooted ? 'Rooted' : 'Not rooted', - ), + subtitle: I18nText('settingsView.themeHint'), + value: isDark, + onTap: (value) { + isDark = value; + getThemeManager(context).toggleDarkLightTheme(); + }, ), - ), + ], ), - CustomTextField( - inputController: organizationController, - label: 'settingsView.organizationLabel', - hint: ghOrg, - onChanged: (value) { - ghOrg = value; - }, - ), - CustomTextField( - inputController: patchesSourceController, - label: 'settingsView.patchesSourceLabel', - hint: patchesRepo, - onChanged: (value) { - patchesRepo = value; - }, - ), - CustomTextField( - inputController: integrationsSourceController, - label: 'settingsView.integrationsSourceLabel', - hint: integrationsRepo, - onChanged: (value) { - integrationsRepo = value; - }, - ), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 16.0, - vertical: 8.0, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - I18nText( - 'settingsView.languageLabel', - child: Text('', style: kSettingItemTextStyle), - ), - DropdownButton( + SettingsTileDialog( + title: 'settingsView.languageLabel', + subtitle: 'English', + children: [ + RadioListTile( + title: I18nText('settingsView.englishOption'), value: 'en', - items: const [ - DropdownMenuItem( - value: 'en', - child: Text('English'), - ), - DropdownMenuItem( - value: 'fr', - child: Text('French'), - ), - ], + groupValue: 'en', onChanged: (value) { - value = value; + model.updateLanguage(context, value); + Navigator.of(context).pop(); }, ), - ], - ), + RadioListTile( + title: I18nText('settingsView.frenchOption'), + value: 'fr', + groupValue: 'en', + onChanged: (value) { + model.updateLanguage(context, value); + Navigator.of(context).pop(); + }, + ), + ]), + const Divider(thickness: 1.0), + SettingsSection( + title: 'settingsView.patcherSectionTitle', + children: [ + ListTile( + contentPadding: EdgeInsets.zero, + title: I18nText( + 'settingsView.rootModeLabel', + child: Text( + '', + style: kSettingItemTextStyle, + ), + ), + subtitle: I18nText('settingsView.rootModeHint'), + onTap: () => model.navigateToRootChecker(), + ), + SourcesWidget( + title: 'settingsView.sourcesLabel', + organizationController: organizationController, + patchesSourceController: patchesSourceController, + integrationsSourceController: + integrationsSourceController, + ), + ], ), - ListTile( - title: I18nText( - 'settingsView.contributorsLabel', - child: Text('', style: kSettingItemTextStyle), - ), - onTap: model.navigateToContributors, + const Divider(thickness: 1.0), + SettingsSection( + title: 'settingsView.teamSectionTitle', + children: [ + OpenContainerWrapper( + openBuilder: (_, __) => const ContributorsView(), + closedBuilder: (_, openContainer) => ListTile( + contentPadding: EdgeInsets.zero, + title: I18nText( + 'settingsView.contributorsLabel', + child: Text('', style: kSettingItemTextStyle), + ), + subtitle: I18nText('settingsView.contributorsHint'), + onTap: openContainer, + ), + ), + const SocialMediaWidget(), + ], + ), + const Divider(thickness: 1.0), + const SettingsSection( + title: 'settingsView.infoSectionTitle', + children: [ + AboutWidget(), + ], ), - const SocialMediaCards(), - const AboutWidget(), ], ), ), diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 96312d14..444a127e 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -1,29 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/app/app.router.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; +import 'package:timeago/timeago.dart'; class SettingsViewModel extends BaseViewModel { - bool isRooted = false; - - Future initialize() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - isRooted = prefs.getBool('isRooted') ?? false; - notifyListeners(); - } - final NavigationService _navigationService = locator(); void setLanguage(String language) { notifyListeners(); } - void navigateToContributors() { - _navigationService.navigateTo(Routes.contributorsView); - } - void navigateToRootChecker() { _navigationService.navigateTo(Routes.rootCheckerView); } + + Future updateLanguage(BuildContext context, String? value) async { + if (value != null) { + await FlutterI18n.refresh(context, Locale(value)); + setLocaleMessages(value, EnMessages()); + } + } } diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index 4278a950..126f13ec 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -32,7 +32,7 @@ class _InstalledAppItemState extends State { ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [ Container( width: 48, height: 48, @@ -47,7 +47,7 @@ class _InstalledAppItemState extends State { Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Text( widget.name, maxLines: 2, diff --git a/lib/ui/widgets/contributorsView/contributors_card.dart b/lib/ui/widgets/contributorsView/contributors_card.dart index 869f46de..ff44866b 100644 --- a/lib/ui/widgets/contributorsView/contributors_card.dart +++ b/lib/ui/widgets/contributorsView/contributors_card.dart @@ -24,7 +24,7 @@ class _ContributorsCardState extends State { Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Padding( padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 4.0), child: Text( diff --git a/lib/ui/widgets/homeView/available_updates_card.dart b/lib/ui/widgets/homeView/available_updates_card.dart index 660c91be..65b05384 100644 --- a/lib/ui/widgets/homeView/available_updates_card.dart +++ b/lib/ui/widgets/homeView/available_updates_card.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/models/patched_application.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; @@ -22,7 +22,7 @@ class AvailableUpdatesCard extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), child: Center( child: Column( - children: [ + children: [ Icon( Icons.update_disabled, size: 40, diff --git a/lib/ui/widgets/homeView/dashboard_raw_chip.dart b/lib/ui/widgets/homeView/dashboard_raw_chip.dart index 439ac69c..d715e903 100644 --- a/lib/ui/widgets/homeView/dashboard_raw_chip.dart +++ b/lib/ui/widgets/homeView/dashboard_raw_chip.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:revanced_manager/theme.dart'; class DashboardChip extends StatelessWidget { - final String label; + final Widget label; final bool isSelected; final Function(bool)? onSelected; @@ -19,7 +18,7 @@ class DashboardChip extends StatelessWidget { Widget build(BuildContext context) { return RawChip( showCheckmark: false, - label: I18nText(label), + label: label, selected: isSelected, labelStyle: GoogleFonts.inter( color: isSelected diff --git a/lib/ui/widgets/homeView/installed_apps_card.dart b/lib/ui/widgets/homeView/installed_apps_card.dart index 6c10c1ca..f3bc0c17 100644 --- a/lib/ui/widgets/homeView/installed_apps_card.dart +++ b/lib/ui/widgets/homeView/installed_apps_card.dart @@ -23,7 +23,7 @@ class InstalledAppsCard extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), child: Center( child: Column( - children: [ + children: [ Icon( Icons.file_download_off, size: 40, diff --git a/lib/ui/widgets/homeView/latest_commit_card.dart b/lib/ui/widgets/homeView/latest_commit_card.dart index 6800116f..3265196c 100644 --- a/lib/ui/widgets/homeView/latest_commit_card.dart +++ b/lib/ui/widgets/homeView/latest_commit_card.dart @@ -32,12 +32,12 @@ class _LatestCommitCardState extends State { padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Row( - children: [ + children: [ I18nText( 'latestCommitCard.patcherLabel', child: Text( @@ -67,7 +67,7 @@ class _LatestCommitCardState extends State { ), const SizedBox(height: 8), Row( - children: [ + children: [ I18nText( 'latestCommitCard.managerLabel', child: Text( diff --git a/lib/ui/widgets/installerView/custom_material_button.dart b/lib/ui/widgets/installerView/custom_material_button.dart index 609e451b..54c884e8 100644 --- a/lib/ui/widgets/installerView/custom_material_button.dart +++ b/lib/ui/widgets/installerView/custom_material_button.dart @@ -1,16 +1,15 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/theme.dart'; class CustomMaterialButton extends StatelessWidget { - final String text; + final Widget label; final bool isFilled; final bool isExpanded; final Function()? onPressed; const CustomMaterialButton({ Key? key, - required this.text, + required this.label, this.isFilled = true, this.isExpanded = false, required this.onPressed, @@ -62,7 +61,7 @@ class CustomMaterialButton extends StatelessWidget { ), ), onPressed: onPressed, - child: I18nText(text), + child: label, ); } } diff --git a/lib/ui/widgets/patcherView/app_selector_card.dart b/lib/ui/widgets/patcherView/app_selector_card.dart index ea1d55fc..ee8780e0 100644 --- a/lib/ui/widgets/patcherView/app_selector_card.dart +++ b/lib/ui/widgets/patcherView/app_selector_card.dart @@ -27,7 +27,7 @@ class AppSelectorCard extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ I18nText( locator().selectedApp == null ? 'appSelectorCard.widgetTitle' @@ -50,7 +50,7 @@ class AppSelectorCard extends StatelessWidget { ), ) : Row( - children: [ + children: [ SizedBox( height: 16.0, child: ClipOval( diff --git a/lib/ui/widgets/patcherView/patch_selector_card.dart b/lib/ui/widgets/patcherView/patch_selector_card.dart index 559c391b..c19014f4 100644 --- a/lib/ui/widgets/patcherView/patch_selector_card.dart +++ b/lib/ui/widgets/patcherView/patch_selector_card.dart @@ -27,7 +27,7 @@ class PatchSelectorCard extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ I18nText( locator().selectedPatches.isEmpty ? 'patchSelectorCard.widgetTitle' diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index 1d6d2bc3..8d5a9de8 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -48,17 +48,17 @@ class _PatchItemState extends State { padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), child: Column( - children: [ + children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [ Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, - children: [ + children: [ Text( widget.simpleName, style: GoogleFonts.inter( @@ -98,7 +98,7 @@ class _PatchItemState extends State { ), widget.isUnsupported ? Row( - children: [ + children: [ Padding( padding: const EdgeInsets.only(top: 8), child: TextButton.icon( diff --git a/lib/ui/widgets/rootCheckerView/magisk_button.dart b/lib/ui/widgets/rootCheckerView/magisk_button.dart index f1daa71b..a59d434d 100644 --- a/lib/ui/widgets/rootCheckerView/magisk_button.dart +++ b/lib/ui/widgets/rootCheckerView/magisk_button.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -15,7 +15,7 @@ class MagiskButton extends StatelessWidget { Widget build(BuildContext context) { return Column( mainAxisSize: MainAxisSize.min, - children: [ + children: [ GestureDetector( onTap: onPressed, child: CircleAvatar( diff --git a/lib/ui/widgets/settingsView/about_info_widget.dart b/lib/ui/widgets/settingsView/about_widget.dart similarity index 94% rename from lib/ui/widgets/settingsView/about_info_widget.dart rename to lib/ui/widgets/settingsView/about_widget.dart index 0bc4f995..b5b274ce 100644 --- a/lib/ui/widgets/settingsView/about_info_widget.dart +++ b/lib/ui/widgets/settingsView/about_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/theme.dart'; import 'package:revanced_manager/utils/about_info.dart'; @@ -16,10 +16,10 @@ class _AboutWidgetState extends State { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + padding: const EdgeInsets.symmetric(vertical: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ I18nText( 'settingsView.aboutLabel', child: Text('', style: kSettingItemTextStyle), @@ -54,7 +54,7 @@ class _AboutWidgetState extends State { }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Text('Version: ${snapshot.data!['version']}', style: kSettingItemSubtitleTextStyle), Text('Build: ${snapshot.data!['buildNumber']}', diff --git a/lib/ui/widgets/settingsView/custom_switch.dart b/lib/ui/widgets/settingsView/custom_switch.dart index a8c75c15..ef936395 100644 --- a/lib/ui/widgets/settingsView/custom_switch.dart +++ b/lib/ui/widgets/settingsView/custom_switch.dart @@ -20,12 +20,12 @@ class CustomSwitch extends StatelessWidget { height: 25, width: 50, child: Stack( - children: [ + children: [ AnimatedContainer( height: 25, width: 50, curve: Curves.ease, - duration: const Duration(milliseconds: 500), + duration: const Duration(milliseconds: 400), decoration: BoxDecoration( borderRadius: const BorderRadius.all( Radius.circular(25.0), @@ -35,7 +35,7 @@ class CustomSwitch extends StatelessWidget { ), AnimatedAlign( curve: Curves.ease, - duration: const Duration(milliseconds: 500), + duration: const Duration(milliseconds: 400), alignment: !value ? Alignment.centerLeft : Alignment.centerRight, child: Container( height: 20, diff --git a/lib/ui/widgets/settingsView/settings_switch_item.dart b/lib/ui/widgets/settingsView/custom_switch_tile.dart similarity index 54% rename from lib/ui/widgets/settingsView/settings_switch_item.dart rename to lib/ui/widgets/settingsView/custom_switch_tile.dart index 956b2a31..348e1440 100644 --- a/lib/ui/widgets/settingsView/settings_switch_item.dart +++ b/lib/ui/widgets/settingsView/custom_switch_tile.dart @@ -1,15 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; -import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/ui/widgets/settingsView/custom_switch.dart'; -class SettingsSwitchItem extends StatelessWidget { - final String title; - final String subtitle; +class CustomSwitchTile extends StatelessWidget { + final Widget title; + final Widget subtitle; final bool value; final Function(bool) onTap; - const SettingsSwitchItem({ + const CustomSwitchTile({ Key? key, required this.title, required this.subtitle, @@ -20,14 +18,9 @@ class SettingsSwitchItem extends StatelessWidget { @override Widget build(BuildContext context) { return ListTile( - title: I18nText( - title, - child: Text( - '', - style: kSettingItemTextStyle, - ), - ), - subtitle: I18nText(subtitle), + contentPadding: EdgeInsets.zero, + title: title, + subtitle: subtitle, trailing: CustomSwitch( value: value, onChanged: onTap, diff --git a/lib/ui/widgets/settingsView/custom_text_field.dart b/lib/ui/widgets/settingsView/custom_text_field.dart index 270f7e75..8ea2942c 100644 --- a/lib/ui/widgets/settingsView/custom_text_field.dart +++ b/lib/ui/widgets/settingsView/custom_text_field.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/theme.dart'; class CustomTextField extends StatelessWidget { final TextEditingController inputController; - final String label; + final Widget label; final String hint; final Function(String)? onChanged; @@ -18,40 +17,42 @@ class CustomTextField extends StatelessWidget { @override Widget build(BuildContext context) { - const errorColor = Color(0xffEF4444); - return Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox( - height: 8, - ), + children: [ + const SizedBox(height: 8), TextField( controller: inputController, onChanged: onChanged, keyboardType: TextInputType.text, style: TextStyle( fontSize: 14, - color: isDark ? Colors.grey[300] : Colors.black, + color: Theme.of(context).textTheme.headline5!.color, ), + cursorColor: Theme.of(context).textTheme.headline5!.color, decoration: InputDecoration( - label: I18nText(label), - labelStyle: - TextStyle(color: isDark ? Colors.grey[300] : Colors.black), + label: label, + labelStyle: TextStyle( + color: isDark ? Colors.grey[300] : Colors.black, + ), filled: true, fillColor: Theme.of(context).colorScheme.primary, hintText: hint, - hintStyle: TextStyle(color: Colors.grey.withOpacity(.75)), - contentPadding: - const EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0), + hintStyle: TextStyle( + color: Colors.grey.withOpacity(.75), + ), + contentPadding: const EdgeInsets.symmetric( + vertical: 0.0, + horizontal: 20.0, + ), border: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context).colorScheme.tertiary, width: 1.0, ), - borderRadius: const BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.circular(10), gapPadding: 4.0, ), focusedBorder: OutlineInputBorder( @@ -59,18 +60,21 @@ class CustomTextField extends StatelessWidget { color: Theme.of(context).colorScheme.secondary, width: 2.0, ), - borderRadius: const BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.circular(10), ), - errorBorder: const OutlineInputBorder( - borderSide: BorderSide(color: errorColor, width: 1.0), - borderRadius: BorderRadius.all(Radius.circular(10.0)), + errorBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Color(0xffEF4444), + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context).colorScheme.tertiary, width: 1.0, ), - borderRadius: const BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.circular(10), ), ), ), diff --git a/lib/ui/widgets/settingsView/settings_section.dart b/lib/ui/widgets/settingsView/settings_section.dart new file mode 100644 index 00000000..13cb211a --- /dev/null +++ b/lib/ui/widgets/settingsView/settings_section.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; + +class SettingsSection extends StatelessWidget { + final String title; + final List children; + + const SettingsSection({ + Key? key, + required this.title, + required this.children, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.only(top: 16.0, bottom: 10.0), + child: I18nText( + title, + child: Text( + '', + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + ), + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: children, + ), + ], + ); + } +} diff --git a/lib/ui/widgets/settingsView/settings_tile_dialog.dart b/lib/ui/widgets/settingsView/settings_tile_dialog.dart new file mode 100644 index 00000000..63ada5c2 --- /dev/null +++ b/lib/ui/widgets/settingsView/settings_tile_dialog.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; +import 'package:revanced_manager/constants.dart'; + +class SettingsTileDialog extends StatelessWidget { + final String title; + final String subtitle; + final List children; + + const SettingsTileDialog({ + Key? key, + required this.title, + required this.subtitle, + required this.children, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return ListTile( + contentPadding: EdgeInsets.zero, + title: I18nText( + title, + child: Text( + '', + style: kSettingItemTextStyle, + ), + ), + subtitle: I18nText(subtitle), + onTap: () => showDialog( + context: context, + builder: (context) => SimpleDialog( + title: I18nText(title), + backgroundColor: Theme.of(context).colorScheme.surface, + children: children, + ), + ), + ); + } +} diff --git a/lib/ui/widgets/settingsView/social_media_cards.dart b/lib/ui/widgets/settingsView/social_media_widget.dart similarity index 63% rename from lib/ui/widgets/settingsView/social_media_cards.dart rename to lib/ui/widgets/settingsView/social_media_widget.dart index 924cf445..a2573102 100644 --- a/lib/ui/widgets/settingsView/social_media_cards.dart +++ b/lib/ui/widgets/settingsView/social_media_widget.dart @@ -1,11 +1,13 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:revanced_manager/constants.dart'; +import 'package:revanced_manager/theme.dart'; import 'package:url_launcher/url_launcher.dart'; -class SocialMediaCards extends StatelessWidget { - const SocialMediaCards({Key? key}) : super(key: key); +class SocialMediaWidget extends StatelessWidget { + const SocialMediaWidget({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -13,30 +15,39 @@ class SocialMediaCards extends StatelessWidget { theme: ExpandableThemeData( hasIcon: true, iconColor: Theme.of(context).iconTheme.color, - animationDuration: const Duration(milliseconds: 450), + iconPadding: const EdgeInsets.symmetric(vertical: 16.0), + animationDuration: const Duration(milliseconds: 400), ), header: SizedBox( width: double.infinity, child: ListTile( + contentPadding: EdgeInsets.zero, title: I18nText( - 'socialMediaCards.widgetTitle', + 'socialMediaCard.widgetTitle', child: Text('', style: kSettingItemTextStyle), ), + subtitle: I18nText( + 'socialMediaCard.widgetSubtitle', + child: Text( + '', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + color: isDark ? Colors.grey[400] : Colors.grey[600], + ), + ), + ), ), ), expanded: Card( - color: Theme.of(context).backgroundColor, + color: isDark + ? Theme.of(context).colorScheme.primary + : Theme.of(context).navigationBarTheme.backgroundColor!, child: Column( - children: [ + children: [ ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/github.png', - height: 24, - width: 24, + child: FaIcon( + FontAwesomeIcons.github, color: Theme.of(context).iconTheme.color, ), ), @@ -48,29 +59,25 @@ class SocialMediaCards extends StatelessWidget { ), ), ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( - padding: const EdgeInsets.all(8.0), - child: Icon( - Icons.discord, + padding: const EdgeInsets.all(8.0).copyWith(left: 5), + child: FaIcon( + FontAwesomeIcons.discord, color: Theme.of(context).iconTheme.color, ), ), title: const Text('Discord'), subtitle: const Text('discord.gg/revanced'), onTap: () => launchUrl( - Uri.parse('https://discord.gg/3E2pTWR4Yd'), + Uri.parse('https://discord.gg/rF2YcEjcrT'), mode: LaunchMode.externalApplication, ), ), ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( padding: const EdgeInsets.all(8.0), - child: Icon( - Icons.telegram, + child: FaIcon( + FontAwesomeIcons.telegram, color: Theme.of(context).iconTheme.color, ), ), @@ -82,12 +89,10 @@ class SocialMediaCards extends StatelessWidget { ), ), ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( padding: const EdgeInsets.all(8.0), - child: Icon( - Icons.reddit, + child: FaIcon( + FontAwesomeIcons.reddit, color: Theme.of(context).iconTheme.color, ), ), @@ -99,48 +104,39 @@ class SocialMediaCards extends StatelessWidget { ), ), ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/twitter.png', - height: 24, - width: 24, + child: FaIcon( + FontAwesomeIcons.twitter, color: Theme.of(context).iconTheme.color, ), ), title: const Text('Twitter'), subtitle: const Text('@revancedapp'), onTap: () => launchUrl( - Uri.parse('https://twitter.com/@revancedapp'), + Uri.parse('https://twitter.com/revancedapp'), mode: LaunchMode.externalApplication, ), ), ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0), leading: Padding( padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/youtube.png', - height: 24, - width: 24, + child: FaIcon( + FontAwesomeIcons.youtube, color: Theme.of(context).iconTheme.color, ), ), title: const Text('YouTube'), subtitle: const Text('youtube.com/revanced'), onTap: () => launchUrl( - Uri.parse( - 'https://www.youtube.com/channel/UCLktAUh5Gza9zAJBStwxNdw'), + Uri.parse('https://youtube.com/revanced'), mode: LaunchMode.externalApplication, ), ), ], ), ), - collapsed: const Text(''), + collapsed: Container(), ); } } diff --git a/lib/ui/widgets/settingsView/sources_widget.dart b/lib/ui/widgets/settingsView/sources_widget.dart new file mode 100644 index 00000000..9d0ced7d --- /dev/null +++ b/lib/ui/widgets/settingsView/sources_widget.dart @@ -0,0 +1,80 @@ +import 'package:expandable/expandable.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; +import 'package:revanced_manager/constants.dart'; +import 'package:revanced_manager/theme.dart'; +import 'package:revanced_manager/ui/widgets/settingsView/custom_text_field.dart'; + +class SourcesWidget extends StatelessWidget { + final String title; + final TextEditingController organizationController; + final TextEditingController patchesSourceController; + final TextEditingController integrationsSourceController; + + const SourcesWidget({ + Key? key, + required this.title, + required this.organizationController, + required this.patchesSourceController, + required this.integrationsSourceController, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return ExpandablePanel( + theme: ExpandableThemeData( + hasIcon: true, + iconColor: Theme.of(context).iconTheme.color, + iconPadding: const EdgeInsets.symmetric(vertical: 16.0), + animationDuration: const Duration(milliseconds: 400), + ), + header: SizedBox( + width: double.infinity, + child: ListTile( + contentPadding: EdgeInsets.zero, + title: I18nText( + 'sourcesCard.widgetTitle', + child: Text('', style: kSettingItemTextStyle), + ), + subtitle: I18nText( + 'sourcesCard.widgetSubtitle', + child: Text( + '', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + color: isDark ? Colors.grey[400] : Colors.grey[600], + ), + ), + ), + ), + ), + expanded: Card( + color: isDark + ? Theme.of(context).colorScheme.primary + : Theme.of(context).navigationBarTheme.backgroundColor!, + child: Column( + children: [ + CustomTextField( + inputController: organizationController, + label: I18nText('sourcesCard.organizationLabel'), + hint: ghOrg, + onChanged: (value) => ghOrg = value, + ), + CustomTextField( + inputController: patchesSourceController, + label: I18nText('sourcesCard.patchesSourceLabel'), + hint: patchesRepo, + onChanged: (value) => patchesRepo = value, + ), + CustomTextField( + inputController: integrationsSourceController, + label: I18nText('sourcesCard.integrationsSourceLabel'), + hint: integrationsRepo, + onChanged: (value) => integrationsRepo = value, + ), + ], + ), + ), + collapsed: Container(), + ); + } +} diff --git a/lib/ui/widgets/shared/application_item.dart b/lib/ui/widgets/shared/application_item.dart index 3bfbd2d2..77a0f719 100644 --- a/lib/ui/widgets/shared/application_item.dart +++ b/lib/ui/widgets/shared/application_item.dart @@ -41,7 +41,7 @@ class ApplicationItem extends StatelessWidget { ), padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 12.0), child: Row( - children: [ + children: [ SizedBox( width: 60, child: Image.memory( @@ -55,7 +55,7 @@ class ApplicationItem extends StatelessWidget { width: MediaQuery.of(context).size.width - 250, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Text( name, style: GoogleFonts.roboto( @@ -93,7 +93,7 @@ class ApplicationItem extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ I18nText( 'applicationItem.changelogLabel', child: Text( diff --git a/lib/ui/widgets/shared/custom_sliver_app_bar.dart b/lib/ui/widgets/shared/custom_sliver_app_bar.dart new file mode 100644 index 00000000..21b71f54 --- /dev/null +++ b/lib/ui/widgets/shared/custom_sliver_app_bar.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:revanced_manager/theme.dart'; + +class CustomSliverAppBar extends StatelessWidget { + final Widget title; + final PreferredSizeWidget? bottom; + + const CustomSliverAppBar({ + Key? key, + required this.title, + this.bottom, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return SliverAppBar( + pinned: true, + snap: false, + floating: false, + expandedHeight: 100.0, + automaticallyImplyLeading: false, + backgroundColor: MaterialStateColor.resolveWith( + (states) => states.contains(MaterialState.scrolledUnder) + ? isDark + ? Theme.of(context).colorScheme.primary + : Theme.of(context).navigationBarTheme.backgroundColor! + : Theme.of(context).scaffoldBackgroundColor, + ), + flexibleSpace: FlexibleSpaceBar( + titlePadding: const EdgeInsets.symmetric( + vertical: 23.0, + horizontal: 20.0, + ), + title: title, + ), + bottom: bottom, + ); + } +} diff --git a/lib/ui/widgets/shared/search_bar.dart b/lib/ui/widgets/shared/search_bar.dart index 759beb13..36ecbcda 100644 --- a/lib/ui/widgets/shared/search_bar.dart +++ b/lib/ui/widgets/shared/search_bar.dart @@ -44,7 +44,7 @@ class _SearchBarState extends State { ), ), child: Row( - children: [ + children: [ Expanded( child: TextFormField( onChanged: widget.onQueryChanged, diff --git a/pubspec.yaml b/pubspec.yaml index 6885c423..d57628f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,7 @@ dependencies: flutter_local_notifications: ^9.8.0+1 flutter_svg: ^1.1.1+1 fluttertoast: ^8.0.9 + font_awesome_flutter: ^10.1.0 get_it: ^7.2.0 github: ^9.4.0 google_fonts: ^3.0.1