From bbbe37d16a5c522d09227703536ac5cf61a452bb Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 23 Oct 2024 04:46:56 +0300 Subject: [PATCH] refactor: Remove unused icons --- .../components/brand_header/brand_header.dart | 5 +- .../components/brand_icons/brand_icons.dart | 46 --------------- .../components/brand_loader/brand_loader.dart | 1 + .../jobs_content/server_job_card.dart | 2 +- ...service_storage_consumption_list_item.dart | 56 ------------------- lib/ui/pages/more/more.dart | 4 +- .../server_details/server_details_screen.dart | 2 +- lib/ui/pages/users/reset_password.dart | 2 +- 8 files changed, 7 insertions(+), 111 deletions(-) delete mode 100644 lib/ui/components/storage_list_items/service_storage_consumption_list_item.dart diff --git a/lib/ui/components/brand_header/brand_header.dart b/lib/ui/components/brand_header/brand_header.dart index f2ba145f..84172f19 100644 --- a/lib/ui/components/brand_header/brand_header.dart +++ b/lib/ui/components/brand_header/brand_header.dart @@ -18,10 +18,7 @@ class BrandHeader extends StatelessWidget implements PreferredSizeWidget { @override Widget build(final BuildContext context) => AppBar( centerTitle: true, - title: Padding( - padding: const EdgeInsets.only(top: 4.0), - child: Text(title), - ), + title: Text(title), leading: hasBackButton ? IconButton( icon: const Icon(Icons.arrow_back), diff --git a/lib/ui/components/brand_icons/brand_icons.dart b/lib/ui/components/brand_icons/brand_icons.dart index 97b52c27..f9ec0874 100644 --- a/lib/ui/components/brand_icons/brand_icons.dart +++ b/lib/ui/components/brand_icons/brand_icons.dart @@ -23,62 +23,16 @@ class BrandIcons { static const String _kFontFam = 'BrandIcons'; static const String? _kFontPkg = null; - static const IconData connection = - IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData envelope = - IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData document = - IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData key = - IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData save = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData globe = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData help = - IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData refresh_1 = - IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData check = - IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData webcam = - IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData refresh = - IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData git = - IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData social = - IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData settings = - IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData share = - IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData triangle = - IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData engineer = - IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData server = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData box = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu = - IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData users = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData messanger = - IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData upload = - IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arrowLeft = - IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData shape = - IconData(0xe819, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData keyhole = - IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData terminal = IconData(0xe81b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData fire = - IconData(0xe81c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData start = - IconData(0xe81d, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/ui/components/brand_loader/brand_loader.dart b/lib/ui/components/brand_loader/brand_loader.dart index f1a7e024..fef30fde 100644 --- a/lib/ui/components/brand_loader/brand_loader.dart +++ b/lib/ui/components/brand_loader/brand_loader.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +@Deprecated('Use skeletons instead') class BrandLoader { static HorizontalLoader horizontal() => const HorizontalLoader(); } diff --git a/lib/ui/components/jobs_content/server_job_card.dart b/lib/ui/components/jobs_content/server_job_card.dart index b7904351..c83476c1 100644 --- a/lib/ui/components/jobs_content/server_job_card.dart +++ b/lib/ui/components/jobs_content/server_job_card.dart @@ -77,7 +77,7 @@ class ServerJobCard extends StatelessWidget { color: color, backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest, - height: 7.0, + height: 8.0, ), const SizedBox(height: 8), if (statusString != null) diff --git a/lib/ui/components/storage_list_items/service_storage_consumption_list_item.dart b/lib/ui/components/storage_list_items/service_storage_consumption_list_item.dart deleted file mode 100644 index 2ef45e96..00000000 --- a/lib/ui/components/storage_list_items/service_storage_consumption_list_item.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:selfprivacy/ui/components/brand_linear_indicator/brand_linear_indicator.dart'; - -class ServiceStorageConsumptionListItem extends StatelessWidget { - const ServiceStorageConsumptionListItem({ - required this.title, - required this.percentage, - required this.storageConsumptionText, - required this.color, - required this.icon, - super.key, - }); - - final String title; - final double percentage; - final String storageConsumptionText; - final Color color; - final IconData icon; - @override - Widget build(final BuildContext context) => Row( - children: [ - Icon( - icon, - ), - const SizedBox(width: 16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - title, - style: Theme.of(context).textTheme.titleMedium, - ), - Text( - storageConsumptionText, - style: Theme.of(context).textTheme.bodyMedium, - ), - ], - ), - const SizedBox(height: 4), - BrandLinearIndicator( - value: percentage, - color: color, - backgroundColor: - Theme.of(context).colorScheme.surfaceContainerHighest, - height: 7.0, - ), - ], - ), - ), - ], - ); -} diff --git a/lib/ui/pages/more/more.dart b/lib/ui/pages/more/more.dart index 3c91f7a2..797acb42 100644 --- a/lib/ui/pages/more/more.dart +++ b/lib/ui/pages/more/more.dart @@ -71,14 +71,14 @@ class MorePage extends StatelessWidget { ), _MoreMenuItem( title: 'about_application_page.title'.tr(), - iconData: BrandIcons.fire, + iconData: Icons.info_outline, goTo: () => const AboutApplicationRoute(), longGoTo: const DeveloperSettingsRoute(), ), if (!isReady) _MoreMenuItem( title: 'more_page.onboarding'.tr(), - iconData: BrandIcons.start, + iconData: Icons.play_circle_outlined, goTo: () => const OnboardingRoute(), ), _MoreMenuItem( diff --git a/lib/ui/pages/server_details/server_details_screen.dart b/lib/ui/pages/server_details/server_details_screen.dart index c9ada4f9..183f12e0 100644 --- a/lib/ui/pages/server_details/server_details_screen.dart +++ b/lib/ui/pages/server_details/server_details_screen.dart @@ -80,7 +80,7 @@ class _ServerDetailsScreenState extends State const SizedBox(height: 16), ListTile( title: Text('server.settings'.tr()), - leading: const Icon(BrandIcons.settings), + leading: const Icon(Icons.settings_outlined), onTap: () => context.pushRoute(const ServerSettingsRoute()), ), ListTile( diff --git a/lib/ui/pages/users/reset_password.dart b/lib/ui/pages/users/reset_password.dart index 12bb41ae..1579591c 100644 --- a/lib/ui/pages/users/reset_password.dart +++ b/lib/ui/pages/users/reset_password.dart @@ -51,7 +51,7 @@ class ResetPassword extends StatelessWidget { padding: const EdgeInsets.only(right: 8), child: IconButton( icon: Icon( - BrandIcons.refresh, + Icons.refresh, color: Theme.of(context).colorScheme.secondary, ),