refactor: MOARR CLEANUP.

This commit is contained in:
Aunali321 2022-08-01 17:54:05 +05:30
parent 561e67b674
commit d4dc845e00
4 changed files with 28 additions and 58 deletions

View File

@ -18,6 +18,7 @@ class HomeScreen extends StatelessWidget {
horizontal: 20.0, horizontal: 20.0,
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Align( Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
@ -29,35 +30,26 @@ class HomeScreen extends StatelessWidget {
), ),
), ),
const SizedBox(height: 60), const SizedBox(height: 60),
Align( Text(
alignment: Alignment.topLeft, "Dashboard",
child: Text( style: GoogleFonts.inter(
"Dashboard", fontSize: 28,
style: GoogleFonts.inter(
fontSize: 28,
),
), ),
), ),
const SizedBox(height: 23), const SizedBox(height: 23),
Align( Text(
alignment: Alignment.topLeft, "ReVanced Updates",
child: Text( style: GoogleFonts.inter(
"ReVanced Updates", fontSize: 18,
style: GoogleFonts.inter(
fontSize: 18,
),
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
const LatestCommitWidget(), const LatestCommitWidget(),
const SizedBox(height: 14), const SizedBox(height: 14),
Align( Text(
alignment: Alignment.topLeft, "Patched Applications",
child: Text( style: GoogleFonts.inter(
"Patched Applications", fontSize: 18,
style: GoogleFonts.inter(
fontSize: 18,
),
), ),
), ),
const SizedBox(height: 14), const SizedBox(height: 14),

View File

@ -8,12 +8,14 @@ class AppDetails extends StatelessWidget {
final String asset; final String asset;
final String name; final String name;
final String releaseDate; final String releaseDate;
final Function()? onPressed;
const AppDetails({ const AppDetails({
Key? key, Key? key,
required this.asset, required this.asset,
required this.name, required this.name,
required this.releaseDate, required this.releaseDate,
required this.onPressed,
}) : super(key: key); }) : super(key: key);
@override @override
@ -24,8 +26,8 @@ class AppDetails extends StatelessWidget {
leading: isSVG leading: isSVG
? SvgPicture.asset( ? SvgPicture.asset(
asset, asset,
height: 24, height: 26,
width: 24, width: 26,
) )
: Image.asset( : Image.asset(
asset, asset,
@ -44,7 +46,7 @@ class AppDetails extends StatelessWidget {
), ),
trailing: PatchTextButton( trailing: PatchTextButton(
text: "Patch", text: "Patch",
onPressed: () {}, onPressed: onPressed,
), ),
); );
} }

View File

@ -36,15 +36,17 @@ class AvailableUpdatesWidget extends StatelessWidget {
), ),
], ],
), ),
const AppDetails( AppDetails(
asset: "lib/assets/images/revanced.svg", asset: "lib/assets/images/revanced.svg",
name: "ReVanced", name: "ReVanced",
releaseDate: "2 days ago", releaseDate: "2 days ago",
onPressed: () {},
), ),
const AppDetails( AppDetails(
asset: "lib/assets/images/reddit.png", asset: "lib/assets/images/reddit.png",
name: "ReReddit", name: "ReReddit",
releaseDate: "Released 1 month ago", releaseDate: "Released 1 month ago",
onPressed: () {},
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager_flutter/ui/widgets/app_details.dart';
class InstalledAppsWidget extends StatelessWidget { class InstalledAppsWidget extends StatelessWidget {
const InstalledAppsWidget({Key? key}) : super(key: key); const InstalledAppsWidget({Key? key}) : super(key: key);
@ -24,38 +25,11 @@ class InstalledAppsWidget extends StatelessWidget {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
ListTile( AppDetails(
horizontalTitleGap: 12.0, asset: "lib/assets/images/revanced.svg",
leading: const Image( name: "ReVanced",
image: AssetImage("lib/assets/images/reddit.png"), releaseDate: "2 days ago",
height: 39, onPressed: () {},
width: 39,
),
title: Text(
"ReVanced",
style: GoogleFonts.roboto(
color: const Color(0xff7792BA),
),
),
subtitle: const Text("Released 2 days ago"),
trailing: TextButton(
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"),
),
), ),
Text( Text(
"Changelog", "Changelog",