From 48a65872ea34e754face50eead062d59d123a543 Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Mon, 1 Aug 2022 23:45:55 +0530 Subject: [PATCH] refactor: Better names for widgets. --- lib/ui/screens/home_screen.dart | 12 ++++++------ .../{app_details.dart => application_item.dart} | 4 ++-- ...lable_update.dart => available_updates_card.dart} | 10 +++++----- ...{installed_apps.dart => installed_apps_card.dart} | 8 ++++---- .../{latest_commit.dart => latest_commit_card.dart} | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) rename lib/ui/widgets/{app_details.dart => application_item.dart} (94%) rename lib/ui/widgets/{available_update.dart => available_updates_card.dart} (90%) rename lib/ui/widgets/{installed_apps.dart => installed_apps_card.dart} (88%) rename lib/ui/widgets/{latest_commit.dart => latest_commit_card.dart} (90%) diff --git a/lib/ui/screens/home_screen.dart b/lib/ui/screens/home_screen.dart index 8965ae5d..ec1377ad 100644 --- a/lib/ui/screens/home_screen.dart +++ b/lib/ui/screens/home_screen.dart @@ -1,8 +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'; +import 'package:revanced_manager_flutter/ui/widgets/available_updates_card.dart'; +import 'package:revanced_manager_flutter/ui/widgets/installed_apps_card.dart'; +import 'package:revanced_manager_flutter/ui/widgets/latest_commit_card.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({Key? key}) : super(key: key); @@ -44,7 +44,7 @@ class HomeScreen extends StatelessWidget { ), ), const SizedBox(height: 10), - const LatestCommitWidget(), + const LatestCommitCard(), const SizedBox(height: 14), Text( "Patched Applications", @@ -53,9 +53,9 @@ class HomeScreen extends StatelessWidget { ), ), const SizedBox(height: 14), - const AvailableUpdatesWidget(), + const AvailableUpdatesCard(), const SizedBox(height: 15), - const InstalledAppsWidget(), + const InstalledAppsCard(), ], ), ), diff --git a/lib/ui/widgets/app_details.dart b/lib/ui/widgets/application_item.dart similarity index 94% rename from lib/ui/widgets/app_details.dart rename to lib/ui/widgets/application_item.dart index e8f4dba1..2dad92dc 100644 --- a/lib/ui/widgets/app_details.dart +++ b/lib/ui/widgets/application_item.dart @@ -4,13 +4,13 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:revanced_manager_flutter/constants.dart'; import 'package:revanced_manager_flutter/ui/widgets/patch_text_button.dart'; -class AppDetails extends StatelessWidget { +class ApplicationItem extends StatelessWidget { final String asset; final String name; final String releaseDate; final Function()? onPressed; - const AppDetails({ + const ApplicationItem({ Key? key, required this.asset, required this.name, diff --git a/lib/ui/widgets/available_update.dart b/lib/ui/widgets/available_updates_card.dart similarity index 90% rename from lib/ui/widgets/available_update.dart rename to lib/ui/widgets/available_updates_card.dart index b65688c6..35e79680 100644 --- a/lib/ui/widgets/available_update.dart +++ b/lib/ui/widgets/available_updates_card.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:revanced_manager_flutter/ui/widgets/app_details.dart'; +import 'package:revanced_manager_flutter/ui/widgets/application_item.dart'; import 'package:revanced_manager_flutter/ui/widgets/patch_text_button.dart'; -class AvailableUpdatesWidget extends StatelessWidget { - const AvailableUpdatesWidget({Key? key}) : super(key: key); +class AvailableUpdatesCard extends StatelessWidget { + const AvailableUpdatesCard({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -36,13 +36,13 @@ class AvailableUpdatesWidget extends StatelessWidget { ), ], ), - AppDetails( + ApplicationItem( asset: "lib/assets/images/revanced.svg", name: "ReVanced", releaseDate: "2 days ago", onPressed: () {}, ), - AppDetails( + ApplicationItem( asset: "lib/assets/images/reddit.png", name: "ReReddit", releaseDate: "Released 1 month ago", diff --git a/lib/ui/widgets/installed_apps.dart b/lib/ui/widgets/installed_apps_card.dart similarity index 88% rename from lib/ui/widgets/installed_apps.dart rename to lib/ui/widgets/installed_apps_card.dart index c2466aa2..dd9bfb52 100644 --- a/lib/ui/widgets/installed_apps.dart +++ b/lib/ui/widgets/installed_apps_card.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:revanced_manager_flutter/ui/widgets/app_details.dart'; +import 'package:revanced_manager_flutter/ui/widgets/application_item.dart'; -class InstalledAppsWidget extends StatelessWidget { - const InstalledAppsWidget({Key? key}) : super(key: key); +class InstalledAppsCard extends StatelessWidget { + const InstalledAppsCard({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -25,7 +25,7 @@ class InstalledAppsWidget extends StatelessWidget { fontWeight: FontWeight.w500, ), ), - AppDetails( + ApplicationItem( asset: "lib/assets/images/revanced.svg", name: "ReVanced", releaseDate: "2 days ago", diff --git a/lib/ui/widgets/latest_commit.dart b/lib/ui/widgets/latest_commit_card.dart similarity index 90% rename from lib/ui/widgets/latest_commit.dart rename to lib/ui/widgets/latest_commit_card.dart index 2df96e9f..43af4e82 100644 --- a/lib/ui/widgets/latest_commit.dart +++ b/lib/ui/widgets/latest_commit_card.dart @@ -4,14 +4,14 @@ 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 LatestCommitWidget extends StatefulWidget { - const LatestCommitWidget({Key? key}) : super(key: key); +class LatestCommitCard extends StatefulWidget { + const LatestCommitCard({Key? key}) : super(key: key); @override - State createState() => _LatestCommitWidgetState(); + State createState() => _LatestCommitCardState(); } -class _LatestCommitWidgetState extends State { +class _LatestCommitCardState extends State { GithubAPI githubAPI = GithubAPI(); String lastPatcherCommit = "Loading..."; String lastManagerCommit = "Loading...";