mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-22 02:33:56 +00:00
feat: improve app theming code and add Material You (#58)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
|
||||
class AppSelectorCard extends StatelessWidget {
|
||||
final Function() onPressed;
|
||||
@@ -18,13 +17,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: CustomCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
@@ -32,9 +25,9 @@ class AppSelectorCard extends StatelessWidget {
|
||||
locator<PatcherViewModel>().selectedApp == null
|
||||
? 'appSelectorCard.widgetTitle'
|
||||
: 'appSelectorCard.widgetTitleSelected',
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -42,13 +35,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
locator<PatcherViewModel>().selectedApp == null
|
||||
? I18nText(
|
||||
'appSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
? I18nText('appSelectorCard.widgetSubtitle')
|
||||
: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
@@ -63,10 +50,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_getAppSelection(),
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
Text(_getAppSelection()),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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/app/app.locator.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
|
||||
class PatchSelectorCard extends StatelessWidget {
|
||||
final Function() onPressed;
|
||||
@@ -18,13 +17,7 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: CustomCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
@@ -32,9 +25,9 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
locator<PatcherViewModel>().selectedPatches.isEmpty
|
||||
? 'patchSelectorCard.widgetTitle'
|
||||
: 'patchSelectorCard.widgetTitleSelected',
|
||||
child: Text(
|
||||
child: const Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -42,25 +35,10 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
locator<PatcherViewModel>().selectedApp == null
|
||||
? I18nText(
|
||||
'patchSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
? I18nText('patchSelectorCard.widgetSubtitle')
|
||||
: locator<PatcherViewModel>().selectedPatches.isEmpty
|
||||
? I18nText(
|
||||
'patchSelectorCard.widgetEmptySubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
_getPatchesSelection(),
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
? I18nText('patchSelectorCard.widgetEmptySubtitle')
|
||||
: Text(_getPatchesSelection()),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user