mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
refactor: cleanup.
This commit is contained in:
parent
c3982326e4
commit
6bf7411074
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
const purple80 = Color(0xFFD0BCFF);
|
||||
const purpleGrey80 = Color(0xFFCCC2DC);
|
||||
@ -6,3 +7,6 @@ const pink80 = Color(0xFFEFB8C8);
|
||||
const purple40 = Color(0xFF6650a4);
|
||||
const purpleGrey40 = Color(0xFF625b71);
|
||||
const pink40 = Color(0xFF7D5260);
|
||||
|
||||
final interTextStyle = GoogleFonts.inter();
|
||||
final robotoTextStyle = GoogleFonts.roboto();
|
||||
|
@ -17,6 +17,13 @@ class MyApp extends StatelessWidget {
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ReVanced Manager',
|
||||
theme: ThemeData.light().copyWith(
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
labelTextStyle: MaterialStateProperty.all(
|
||||
GoogleFonts.roboto(
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.red,
|
||||
textTheme: GoogleFonts.interTextTheme(
|
||||
Theme.of(context).textTheme,
|
||||
@ -30,6 +37,18 @@ class MyApp extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
darkTheme: ThemeData.dark().copyWith(
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
iconTheme: MaterialStateProperty.all(const IconThemeData(
|
||||
color: Colors.white,
|
||||
)),
|
||||
indicatorColor: const Color(0xff223144),
|
||||
backgroundColor: const Color(0x1b222b6b),
|
||||
labelTextStyle: MaterialStateProperty.all(
|
||||
GoogleFonts.roboto(
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.red,
|
||||
useMaterial3: true,
|
||||
scaffoldBackgroundColor: const Color(0xff0A0D11),
|
||||
|
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager_flutter/constants.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/patch_text_button.dart';
|
||||
|
||||
class AvailableUpdatesWidget extends StatelessWidget {
|
||||
const AvailableUpdatesWidget({Key? key}) : super(key: key);
|
||||
@ -58,24 +60,13 @@ class AvailableUpdatesWidget extends StatelessWidget {
|
||||
color: const Color(0xff7792BA),
|
||||
),
|
||||
),
|
||||
subtitle: const Text("Released 2 days ago"),
|
||||
trailing: TextButton(
|
||||
subtitle: Text(
|
||||
"Released 2 days ago",
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
trailing: PatchTextButton(
|
||||
text: "Patch",
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
side: const BorderSide(
|
||||
color: Color(0xff7792BA),
|
||||
width: 1,
|
||||
),
|
||||
primary: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 24,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
),
|
||||
child: const Text("Patch"),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
@ -91,24 +82,10 @@ class AvailableUpdatesWidget extends StatelessWidget {
|
||||
color: const Color(0xff7792BA),
|
||||
),
|
||||
),
|
||||
subtitle: const Text("Released 1 month ago"),
|
||||
trailing: TextButton(
|
||||
subtitle: Text("Released 1 month ago", style: robotoTextStyle),
|
||||
trailing: PatchTextButton(
|
||||
text: "Patch",
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
side: const BorderSide(
|
||||
color: Color(0xff7792BA),
|
||||
width: 1,
|
||||
),
|
||||
primary: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 24,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
),
|
||||
child: const Text("Patch"),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
|
@ -1,4 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager_flutter/constants.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/patch_text_button.dart';
|
||||
|
||||
class LatestCommitWidget extends StatelessWidget {
|
||||
const LatestCommitWidget({Key? key}) : super(key: key);
|
||||
@ -16,26 +19,42 @@ class LatestCommitWidget extends StatelessWidget {
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text("Patcher: 20 hours ago"),
|
||||
Text("Manager: 3 days ago"),
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Patcher: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"20 hours ago",
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Manager: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"3 days ago",
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
PatchTextButton(
|
||||
text: "Update Manager",
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
primary: Colors.white,
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 24,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
),
|
||||
child: const Text("Update Manager"),
|
||||
)
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
42
lib/ui/widgets/patch_text_button.dart
Normal file
42
lib/ui/widgets/patch_text_button.dart
Normal file
@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:revanced_manager_flutter/constants.dart';
|
||||
|
||||
class PatchTextButton extends StatelessWidget {
|
||||
final String text;
|
||||
final Function()? onPressed;
|
||||
final Color borderColor;
|
||||
final Color backgroundColor;
|
||||
const PatchTextButton({
|
||||
Key? key,
|
||||
required this.text,
|
||||
this.onPressed,
|
||||
this.borderColor = const Color(0xff7792BA),
|
||||
this.backgroundColor = Colors.transparent,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
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),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: interTextStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user