fix: wrong commit time for manager, outlined chips

This commit is contained in:
Aunali321 2022-08-16 23:19:46 +05:30
parent 106d77ea0c
commit 014450642d
5 changed files with 58 additions and 47 deletions

View File

@ -6,7 +6,7 @@
}, },
"homeView": { "homeView": {
"widgetTitle": "Dashboard", "widgetTitle": "Dashboard",
"updatesSubtitle": "ReVanced Updates", "updatesSubtitle": "Updates",
"patchedSubtitle": "Patched Applications", "patchedSubtitle": "Patched Applications",
"updatesAvailable": "Updates Available", "updatesAvailable": "Updates Available",
"installed": "Installed" "installed": "Installed"

View File

@ -31,7 +31,9 @@ class GithubAPI {
var repo = await github.repositories.getRepository( var repo = await github.repositories.getRepository(
RepositorySlug(org, repoName), RepositorySlug(org, repoName),
); );
pushedAt = repo.pushedAt != null ? format(repo.pushedAt!) : ''; pushedAt = repo.pushedAt != null
? format(repo.pushedAt!, locale: 'en_short')
: '';
} on Exception { } on Exception {
pushedAt = ''; pushedAt = '';
} }

View File

@ -33,7 +33,7 @@ class HomeView extends StatelessWidget {
'', '',
style: GoogleFonts.inter( style: GoogleFonts.inter(
fontSize: 28, fontSize: 28,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
), ),
), ),
), ),
@ -55,7 +55,7 @@ class HomeView extends StatelessWidget {
LatestCommitCard( LatestCommitCard(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
const SizedBox(height: 14), const SizedBox(height: 23),
I18nText( I18nText(
'homeView.patchedSubtitle', 'homeView.patchedSubtitle',
child: Text( child: Text(

View File

@ -30,7 +30,8 @@ class DashboardChip extends StatelessWidget {
: Colors.grey[700], : Colors.grey[700],
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
backgroundColor: Colors.transparent, backgroundColor:
isDark ? Theme.of(context).colorScheme.background : Colors.white,
selectedColor: const Color.fromRGBO(118, 155, 209, 0.42), selectedColor: const Color.fromRGBO(118, 155, 209, 0.42),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),

View File

@ -32,6 +32,8 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
I18nText( I18nText(
'latestCommitCard.patcherLabel', 'latestCommitCard.patcherLabel',
@ -52,11 +54,15 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
'latestCommitCard.loadingLabel', 'latestCommitCard.loadingLabel',
), ),
builder: (context, snapshot) => Text( builder: (context, snapshot) => Text(
snapshot.data!, "${snapshot.data!} ago",
style: robotoTextStyle, style: robotoTextStyle,
), ),
), ),
],
),
const SizedBox(height: 8), const SizedBox(height: 8),
Row(
children: [
I18nText( I18nText(
'latestCommitCard.managerLabel', 'latestCommitCard.managerLabel',
child: Text( child: Text(
@ -69,19 +75,21 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
FutureBuilder<String>( FutureBuilder<String>(
future: githubAPI.latestCommitTime( future: githubAPI.latestCommitTime(
'revanced', 'revanced',
'revanced-patcher', 'revanced-manager',
), ),
initialData: FlutterI18n.translate( initialData: FlutterI18n.translate(
context, context,
'latestCommitCard.loadingLabel', 'latestCommitCard.loadingLabel',
), ),
builder: (context, snapshot) => Text( builder: (context, snapshot) => Text(
snapshot.data!, "${snapshot.data!} ago",
style: robotoTextStyle, style: robotoTextStyle,
), ),
), ),
], ],
), ),
],
),
PatchTextButton( PatchTextButton(
text: FlutterI18n.translate( text: FlutterI18n.translate(
context, context,