From 014450642d3684f77cd4ac41b0c5ca491e49dace Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Tue, 16 Aug 2022 23:19:46 +0530 Subject: [PATCH] fix: wrong commit time for manager, outlined chips --- assets/i18n/en.json | 2 +- lib/services/github_api.dart | 4 +- lib/ui/views/home/home_view.dart | 4 +- lib/ui/widgets/dashboard_raw_chip.dart | 3 +- lib/ui/widgets/latest_commit_card.dart | 92 ++++++++++++++------------ 5 files changed, 58 insertions(+), 47 deletions(-) diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 638a6fd6..8817561e 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -6,7 +6,7 @@ }, "homeView": { "widgetTitle": "Dashboard", - "updatesSubtitle": "ReVanced Updates", + "updatesSubtitle": "Updates", "patchedSubtitle": "Patched Applications", "updatesAvailable": "Updates Available", "installed": "Installed" diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index 4d713f27..3335d29d 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -31,7 +31,9 @@ class GithubAPI { var repo = await github.repositories.getRepository( RepositorySlug(org, repoName), ); - pushedAt = repo.pushedAt != null ? format(repo.pushedAt!) : ''; + pushedAt = repo.pushedAt != null + ? format(repo.pushedAt!, locale: 'en_short') + : ''; } on Exception { pushedAt = ''; } diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 2c27937b..2b4f1c88 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -33,7 +33,7 @@ class HomeView extends StatelessWidget { '', style: GoogleFonts.inter( fontSize: 28, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w500, ), ), ), @@ -55,7 +55,7 @@ class HomeView extends StatelessWidget { LatestCommitCard( color: Theme.of(context).colorScheme.primary, ), - const SizedBox(height: 14), + const SizedBox(height: 23), I18nText( 'homeView.patchedSubtitle', child: Text( diff --git a/lib/ui/widgets/dashboard_raw_chip.dart b/lib/ui/widgets/dashboard_raw_chip.dart index 960a339f..2685813c 100644 --- a/lib/ui/widgets/dashboard_raw_chip.dart +++ b/lib/ui/widgets/dashboard_raw_chip.dart @@ -30,7 +30,8 @@ class DashboardChip extends StatelessWidget { : Colors.grey[700], fontWeight: FontWeight.w500, ), - backgroundColor: Colors.transparent, + backgroundColor: + isDark ? Theme.of(context).colorScheme.background : Colors.white, selectedColor: const Color.fromRGBO(118, 155, 209, 0.42), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), diff --git a/lib/ui/widgets/latest_commit_card.dart b/lib/ui/widgets/latest_commit_card.dart index e59d9668..91692a9f 100644 --- a/lib/ui/widgets/latest_commit_card.dart +++ b/lib/ui/widgets/latest_commit_card.dart @@ -33,52 +33,60 @@ class _LatestCommitCardState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - I18nText( - 'latestCommitCard.patcherLabel', - child: Text( - '', - style: GoogleFonts.roboto( - fontWeight: FontWeight.w700, + Row( + children: [ + I18nText( + 'latestCommitCard.patcherLabel', + child: Text( + '', + style: GoogleFonts.roboto( + fontWeight: FontWeight.w700, + ), + ), ), - ), - ), - FutureBuilder( - future: githubAPI.latestCommitTime( - 'revanced', - 'revanced-patcher', - ), - initialData: FlutterI18n.translate( - context, - 'latestCommitCard.loadingLabel', - ), - builder: (context, snapshot) => Text( - snapshot.data!, - style: robotoTextStyle, - ), + FutureBuilder( + future: githubAPI.latestCommitTime( + 'revanced', + 'revanced-patcher', + ), + initialData: FlutterI18n.translate( + context, + 'latestCommitCard.loadingLabel', + ), + builder: (context, snapshot) => Text( + "${snapshot.data!} ago", + style: robotoTextStyle, + ), + ), + ], ), const SizedBox(height: 8), - I18nText( - 'latestCommitCard.managerLabel', - child: Text( - '', - style: GoogleFonts.roboto( - fontWeight: FontWeight.w700, + Row( + children: [ + I18nText( + 'latestCommitCard.managerLabel', + child: Text( + '', + style: GoogleFonts.roboto( + fontWeight: FontWeight.w700, + ), + ), ), - ), - ), - FutureBuilder( - future: githubAPI.latestCommitTime( - 'revanced', - 'revanced-patcher', - ), - initialData: FlutterI18n.translate( - context, - 'latestCommitCard.loadingLabel', - ), - builder: (context, snapshot) => Text( - snapshot.data!, - style: robotoTextStyle, - ), + FutureBuilder( + future: githubAPI.latestCommitTime( + 'revanced', + 'revanced-manager', + ), + initialData: FlutterI18n.translate( + context, + 'latestCommitCard.loadingLabel', + ), + builder: (context, snapshot) => Text( + "${snapshot.data!} ago", + style: robotoTextStyle, + ), + ), + ], ), ], ),