refactor: cleanup.

This commit is contained in:
Aunali321 2022-08-01 14:08:22 +05:30
parent c3982326e4
commit 6bf7411074
5 changed files with 112 additions and 51 deletions

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
const purple80 = Color(0xFFD0BCFF); const purple80 = Color(0xFFD0BCFF);
const purpleGrey80 = Color(0xFFCCC2DC); const purpleGrey80 = Color(0xFFCCC2DC);
@ -6,3 +7,6 @@ const pink80 = Color(0xFFEFB8C8);
const purple40 = Color(0xFF6650a4); const purple40 = Color(0xFF6650a4);
const purpleGrey40 = Color(0xFF625b71); const purpleGrey40 = Color(0xFF625b71);
const pink40 = Color(0xFF7D5260); const pink40 = Color(0xFF7D5260);
final interTextStyle = GoogleFonts.inter();
final robotoTextStyle = GoogleFonts.roboto();

View File

@ -17,6 +17,13 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'ReVanced Manager', title: 'ReVanced Manager',
theme: ThemeData.light().copyWith( theme: ThemeData.light().copyWith(
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(
GoogleFonts.roboto(
fontSize: 12,
),
),
),
backgroundColor: Colors.red, backgroundColor: Colors.red,
textTheme: GoogleFonts.interTextTheme( textTheme: GoogleFonts.interTextTheme(
Theme.of(context).textTheme, Theme.of(context).textTheme,
@ -30,6 +37,18 @@ class MyApp extends StatelessWidget {
), ),
), ),
darkTheme: ThemeData.dark().copyWith( 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, backgroundColor: Colors.red,
useMaterial3: true, useMaterial3: true,
scaffoldBackgroundColor: const Color(0xff0A0D11), scaffoldBackgroundColor: const Color(0xff0A0D11),

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.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 { class AvailableUpdatesWidget extends StatelessWidget {
const AvailableUpdatesWidget({Key? key}) : super(key: key); const AvailableUpdatesWidget({Key? key}) : super(key: key);
@ -58,24 +60,13 @@ class AvailableUpdatesWidget extends StatelessWidget {
color: const Color(0xff7792BA), color: const Color(0xff7792BA),
), ),
), ),
subtitle: const Text("Released 2 days ago"), subtitle: Text(
trailing: TextButton( "Released 2 days ago",
style: robotoTextStyle,
),
trailing: PatchTextButton(
text: "Patch",
onPressed: () {}, 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( ListTile(
@ -91,24 +82,10 @@ class AvailableUpdatesWidget extends StatelessWidget {
color: const Color(0xff7792BA), color: const Color(0xff7792BA),
), ),
), ),
subtitle: const Text("Released 1 month ago"), subtitle: Text("Released 1 month ago", style: robotoTextStyle),
trailing: TextButton( trailing: PatchTextButton(
text: "Patch",
onPressed: () {}, 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), const SizedBox(height: 4),

View File

@ -1,4 +1,7 @@
import 'package:flutter/material.dart'; 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 { class LatestCommitWidget extends StatelessWidget {
const LatestCommitWidget({Key? key}) : super(key: key); const LatestCommitWidget({Key? key}) : super(key: key);
@ -16,26 +19,42 @@ class LatestCommitWidget extends StatelessWidget {
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const [ children: [
Text("Patcher: 20 hours ago"), Row(
Text("Manager: 3 days ago"), 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: () {}, onPressed: () {},
style: TextButton.styleFrom( backgroundColor: const Color(0xff7792BA),
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"),
)
], ],
), ),
); );

View 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,
),
);
}
}