mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: almost finished homescreen (hardcoded).
This commit is contained in:
parent
6cbc122714
commit
c3982326e4
BIN
lib/assets/images/reddit.png
Normal file
BIN
lib/assets/images/reddit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
6
lib/assets/images/revanced.svg
Normal file
6
lib/assets/images/revanced.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 10.9953C20.4762 9.88627 20.4762 7.11373 18.5714 6.00471L8.92857 0.39032C7.02381 -0.718696 4.64286 0.667579 4.64286 2.88561V4.46595L2.14286 3.01037C1.19048 2.45586 3.61997e-07 3.149 3.61997e-07 4.25801L0 12.742C-3.33951e-08 13.851 1.19048 14.5441 2.14286 13.9896L4.64286 12.534V14.1144C4.64286 16.3324 7.02381 17.7187 8.92857 16.6097L18.5714 10.9953ZM4.64286 4.46595L4.64286 12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595Z" fill="#FF6B78"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 10.9953C20.4762 9.88627 20.4762 7.11373 18.5714 6.00471L8.92857 0.39032C7.02381 -0.718696 4.64286 0.667579 4.64286 2.88561V4.46595L2.14286 3.01037C1.19048 2.45586 3.61997e-07 3.149 3.61997e-07 4.25801L0 12.742C-3.33951e-08 13.851 1.19048 14.5441 2.14286 13.9896L4.64286 12.534V14.1144C4.64286 16.3324 7.02381 17.7187 8.92857 16.6097L18.5714 10.9953ZM4.64286 4.46595L4.64286 12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595Z" fill="#FF4151"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 6.00471C20.4762 7.11373 20.4762 9.88627 18.5714 10.9953L8.92857 16.6097C7.02381 17.7187 4.64286 16.3324 4.64286 14.1144V12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595V2.88561C4.64286 0.667579 7.02381 -0.718696 8.92857 0.39032L18.5714 6.00471Z" fill="#FF6B78"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 6.00471C20.4762 7.11373 20.4762 9.88627 18.5714 10.9953L8.92857 16.6097C7.02381 17.7187 4.64286 16.3324 4.64286 14.1144V12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595V2.88561C4.64286 0.667579 7.02381 -0.718696 8.92857 0.39032L18.5714 6.00471Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
BIN
lib/assets/images/revanced_afn.png
Normal file
BIN
lib/assets/images/revanced_afn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
17
lib/backend/api/github_api.dart
Normal file
17
lib/backend/api/github_api.dart
Normal file
@ -0,0 +1,17 @@
|
||||
import 'package:github/github.dart';
|
||||
|
||||
class GithubAPI {
|
||||
var github = GitHub();
|
||||
|
||||
Future latestRelease(String org, repoName) async {
|
||||
var latestRelease = await github.repositories
|
||||
.getLatestRelease(RepositorySlug(org, repoName));
|
||||
var dlurl = latestRelease.assets?.first.browserDownloadUrl;
|
||||
print(dlurl);
|
||||
return latestRelease;
|
||||
}
|
||||
}
|
||||
|
||||
void main(List<String> args) {
|
||||
GithubAPI().latestRelease('revanced', 'revanced-patches');
|
||||
}
|
1
lib/backend/api/manager_api.dart
Normal file
1
lib/backend/api/manager_api.dart
Normal file
@ -0,0 +1 @@
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager_flutter/ui/screens/home_screen.dart';
|
||||
import 'package:revanced_manager_flutter/ui/screens/patcher_screen.dart';
|
||||
import 'constants.dart';
|
||||
@ -17,6 +18,9 @@ class MyApp extends StatelessWidget {
|
||||
title: 'ReVanced Manager',
|
||||
theme: ThemeData.light().copyWith(
|
||||
backgroundColor: Colors.red,
|
||||
textTheme: GoogleFonts.interTextTheme(
|
||||
Theme.of(context).textTheme,
|
||||
),
|
||||
useMaterial3: true,
|
||||
colorScheme: const ColorScheme.light(
|
||||
primary: purple40,
|
||||
|
9
lib/models/release.dart
Normal file
9
lib/models/release.dart
Normal file
@ -0,0 +1,9 @@
|
||||
import 'package:revanced_manager_flutter/models/release_asset.dart';
|
||||
|
||||
class Release {
|
||||
String? tagName;
|
||||
String? publishedAt;
|
||||
bool? isPrerelease;
|
||||
List<ReleaseAsset>? assets;
|
||||
String? body;
|
||||
}
|
4
lib/models/release_asset.dart
Normal file
4
lib/models/release_asset.dart
Normal file
@ -0,0 +1,4 @@
|
||||
class ReleaseAsset {
|
||||
String? downloadUrl;
|
||||
String? name;
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/available_update.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/installed_apps.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/latest_commit.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({Key? key}) : super(key: key);
|
||||
@ -8,52 +11,61 @@ class HomeScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0.0,
|
||||
horizontal: 24.0,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"ReVanced Manager",
|
||||
style: GoogleFonts.manrope(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0.0,
|
||||
horizontal: 20.0,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.more_vert,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
"Dashboard",
|
||||
style: GoogleFonts.lato(
|
||||
fontSize: 32,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
"ReVanced Updates",
|
||||
style: GoogleFonts.lato(
|
||||
fontSize: 22,
|
||||
const SizedBox(height: 60),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
"Dashboard",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 28,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 23),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
"ReVanced Updates",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const LatestCommitWidget(),
|
||||
const SizedBox(height: 14),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
"Patched Applications",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
const AvailableUpdatesWidget(),
|
||||
const SizedBox(height: 15),
|
||||
const InstalledAppsWidget(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
140
lib/ui/widgets/available_update.dart
Normal file
140
lib/ui/widgets/available_update.dart
Normal file
@ -0,0 +1,140 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class AvailableUpdatesWidget extends StatelessWidget {
|
||||
const AvailableUpdatesWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: const Color(0xff1B222B),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Updates Available(2)",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
primary: Colors.white,
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 18,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
),
|
||||
child: const Text("Patch all"),
|
||||
)
|
||||
],
|
||||
),
|
||||
ListTile(
|
||||
horizontalTitleGap: 12.0,
|
||||
leading: SvgPicture.asset(
|
||||
"lib/assets/images/revanced.svg",
|
||||
height: 26,
|
||||
width: 26,
|
||||
),
|
||||
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"),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
horizontalTitleGap: 12.0,
|
||||
leading: const Image(
|
||||
image: AssetImage("lib/assets/images/reddit.png"),
|
||||
height: 39,
|
||||
width: 39,
|
||||
),
|
||||
title: Text(
|
||||
"ReReddit",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff7792BA),
|
||||
),
|
||||
),
|
||||
subtitle: const Text("Released 1 month 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"),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"Changelog",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"fix: we made the player even worse (you love)",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"chore: guhhughghu",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
85
lib/ui/widgets/installed_apps.dart
Normal file
85
lib/ui/widgets/installed_apps.dart
Normal file
@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class InstalledAppsWidget extends StatelessWidget {
|
||||
const InstalledAppsWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: const Color(0xff1B222B),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Total Installed(3)",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
horizontalTitleGap: 12.0,
|
||||
leading: const Image(
|
||||
image: AssetImage("lib/assets/images/reddit.png"),
|
||||
height: 39,
|
||||
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(
|
||||
"Changelog",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"fix: we made the player even worse (you love)",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"chore: guhhughghu",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
43
lib/ui/widgets/latest_commit.dart
Normal file
43
lib/ui/widgets/latest_commit.dart
Normal file
@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LatestCommitWidget extends StatelessWidget {
|
||||
const LatestCommitWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: const Color(0xff1B222B),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text("Patcher: 20 hours ago"),
|
||||
Text("Manager: 3 days ago"),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
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"),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
16
pubspec.lock
16
pubspec.lock
@ -102,6 +102,13 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
github:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: github
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "9.4.0"
|
||||
google_fonts:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -110,7 +117,7 @@ packages:
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
http:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
@ -123,6 +130,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.6.0"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -36,6 +36,8 @@ dependencies:
|
||||
cupertino_icons: ^1.0.2
|
||||
flutter_svg: ^1.1.1+1
|
||||
google_fonts: ^3.0.1
|
||||
http: ^0.13.4
|
||||
github: ^9.4.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
Reference in New Issue
Block a user