mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 13:05:37 +02:00
refactor: Better names for widgets.
This commit is contained in:
parent
87192e49c6
commit
48a65872ea
5 changed files with 21 additions and 21 deletions
87
lib/ui/widgets/latest_commit_card.dart
Normal file
87
lib/ui/widgets/latest_commit_card.dart
Normal file
|
@ -0,0 +1,87 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager_flutter/backend/api/github_api.dart';
|
||||
import 'package:revanced_manager_flutter/constants.dart';
|
||||
import 'package:revanced_manager_flutter/ui/widgets/patch_text_button.dart';
|
||||
|
||||
class LatestCommitCard extends StatefulWidget {
|
||||
const LatestCommitCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<LatestCommitCard> createState() => _LatestCommitCardState();
|
||||
}
|
||||
|
||||
class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
GithubAPI githubAPI = GithubAPI();
|
||||
String lastPatcherCommit = "Loading...";
|
||||
String lastManagerCommit = "Loading...";
|
||||
|
||||
void latestCommit() async {
|
||||
lastPatcherCommit =
|
||||
await githubAPI.latestCommitTime("revanced", "revanced-patcher");
|
||||
lastManagerCommit =
|
||||
await githubAPI.latestCommitTime("revanced", "revanced-manager");
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setState(() {
|
||||
latestCommit();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@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: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Patcher: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"$lastPatcherCommit ago",
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Manager: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"$lastManagerCommit ago",
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
PatchTextButton(
|
||||
text: "Update Manager",
|
||||
onPressed: () {},
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue