refactor: major theming overhual, fix light theme.

This commit is contained in:
Aunali321 2022-08-12 15:12:43 +05:30
parent 458f7925b2
commit 4d3ea65d7f
18 changed files with 144 additions and 107 deletions

View File

@ -9,18 +9,24 @@ import 'package:revanced_manager/ui/views/patches_selector/patches_selector_view
import 'package:revanced_manager/ui/views/settings/settings_view.dart'; import 'package:revanced_manager/ui/views/settings/settings_view.dart';
import 'package:stacked/stacked_annotations.dart'; import 'package:stacked/stacked_annotations.dart';
import 'package:stacked_services/stacked_services.dart'; import 'package:stacked_services/stacked_services.dart';
import 'package:stacked_themes/stacked_themes.dart';
@StackedApp(routes: [ @StackedApp(
routes: [
MaterialRoute(page: HomeView), MaterialRoute(page: HomeView),
MaterialRoute(page: AppSelectorView), MaterialRoute(page: AppSelectorView),
MaterialRoute(page: PatcherView), MaterialRoute(page: PatcherView),
MaterialRoute(page: PatchesSelectorView), MaterialRoute(page: PatchesSelectorView),
MaterialRoute(page: SettingsView) MaterialRoute(page: SettingsView)
], dependencies: [ ],
dependencies: [
LazySingleton(classType: NavigationService), LazySingleton(classType: NavigationService),
LazySingleton(classType: PatcherAPI), LazySingleton(classType: PatcherAPI),
LazySingleton(classType: PatcherViewModel), LazySingleton(classType: PatcherViewModel),
LazySingleton(classType: AppSelectorViewModel), LazySingleton(classType: AppSelectorViewModel),
LazySingleton(classType: PatchesSelectorViewModel), LazySingleton(classType: PatchesSelectorViewModel),
]) LazySingleton(
classType: ThemeService, resolveUsing: ThemeService.getInstance),
],
)
class AppSetup {} class AppSetup {}

View File

@ -8,6 +8,7 @@
import 'package:stacked_core/stacked_core.dart'; import 'package:stacked_core/stacked_core.dart';
import 'package:stacked_services/src/navigation/navigation_service.dart'; import 'package:stacked_services/src/navigation/navigation_service.dart';
import 'package:stacked_themes/src/theme_service.dart';
import '../services/patcher_api.dart'; import '../services/patcher_api.dart';
import '../ui/views/app_selector/app_selector_viewmodel.dart'; import '../ui/views/app_selector/app_selector_viewmodel.dart';
@ -28,4 +29,5 @@ Future<void> setupLocator(
locator.registerLazySingleton(() => PatcherViewModel()); locator.registerLazySingleton(() => PatcherViewModel());
locator.registerLazySingleton(() => AppSelectorViewModel()); locator.registerLazySingleton(() => AppSelectorViewModel());
locator.registerLazySingleton(() => PatchesSelectorViewModel()); locator.registerLazySingleton(() => PatchesSelectorViewModel());
locator.registerLazySingleton(() => ThemeService.getInstance());
} }

View File

@ -15,9 +15,10 @@ import 'package:stacked_services/stacked_services.dart';
import 'package:stacked_themes/stacked_themes.dart'; import 'package:stacked_themes/stacked_themes.dart';
Future main() async { Future main() async {
await ThemeManager.initialise();
WidgetsFlutterBinding.ensureInitialized();
setupLocator(); setupLocator();
await ThemeManager.initialise();
setupLocator();
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp()); runApp(const MyApp());
} }

View File

@ -1,9 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/constants.dart';
import 'package:stacked_themes/stacked_themes.dart';
import 'app/app.locator.dart';
final _themeService = locator<ThemeService>();
bool isDark = _themeService.isDarkMode;
var lightTheme = ThemeData.light().copyWith( var lightTheme = ThemeData.light().copyWith(
navigationBarTheme: NavigationBarThemeData( navigationBarTheme: NavigationBarThemeData(
indicatorColor: const Color.fromRGBO(75, 129, 210, 0.20),
backgroundColor: const Color(0xffCBDFFC),
labelTextStyle: MaterialStateProperty.all( labelTextStyle: MaterialStateProperty.all(
GoogleFonts.roboto( GoogleFonts.roboto(
fontSize: 12, fontSize: 12,
@ -12,11 +20,24 @@ var lightTheme = ThemeData.light().copyWith(
), ),
backgroundColor: Colors.red, backgroundColor: Colors.red,
useMaterial3: true, useMaterial3: true,
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
),
),
backgroundColor: MaterialStateProperty.all<Color>(
const Color(0xff4B7CC6),
),
),
),
colorScheme: const ColorScheme.light( colorScheme: const ColorScheme.light(
primary: purple40, primary: Color.fromRGBO(154, 193, 252, 0.18),
secondary: purpleGrey40, secondary: Color(0xff3868AF),
tertiary: pink40, tertiary: Color(0xff485A74),
background: Colors.red, background: Color(0xffDFD5EC),
), ),
); );
@ -36,10 +57,23 @@ var darkTheme = ThemeData.dark().copyWith(
backgroundColor: Colors.red, backgroundColor: Colors.red,
useMaterial3: true, useMaterial3: true,
scaffoldBackgroundColor: const Color(0xff0A0D11), scaffoldBackgroundColor: const Color(0xff0A0D11),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
),
),
backgroundColor: MaterialStateProperty.all<Color>(
const Color.fromRGBO(119, 146, 168, 1),
),
),
),
colorScheme: const ColorScheme.dark( colorScheme: const ColorScheme.dark(
primary: purple80, primary: Color(0x1B222B6B),
secondary: purpleGrey80, secondary: Color(0xff7792BA),
tertiary: pink80, tertiary: Color(0xff8691A0),
background: Colors.red, background: Color(0xff0A0D11),
), ),
); );

View File

@ -1,11 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/widgets/installed_app_item.dart'; import 'package:revanced_manager/ui/widgets/installed_app_item.dart';
import 'package:revanced_manager/ui/widgets/search_bar.dart'; import 'package:revanced_manager/ui/widgets/search_bar.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart'; import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
import 'package:stacked_themes/stacked_themes.dart';
class AppSelectorView extends StatefulWidget { class AppSelectorView extends StatefulWidget {
const AppSelectorView({Key? key}) : super(key: key); const AppSelectorView({Key? key}) : super(key: key);
@ -19,7 +19,6 @@ class _AppSelectorViewState extends State<AppSelectorView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return ViewModelBuilder<AppSelectorViewModel>.reactive( return ViewModelBuilder<AppSelectorViewModel>.reactive(
disposeViewModel: false, disposeViewModel: false,
onModelReady: (model) => model.initialise(), onModelReady: (model) => model.initialise(),
@ -34,12 +33,12 @@ class _AppSelectorViewState extends State<AppSelectorView> {
children: [ children: [
SearchBar( SearchBar(
fillColor: fillColor:
isDark ? Colors.blueGrey[700] : Colors.grey[400], isDark ? const Color(0xff1B222B) : Colors.grey[200],
hintText: FlutterI18n.translate( hintText: FlutterI18n.translate(
context, context,
'appSelectorView.searchBarHint', 'appSelectorView.searchBarHint',
), ),
hintTextColor: isDark ? Colors.white : Colors.grey[800], hintTextColor: Theme.of(context).colorScheme.tertiary,
onQueryChanged: (searchQuery) { onQueryChanged: (searchQuery) {
setState(() { setState(() {
query = searchQuery; query = searchQuery;
@ -53,9 +52,9 @@ class _AppSelectorViewState extends State<AppSelectorView> {
], ],
) )
: query.isEmpty || query.length < 2 : query.isEmpty || query.length < 2
? const Center( ? Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Color(0xff7792BA), color: Theme.of(context).colorScheme.secondary,
), ),
) )
: Center( : Center(

View File

@ -1,19 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/available_updates_card.dart'; import 'package:revanced_manager/ui/widgets/available_updates_card.dart';
import 'package:revanced_manager/ui/widgets/installed_apps_card.dart'; import 'package:revanced_manager/ui/widgets/installed_apps_card.dart';
import 'package:revanced_manager/ui/widgets/latest_commit_card.dart'; import 'package:revanced_manager/ui/widgets/latest_commit_card.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:stacked_themes/stacked_themes.dart';
class HomeView extends StatelessWidget { class HomeView extends StatelessWidget {
const HomeView({Key? key}) : super(key: key); const HomeView({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return ViewModelBuilder.reactive( return ViewModelBuilder.reactive(
viewModelBuilder: () => HomeViewModel(), viewModelBuilder: () => HomeViewModel(),
builder: (context, model, child) => Scaffold( builder: (context, model, child) => Scaffold(
@ -49,31 +48,36 @@ class HomeView extends StatelessWidget {
child: Text( child: Text(
'', '',
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 18, fontSize: 20,
color: isDark
? const Color(0xffD1E1FA)
: const Color(0xff384E6E),
), ),
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
LatestCommitCard( LatestCommitCard(
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary),
),
const SizedBox(height: 14), const SizedBox(height: 14),
I18nText( I18nText(
'homeView.patchedSubtitle', 'homeView.patchedSubtitle',
child: Text( child: Text(
'', '',
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 18, fontSize: 20,
color: isDark
? const Color(0xffD1E1FA)
: const Color(0xff384E6E),
), ),
), ),
), ),
const SizedBox(height: 14), const SizedBox(height: 14),
AvailableUpdatesCard( AvailableUpdatesCard(
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary,
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
InstalledAppsCard( InstalledAppsCard(
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary,
), ),
], ],
), ),

View File

@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/widgets/app_selector_card.dart'; import 'package:revanced_manager/ui/widgets/app_selector_card.dart';
import 'package:revanced_manager/ui/widgets/patch_selector_card.dart'; import 'package:revanced_manager/ui/widgets/patch_selector_card.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:stacked_themes/stacked_themes.dart';
import 'patcher_viewmodel.dart'; import 'patcher_viewmodel.dart';
@ -14,7 +14,6 @@ class PatcherView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return ViewModelBuilder<PatcherViewModel>.reactive( return ViewModelBuilder<PatcherViewModel>.reactive(
disposeViewModel: false, disposeViewModel: false,
viewModelBuilder: () => locator<PatcherViewModel>(), viewModelBuilder: () => locator<PatcherViewModel>(),
@ -25,7 +24,7 @@ class PatcherView extends StatelessWidget {
onPressed: () => {}, onPressed: () => {},
label: I18nText('patcherView.fabButton'), label: I18nText('patcherView.fabButton'),
icon: const Icon(Icons.build), icon: const Icon(Icons.build),
backgroundColor: const Color(0xff7792BA), backgroundColor: Theme.of(context).colorScheme.secondary,
foregroundColor: Colors.white, foregroundColor: Colors.white,
), ),
), ),
@ -49,7 +48,7 @@ class PatcherView extends StatelessWidget {
const SizedBox(height: 23), const SizedBox(height: 23),
AppSelectorCard( AppSelectorCard(
onPressed: model.navigateToAppSelector, onPressed: model.navigateToAppSelector,
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Opacity( Opacity(
@ -58,7 +57,7 @@ class PatcherView extends StatelessWidget {
: (model.dimPatchCard ? 0.75 : 1), : (model.dimPatchCard ? 0.75 : 1),
child: PatchSelectorCard( child: PatchSelectorCard(
onPressed: model.navigateToPatchesSelector, onPressed: model.navigateToPatchesSelector,
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary,
), ),
), ),
], ],

View File

@ -1,11 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/patch_item.dart'; import 'package:revanced_manager/ui/widgets/patch_item.dart';
import 'package:revanced_manager/ui/widgets/search_bar.dart'; import 'package:revanced_manager/ui/widgets/search_bar.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:stacked_themes/stacked_themes.dart';
class PatchesSelectorView extends StatefulWidget { class PatchesSelectorView extends StatefulWidget {
const PatchesSelectorView({Key? key}) : super(key: key); const PatchesSelectorView({Key? key}) : super(key: key);
@ -20,7 +20,6 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return ViewModelBuilder<PatchesSelectorViewModel>.reactive( return ViewModelBuilder<PatchesSelectorViewModel>.reactive(
disposeViewModel: false, disposeViewModel: false,
onModelReady: (model) => model.initialise(), onModelReady: (model) => model.initialise(),
@ -35,12 +34,12 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
children: [ children: [
SearchBar( SearchBar(
fillColor: fillColor:
isDark ? Colors.blueGrey[700] : Colors.grey[400], isDark ? const Color(0xff1B222B) : Colors.grey[200],
hintText: FlutterI18n.translate( hintText: FlutterI18n.translate(
context, context,
'patchesSelectorView.searchBarHint', 'patchesSelectorView.searchBarHint',
), ),
hintTextColor: isDark ? Colors.white : Colors.grey[800], hintTextColor: Theme.of(context).colorScheme.tertiary,
onQueryChanged: (searchQuery) { onQueryChanged: (searchQuery) {
setState(() { setState(() {
query = searchQuery; query = searchQuery;
@ -70,9 +69,9 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
), ),
], ],
) )
: const Center( : Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Color(0xff7792BA), color: Theme.of(context).colorScheme.secondary,
), ),
), ),
), ),

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
import 'package:stacked_themes/stacked_themes.dart'; import 'package:stacked_themes/stacked_themes.dart';
@ -28,9 +29,9 @@ class SettingsView extends StatelessWidget {
title: I18nText('settingsView.themeLabel'), title: I18nText('settingsView.themeLabel'),
subtitle: I18nText('settingsView.themeHint'), subtitle: I18nText('settingsView.themeHint'),
trailing: Switch( trailing: Switch(
value: model.isDarkMode, value: isDark,
onChanged: (value) { onChanged: (value) {
model.isDarkMode = value; isDark = value;
getThemeManager(context).toggleDarkLightTheme(); getThemeManager(context).toggleDarkLightTheme();
}, },
), ),

View File

@ -1,7 +1,6 @@
import 'package:stacked/stacked.dart'; import 'package:stacked/stacked.dart';
class SettingsViewModel extends BaseViewModel { class SettingsViewModel extends BaseViewModel {
bool isDarkMode = true;
void setLanguage(String language) { void setLanguage(String language) {
notifyListeners(); notifyListeners();
} }

View File

@ -38,7 +38,8 @@ class ApplicationItem extends StatelessWidget {
title: Text( title: Text(
name, name,
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff7792BA), color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.w600,
), ),
), ),
subtitle: Text( subtitle: Text(

View File

@ -3,7 +3,6 @@ import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/ui/widgets/application_item.dart'; import 'package:revanced_manager/ui/widgets/application_item.dart';
import 'package:revanced_manager/ui/widgets/patch_text_button.dart'; import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
import 'package:stacked_themes/stacked_themes.dart';
class AvailableUpdatesCard extends StatelessWidget { class AvailableUpdatesCard extends StatelessWidget {
final Color? color; final Color? color;
@ -14,18 +13,19 @@ class AvailableUpdatesCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: color, color: color,
), ),
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
I18nText( I18nText(
@ -34,7 +34,7 @@ class AvailableUpdatesCard extends StatelessWidget {
'', '',
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 16, fontSize: 16,
color: const Color(0xff7792BA), color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
@ -45,10 +45,11 @@ class AvailableUpdatesCard extends StatelessWidget {
'availableUpdatesCard.patchButton', 'availableUpdatesCard.patchButton',
), ),
onPressed: () => {}, onPressed: () => {},
backgroundColor: const Color(0xff7792BA), backgroundColor: Theme.of(context).colorScheme.secondary,
), ),
], ],
), ),
),
ApplicationItem( ApplicationItem(
asset: 'assets/images/revanced.svg', asset: 'assets/images/revanced.svg',
name: 'ReVanced', name: 'ReVanced',
@ -67,7 +68,7 @@ class AvailableUpdatesCard extends StatelessWidget {
child: Text( child: Text(
'', '',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -76,14 +77,14 @@ class AvailableUpdatesCard extends StatelessWidget {
Text( Text(
'fix: we made the player even worse (you love)', 'fix: we made the player even worse (you love)',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
'chore: guhhughghu', 'chore: guhhughghu',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
), ),
), ),
], ],

View File

@ -3,7 +3,6 @@ import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/constants.dart';
import 'package:stacked_themes/stacked_themes.dart';
class InstalledAppItem extends StatefulWidget { class InstalledAppItem extends StatefulWidget {
final String name; final String name;
@ -24,14 +23,13 @@ class InstalledAppItem extends StatefulWidget {
class _InstalledAppItemState extends State<InstalledAppItem> { class _InstalledAppItemState extends State<InstalledAppItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0), padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Container( child: Container(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: isDark ? const Color(0xff1B222B) : Colors.grey[350], color: Theme.of(context).colorScheme.primary,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -28,7 +28,7 @@ class InstalledAppsCard extends StatelessWidget {
'', '',
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 16, fontSize: 16,
color: const Color(0xff7792BA), color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
@ -44,7 +44,7 @@ class InstalledAppsCard extends StatelessWidget {
child: Text( child: Text(
'', '',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -53,14 +53,14 @@ class InstalledAppsCard extends StatelessWidget {
Text( Text(
'fix: we made the player even worse (you love)', 'fix: we made the player even worse (you love)',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
'chore: guhhughghu', 'chore: guhhughghu',
style: GoogleFonts.roboto( style: GoogleFonts.roboto(
color: const Color(0xff8691A0), color: Theme.of(context).colorScheme.tertiary,
), ),
), ),
], ],

View File

@ -95,7 +95,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
'latestCommitCard.updateButton', 'latestCommitCard.updateButton',
), ),
onPressed: () => {}, onPressed: () => {},
backgroundColor: const Color(0xff7792BA), backgroundColor: Theme.of(context).colorScheme.secondary,
), ),
], ],
), ),

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:stacked_themes/stacked_themes.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class PatchItem extends StatefulWidget { class PatchItem extends StatefulWidget {
@ -26,11 +25,9 @@ class PatchItem extends StatefulWidget {
class _PatchItemState extends State<PatchItem> { class _PatchItemState extends State<PatchItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDark ? const Color(0xff1B222B) : Colors.grey[300], color: Theme.of(context).colorScheme.primary,
borderRadius: BorderRadius.circular(10),
), ),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),

View File

@ -5,7 +5,6 @@ import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/constants.dart'; import 'package:revanced_manager/constants.dart';
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart'; import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:stacked_themes/stacked_themes.dart';
class PatchSelectorCard extends StatelessWidget { class PatchSelectorCard extends StatelessWidget {
final Function()? onPressed; final Function()? onPressed;

View File

@ -18,24 +18,21 @@ class PatchTextButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TextButton( return TextButton(
onPressed: onPressed, onPressed: onPressed,
style: TextButton.styleFrom( style: Theme.of(context).textButtonTheme.style?.copyWith(
side: BorderSide( backgroundColor: MaterialStateProperty.all<Color?>(backgroundColor),
side: MaterialStateProperty.all<BorderSide>(
BorderSide(
color: borderColor, color: borderColor,
width: 1, width: 1,
), ),
primary: Colors.white,
backgroundColor: backgroundColor,
padding: const EdgeInsets.symmetric(
vertical: 10,
horizontal: 24,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
), ),
), ),
child: Text( child: Text(
text, text,
style: interTextStyle, style: interTextStyle.copyWith(
color: backgroundColor == Colors.transparent
? const Color.fromRGBO(119, 146, 186, 1)
: Colors.white),
), ),
); );
} }