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

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

View File

@ -3,7 +3,6 @@ import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/ui/widgets/application_item.dart';
import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
import 'package:stacked_themes/stacked_themes.dart';
class AvailableUpdatesCard extends StatelessWidget {
final Color? color;
@ -14,40 +13,42 @@ class AvailableUpdatesCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: color,
),
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
I18nText(
'availableUpdatesCard.widgetTitle',
child: Text(
'',
style: GoogleFonts.inter(
fontSize: 16,
color: const Color(0xff7792BA),
fontWeight: FontWeight.w500,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
I18nText(
'availableUpdatesCard.widgetTitle',
child: Text(
'',
style: GoogleFonts.inter(
fontSize: 16,
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.w500,
),
),
),
),
PatchTextButton(
text: FlutterI18n.translate(
context,
'availableUpdatesCard.patchButton',
PatchTextButton(
text: FlutterI18n.translate(
context,
'availableUpdatesCard.patchButton',
),
onPressed: () => {},
backgroundColor: Theme.of(context).colorScheme.secondary,
),
onPressed: () => {},
backgroundColor: const Color(0xff7792BA),
),
],
],
),
),
ApplicationItem(
asset: 'assets/images/revanced.svg',
@ -67,7 +68,7 @@ class AvailableUpdatesCard extends StatelessWidget {
child: Text(
'',
style: GoogleFonts.roboto(
color: const Color(0xff8691A0),
color: Theme.of(context).colorScheme.tertiary,
fontWeight: FontWeight.w700,
),
),
@ -76,14 +77,14 @@ class AvailableUpdatesCard extends StatelessWidget {
Text(
'fix: we made the player even worse (you love)',
style: GoogleFonts.roboto(
color: const Color(0xff8691A0),
color: Theme.of(context).colorScheme.tertiary,
),
),
const SizedBox(height: 4),
Text(
'chore: guhhughghu',
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:google_fonts/google_fonts.dart';
import 'package:revanced_manager/constants.dart';
import 'package:stacked_themes/stacked_themes.dart';
class InstalledAppItem extends StatefulWidget {
final String name;
@ -24,14 +23,13 @@ class InstalledAppItem extends StatefulWidget {
class _InstalledAppItemState extends State<InstalledAppItem> {
@override
Widget build(BuildContext context) {
bool isDark = getThemeManager(context).isDarkMode;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Container(
padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: isDark ? const Color(0xff1B222B) : Colors.grey[350],
color: Theme.of(context).colorScheme.primary,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

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

View File

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

View File

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