mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
refactor: cleanup.
This commit is contained in:
@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user