From e902b057036141a7b1cea0bad8bfa027cb707520 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 9 Apr 2023 15:28:01 +0200 Subject: [PATCH] neon: Prefix all widget names --- packages/neon/neon/lib/neon.dart | 7 ++--- packages/neon/neon/lib/src/app.dart | 12 +++++++- .../neon/lib/src/pages/account_settings.dart | 4 +-- packages/neon/neon/lib/src/pages/home.dart | 28 +++++++++---------- packages/neon/neon/lib/src/pages/login.dart | 10 +++---- .../neon/neon/lib/src/pages/settings.dart | 10 +++---- .../neon/lib/src/utils/rename_dialog.dart | 2 +- .../neon/lib/src/widgets/account_avatar.dart | 6 ++-- .../src/widgets/account_settings_tile.dart | 6 ++-- .../neon/lib/src/widgets/account_tile.dart | 10 +++---- .../src/widgets/app_implementation_icon.dart | 4 +-- .../lib/src/widgets/cached_api_image.dart | 4 +-- .../neon/lib/src/widgets/cached_image.dart | 6 ++-- .../lib/src/widgets/cached_url_image.dart | 4 +-- .../{custom_dialog.dart => dialog.dart} | 4 +-- .../neon/neon/lib/src/widgets/exception.dart | 4 +-- .../neon/lib/src/widgets/image_wrapper.dart | 4 +-- ...or.dart => linear_progress_indicator.dart} | 4 +-- .../{custom_listview.dart => list_view.dart} | 8 +++--- .../src/widgets/no_animation_page_route.dart | 11 -------- .../lib/src/widgets/text_settings_tile.dart | 4 +-- .../neon_files/lib/dialogs/choose_create.dart | 2 +- .../neon_files/lib/dialogs/create_folder.dart | 2 +- packages/neon/neon_files/lib/pages/main.dart | 2 +- .../neon_files/lib/widgets/browser_view.dart | 4 +-- .../neon_files/lib/widgets/file_preview.dart | 4 +-- .../neon/neon_news/lib/dialogs/add_feed.dart | 6 ++-- .../neon_news/lib/dialogs/create_folder.dart | 2 +- .../neon/neon_news/lib/dialogs/move_feed.dart | 2 +- .../neon/neon_news/lib/pages/article.dart | 2 +- packages/neon/neon_news/lib/pages/main.dart | 2 +- .../neon_news/lib/widgets/articles_view.dart | 6 ++-- .../neon/neon_news/lib/widgets/feed_icon.dart | 4 +-- .../neon_news/lib/widgets/feeds_view.dart | 2 +- .../neon_news/lib/widgets/folders_view.dart | 2 +- .../neon_notes/lib/dialogs/create_note.dart | 6 ++-- .../lib/dialogs/select_category.dart | 6 ++-- .../lib/utils/exception_handler.dart | 4 +-- .../lib/widgets/categories_view.dart | 2 +- .../neon_notes/lib/widgets/notes_view.dart | 2 +- .../neon_notifications/lib/pages/main.dart | 6 ++-- 41 files changed, 109 insertions(+), 111 deletions(-) rename packages/neon/neon/lib/src/widgets/{custom_dialog.dart => dialog.dart} (84%) rename packages/neon/neon/lib/src/widgets/{custom_linear_progress_indicator.dart => linear_progress_indicator.dart} (86%) rename packages/neon/neon/lib/src/widgets/{custom_listview.dart => list_view.dart} (92%) delete mode 100644 packages/neon/neon/lib/src/widgets/no_animation_page_route.dart diff --git a/packages/neon/neon/lib/neon.dart b/packages/neon/neon/lib/neon.dart index e5fb2380..becfc733 100644 --- a/packages/neon/neon/lib/neon.dart +++ b/packages/neon/neon/lib/neon.dart @@ -96,14 +96,13 @@ part 'src/widgets/app_implementation_icon.dart'; part 'src/widgets/cached_api_image.dart'; part 'src/widgets/cached_image.dart'; part 'src/widgets/cached_url_image.dart'; -part 'src/widgets/custom_dialog.dart'; -part 'src/widgets/custom_linear_progress_indicator.dart'; -part 'src/widgets/custom_listview.dart'; +part 'src/widgets/dialog.dart'; part 'src/widgets/exception.dart'; part 'src/widgets/image_wrapper.dart'; +part 'src/widgets/linear_progress_indicator.dart'; +part 'src/widgets/list_view.dart'; part 'src/widgets/neon_logo.dart'; part 'src/widgets/nextcloud_logo.dart'; -part 'src/widgets/no_animation_page_route.dart'; part 'src/widgets/relative_time.dart'; part 'src/widgets/result_builder.dart'; part 'src/widgets/text_settings_tile.dart'; diff --git a/packages/neon/neon/lib/src/app.dart b/packages/neon/neon/lib/src/app.dart index a65778b0..46d54d29 100644 --- a/packages/neon/neon/lib/src/app.dart +++ b/packages/neon/neon/lib/src/app.dart @@ -91,7 +91,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra settings: settings, builder: builder, ) - : NoAnimationPageRoute( + : _NoAnimationPageRoute( settings: settings, builder: builder, ), @@ -330,3 +330,13 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra ), ); } + +class _NoAnimationPageRoute extends MaterialPageRoute { + _NoAnimationPageRoute({ + required super.builder, + super.settings, + }); + + @override + Duration get transitionDuration => Duration.zero; +} diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index f26e0ac1..80c8b555 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -77,11 +77,11 @@ class AccountSettingsPage extends StatelessWidget { ), ), ], - ExceptionWidget( + NeonException( userDetails.error, onRetry: _userDetailsBloc.refresh, ), - CustomLinearProgressIndicator( + NeonLinearProgressIndicator( visible: userDetails.loading, ), ], diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index f11c547c..796f3f67 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -113,7 +113,7 @@ class _HomePageState extends State { } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); - ExceptionWidget.showSnackbar(context, e); + NeonException.showSnackbar(context, e); } } @@ -250,7 +250,7 @@ class _HomePageState extends State { _accountsBloc.setActiveAccount(account); }, icon: IntrinsicHeight( - child: AccountAvatar( + child: NeonAccountAvatar( account: account, ), ), @@ -290,17 +290,17 @@ class _HomePageState extends State { ], if (capabilities.data!.capabilities.theming?.logo != null) ...[ Flexible( - child: CachedURLImage( + child: NeonCachedUrlImage( url: capabilities.data!.capabilities.theming!.logo!, ), ), ], ] else ...[ - ExceptionWidget( + NeonException( capabilities.error, onRetry: _capabilitiesBloc.refresh, ), - CustomLinearProgressIndicator( + NeonLinearProgressIndicator( visible: capabilities.loading, ), ], @@ -316,7 +316,7 @@ class _HomePageState extends State { .map>( (final account) => DropdownMenuItem( value: account.id, - child: AccountTile( + child: NeonAccountTile( account: account, dense: true, textColor: @@ -343,12 +343,12 @@ class _HomePageState extends State { return Container(); }, ), - ExceptionWidget( + NeonException( appImplementations.error, onlyIcon: isQuickBar, onRetry: _appsBloc.refresh, ), - CustomLinearProgressIndicator( + NeonLinearProgressIndicator( visible: appImplementations.loading, ), if (appImplementations.data != null) ...[ @@ -365,7 +365,7 @@ class _HomePageState extends State { onPressed: () async { await _appsBloc.setActiveApp(appImplementation.id); }, - icon: AppImplementationIcon( + icon: NeonAppImplementationIcon( appImplementation: appImplementation, unreadCount: unreadCount, color: Theme.of(context).colorScheme.primary, @@ -459,7 +459,7 @@ class _HomePageState extends State { ? Container( padding: const EdgeInsets.all(5), child: capabilities.data?.capabilities.theming?.logo != null - ? CachedURLImage( + ? NeonCachedUrlImage( url: capabilities.data!.capabilities.theming!.logo!, ) : null, @@ -494,7 +494,7 @@ class _HomePageState extends State { width: 8, ), Expanded( - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( color: Theme.of(context).appBarTheme.foregroundColor, ), ), @@ -517,7 +517,7 @@ class _HomePageState extends State { final unreadCount = unreadCounterSnapshot.data ?? 0; return IconButton( key: Key('app-${notificationsAppImplementation.data!.id}'), - icon: AppImplementationIcon( + icon: NeonAppImplementationIcon( appImplementation: notificationsAppImplementation.data!, unreadCount: unreadCount, color: unreadCount > 0 @@ -539,7 +539,7 @@ class _HomePageState extends State { ], IconButton( icon: IntrinsicWidth( - child: AccountAvatar( + child: NeonAccountAvatar( account: account, ), ), @@ -564,7 +564,7 @@ class _HomePageState extends State { Expanded( child: Column( children: [ - ExceptionWidget( + NeonException( appImplementations.error, onRetry: _appsBloc.refresh, ), diff --git a/packages/neon/neon/lib/src/pages/login.dart b/packages/neon/neon/lib/src/pages/login.dart index 6a00e2e2..248f0eb9 100644 --- a/packages/neon/neon/lib/src/pages/login.dart +++ b/packages/neon/neon/lib/src/pages/login.dart @@ -63,7 +63,7 @@ class _LoginPageState extends State { } else { for (final a in _accountsBloc.accounts.value) { if (a.id == account.id) { - ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists); + NeonException.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists); await _loginBloc.refresh(); return; } @@ -75,7 +75,7 @@ class _LoginPageState extends State { } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); - ExceptionWidget.showSnackbar(context, e); + NeonException.showSnackbar(context, e); await _loginBloc.refresh(); } } @@ -212,17 +212,17 @@ class _LoginPageState extends State { ), Column( children: [ - CustomLinearProgressIndicator( + NeonLinearProgressIndicator( visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading, ), if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[ - ExceptionWidget( + NeonException( AppLocalizations.of(context).errorUnableToReachServer, onRetry: _loginBloc.refresh, ), ], if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[ - ExceptionWidget( + NeonException( AppLocalizations.of(context).errorServerInMaintenanceMode, onRetry: _loginBloc.refresh, ), diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index ba999b50..6c9e58f8 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -121,7 +121,7 @@ class _SettingsPageState extends State { tiles: [ if (pushNotificationsEnabledEnabledSnapshot.data != null && !pushNotificationsEnabledEnabledSnapshot.data!) ...[ - TextSettingsTile( + NeonTextSettingsTile( text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice, style: const TextStyle( fontWeight: FontWeight.w600, @@ -178,7 +178,7 @@ class _SettingsPageState extends State { ), ], for (final account in accountsSnapshot.data!) ...[ - AccountSettingsTile( + NeonAccountSettingsTile( account: account, onTap: () async { await Navigator.of(context).push( @@ -250,7 +250,7 @@ class _SettingsPageState extends State { } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); - ExceptionWidget.showSnackbar(context, e); + NeonException.showSnackbar(context, e); } }, ), @@ -272,7 +272,7 @@ class _SettingsPageState extends State { if (!result.files.single.path!.endsWith('.json.base64')) { if (mounted) { - ExceptionWidget.showSnackbar( + NeonException.showSnackbar( context, AppLocalizations.of(context).settingsImportWrongFileExtension, ); @@ -286,7 +286,7 @@ class _SettingsPageState extends State { } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); - ExceptionWidget.showSnackbar(context, e); + NeonException.showSnackbar(context, e); } }, ), diff --git a/packages/neon/neon/lib/src/utils/rename_dialog.dart b/packages/neon/neon/lib/src/utils/rename_dialog.dart index 82dbf330..e03efb68 100644 --- a/packages/neon/neon/lib/src/utils/rename_dialog.dart +++ b/packages/neon/neon/lib/src/utils/rename_dialog.dart @@ -41,7 +41,7 @@ class _RenameDialogState extends State<_RenameDialog> { } @override - Widget build(final BuildContext context) => CustomDialog( + Widget build(final BuildContext context) => NeonDialog( title: Text(widget.title), children: [ Form( diff --git a/packages/neon/neon/lib/src/widgets/account_avatar.dart b/packages/neon/neon/lib/src/widgets/account_avatar.dart index 776d04c3..8747c5f2 100644 --- a/packages/neon/neon/lib/src/widgets/account_avatar.dart +++ b/packages/neon/neon/lib/src/widgets/account_avatar.dart @@ -2,8 +2,8 @@ part of '../../neon.dart'; const kAvatarSize = 40.0; -class AccountAvatar extends StatelessWidget { - const AccountAvatar({ +class NeonAccountAvatar extends StatelessWidget { + const NeonAccountAvatar({ required this.account, super.key, }); @@ -20,7 +20,7 @@ class AccountAvatar extends StatelessWidget { CircleAvatar( radius: kAvatarSize / 2, child: ClipOval( - child: CachedAPIImage( + child: NeonCachedApiImage( account: account, cacheKey: 'avatar-${account.id}-${isDark ? 'dark' : 'light'}$size', download: () async { diff --git a/packages/neon/neon/lib/src/widgets/account_settings_tile.dart b/packages/neon/neon/lib/src/widgets/account_settings_tile.dart index adb0945e..74801495 100644 --- a/packages/neon/neon/lib/src/widgets/account_settings_tile.dart +++ b/packages/neon/neon/lib/src/widgets/account_settings_tile.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class AccountSettingsTile extends SettingsTile { - const AccountSettingsTile({ +class NeonAccountSettingsTile extends SettingsTile { + const NeonAccountSettingsTile({ required this.account, this.color, this.trailing, @@ -15,7 +15,7 @@ class AccountSettingsTile extends SettingsTile { final VoidCallback? onTap; @override - Widget build(final BuildContext context) => AccountTile( + Widget build(final BuildContext context) => NeonAccountTile( account: account, color: color, trailing: trailing, diff --git a/packages/neon/neon/lib/src/widgets/account_tile.dart b/packages/neon/neon/lib/src/widgets/account_tile.dart index 7a7e1453..ffac71b3 100644 --- a/packages/neon/neon/lib/src/widgets/account_tile.dart +++ b/packages/neon/neon/lib/src/widgets/account_tile.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class AccountTile extends StatelessWidget { - const AccountTile({ +class NeonAccountTile extends StatelessWidget { + const NeonAccountTile({ required this.account, this.color, this.trailing, @@ -34,7 +34,7 @@ class AccountTile extends StatelessWidget { ) : null, leading: IntrinsicWidth( - child: AccountAvatar( + child: NeonAccountAvatar( account: account, ), ), @@ -58,7 +58,7 @@ class AccountTile extends StatelessWidget { width: 5, ), Expanded( - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( color: textColor, ), ), @@ -67,7 +67,7 @@ class AccountTile extends StatelessWidget { const SizedBox( width: 5, ), - ExceptionWidget( + NeonException( userDetails.error, onlyIcon: true, iconSize: 24, diff --git a/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart b/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart index 8063be7f..3b9e56c2 100644 --- a/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart +++ b/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class AppImplementationIcon extends StatelessWidget { - const AppImplementationIcon({ +class NeonAppImplementationIcon extends StatelessWidget { + const NeonAppImplementationIcon({ required this.appImplementation, this.unreadCount = 0, this.color, diff --git a/packages/neon/neon/lib/src/widgets/cached_api_image.dart b/packages/neon/neon/lib/src/widgets/cached_api_image.dart index ada5f4e4..6c91a4be 100644 --- a/packages/neon/neon/lib/src/widgets/cached_api_image.dart +++ b/packages/neon/neon/lib/src/widgets/cached_api_image.dart @@ -2,8 +2,8 @@ part of '../../neon.dart'; typedef APIImageDownloader = Future Function(); -class CachedAPIImage extends CachedImage { - CachedAPIImage({ +class NeonCachedApiImage extends NeonCachedImage { + NeonCachedApiImage({ required final Account account, required final String cacheKey, required final APIImageDownloader download, diff --git a/packages/neon/neon/lib/src/widgets/cached_image.dart b/packages/neon/neon/lib/src/widgets/cached_image.dart index 7a8415ef..20f9f06c 100644 --- a/packages/neon/neon/lib/src/widgets/cached_image.dart +++ b/packages/neon/neon/lib/src/widgets/cached_image.dart @@ -2,8 +2,8 @@ part of '../../neon.dart'; final _cacheManager = DefaultCacheManager(); -abstract class CachedImage extends StatelessWidget { - const CachedImage({ +abstract class NeonCachedImage extends StatelessWidget { + const NeonCachedImage({ required this.future, this.isSvgHint = false, this.height, @@ -63,7 +63,7 @@ abstract class CachedImage extends StatelessWidget { } return SizedBox( width: width, - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( color: iconColor, ), ); diff --git a/packages/neon/neon/lib/src/widgets/cached_url_image.dart b/packages/neon/neon/lib/src/widgets/cached_url_image.dart index eb038ef6..e8efcdbd 100644 --- a/packages/neon/neon/lib/src/widgets/cached_url_image.dart +++ b/packages/neon/neon/lib/src/widgets/cached_url_image.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class CachedURLImage extends CachedImage { - CachedURLImage({ +class NeonCachedUrlImage extends NeonCachedImage { + NeonCachedUrlImage({ required final String url, super.height, super.width, diff --git a/packages/neon/neon/lib/src/widgets/custom_dialog.dart b/packages/neon/neon/lib/src/widgets/dialog.dart similarity index 84% rename from packages/neon/neon/lib/src/widgets/custom_dialog.dart rename to packages/neon/neon/lib/src/widgets/dialog.dart index c92a0583..33cb59ae 100644 --- a/packages/neon/neon/lib/src/widgets/custom_dialog.dart +++ b/packages/neon/neon/lib/src/widgets/dialog.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class CustomDialog extends StatelessWidget { - const CustomDialog({ +class NeonDialog extends StatelessWidget { + const NeonDialog({ this.title, this.children, super.key, diff --git a/packages/neon/neon/lib/src/widgets/exception.dart b/packages/neon/neon/lib/src/widgets/exception.dart index f7567f6a..84455b2c 100644 --- a/packages/neon/neon/lib/src/widgets/exception.dart +++ b/packages/neon/neon/lib/src/widgets/exception.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class ExceptionWidget extends StatelessWidget { - const ExceptionWidget( +class NeonException extends StatelessWidget { + const NeonException( this.exception, { required this.onRetry, this.onlyIcon = false, diff --git a/packages/neon/neon/lib/src/widgets/image_wrapper.dart b/packages/neon/neon/lib/src/widgets/image_wrapper.dart index 088d5b07..8edbee85 100644 --- a/packages/neon/neon/lib/src/widgets/image_wrapper.dart +++ b/packages/neon/neon/lib/src/widgets/image_wrapper.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class ImageWrapper extends StatelessWidget { - const ImageWrapper({ +class NeonImageWrapper extends StatelessWidget { + const NeonImageWrapper({ required this.child, required this.color, this.width, diff --git a/packages/neon/neon/lib/src/widgets/custom_linear_progress_indicator.dart b/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart similarity index 86% rename from packages/neon/neon/lib/src/widgets/custom_linear_progress_indicator.dart rename to packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart index ef293692..06075f42 100644 --- a/packages/neon/neon/lib/src/widgets/custom_linear_progress_indicator.dart +++ b/packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class CustomLinearProgressIndicator extends StatelessWidget { - const CustomLinearProgressIndicator({ +class NeonLinearProgressIndicator extends StatelessWidget { + const NeonLinearProgressIndicator({ this.visible = true, this.margin = const EdgeInsets.symmetric(horizontal: 10), this.color, diff --git a/packages/neon/neon/lib/src/widgets/custom_listview.dart b/packages/neon/neon/lib/src/widgets/list_view.dart similarity index 92% rename from packages/neon/neon/lib/src/widgets/custom_listview.dart rename to packages/neon/neon/lib/src/widgets/list_view.dart index b523e47e..842b7408 100644 --- a/packages/neon/neon/lib/src/widgets/custom_listview.dart +++ b/packages/neon/neon/lib/src/widgets/list_view.dart @@ -1,7 +1,7 @@ part of '../../neon.dart'; -class CustomListView extends StatelessWidget { - const CustomListView({ +class NeonListView extends StatelessWidget { + const NeonListView({ required this.items, required this.isLoading, required this.error, @@ -32,7 +32,7 @@ class CustomListView extends StatelessWidget { if (topFixedChildren != null) ...[ ...topFixedChildren!, ], - CustomLinearProgressIndicator( + NeonLinearProgressIndicator( margin: const EdgeInsets.symmetric( horizontal: 10, vertical: 5, @@ -48,7 +48,7 @@ class CustomListView extends StatelessWidget { if (topScrollingChildren != null) ...[ ...topScrollingChildren!, ], - ExceptionWidget( + NeonException( error, onRetry: onRefresh, ), diff --git a/packages/neon/neon/lib/src/widgets/no_animation_page_route.dart b/packages/neon/neon/lib/src/widgets/no_animation_page_route.dart deleted file mode 100644 index 74f2e55a..00000000 --- a/packages/neon/neon/lib/src/widgets/no_animation_page_route.dart +++ /dev/null @@ -1,11 +0,0 @@ -part of '../../neon.dart'; - -class NoAnimationPageRoute extends MaterialPageRoute { - NoAnimationPageRoute({ - required super.builder, - super.settings, - }); - - @override - Duration get transitionDuration => Duration.zero; -} diff --git a/packages/neon/neon/lib/src/widgets/text_settings_tile.dart b/packages/neon/neon/lib/src/widgets/text_settings_tile.dart index 7e696078..68efd525 100644 --- a/packages/neon/neon/lib/src/widgets/text_settings_tile.dart +++ b/packages/neon/neon/lib/src/widgets/text_settings_tile.dart @@ -3,8 +3,8 @@ part of '../../neon.dart'; -class TextSettingsTile extends SettingsTile { - const TextSettingsTile({ +class NeonTextSettingsTile extends SettingsTile { + const NeonTextSettingsTile({ required this.text, this.style, super.key, diff --git a/packages/neon/neon_files/lib/dialogs/choose_create.dart b/packages/neon/neon_files/lib/dialogs/choose_create.dart index 65e66564..2e7805f5 100644 --- a/packages/neon/neon_files/lib/dialogs/choose_create.dart +++ b/packages/neon/neon_files/lib/dialogs/choose_create.dart @@ -49,7 +49,7 @@ class _FilesChooseCreateDialogState extends State { } @override - Widget build(final BuildContext context) => CustomDialog( + Widget build(final BuildContext context) => NeonDialog( children: [ ListTile( leading: Icon( diff --git a/packages/neon/neon_files/lib/dialogs/create_folder.dart b/packages/neon/neon_files/lib/dialogs/create_folder.dart index 9a745488..d2169637 100644 --- a/packages/neon/neon_files/lib/dialogs/create_folder.dart +++ b/packages/neon/neon_files/lib/dialogs/create_folder.dart @@ -21,7 +21,7 @@ class _FilesCreateFolderDialogState extends State { } @override - Widget build(final BuildContext context) => CustomDialog( + Widget build(final BuildContext context) => NeonDialog( title: Text(AppLocalizations.of(context).filesCreateFolder), children: [ Form( diff --git a/packages/neon/neon_files/lib/pages/main.dart b/packages/neon/neon_files/lib/pages/main.dart index 272da94e..e3154542 100644 --- a/packages/neon/neon_files/lib/pages/main.dart +++ b/packages/neon/neon_files/lib/pages/main.dart @@ -18,7 +18,7 @@ class _FilesMainPageState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); } diff --git a/packages/neon/neon_files/lib/widgets/browser_view.dart b/packages/neon/neon_files/lib/widgets/browser_view.dart index e04acbd7..bcef6875 100644 --- a/packages/neon/neon_files/lib/widgets/browser_view.dart +++ b/packages/neon/neon_files/lib/widgets/browser_view.dart @@ -29,7 +29,7 @@ class _FilesBrowserViewState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); } @@ -62,7 +62,7 @@ class _FilesBrowserViewState extends State { child: const Icon(Icons.add), ) : null, - body: CustomListView( + body: NeonListView( scrollKey: 'files-${pathSnapshot.data!.join('/')}', withFloatingActionButton: true, items: [ diff --git a/packages/neon/neon_files/lib/widgets/file_preview.dart b/packages/neon/neon_files/lib/widgets/file_preview.dart index 9d8a3300..2a8d019c 100644 --- a/packages/neon/neon_files/lib/widgets/file_preview.dart +++ b/packages/neon/neon_files/lib/widgets/file_preview.dart @@ -34,7 +34,7 @@ class FilePreview extends StatelessWidget { builder: (final context, final showPreviewsSnapshot) { if ((showPreviewsSnapshot.data ?? false) && (details.hasPreview ?? false)) { final account = Provider.of(context, listen: false).activeAccount.value!; - final child = CachedAPIImage( + final child = NeonCachedApiImage( account: account, cacheKey: 'preview-${details.path.join('/')}-$width-$height', etag: details.etag, @@ -45,7 +45,7 @@ class FilePreview extends StatelessWidget { ), ); if (withBackground) { - return ImageWrapper( + return NeonImageWrapper( color: Colors.white, borderRadius: borderRadius, child: child, diff --git a/packages/neon/neon_news/lib/dialogs/add_feed.dart b/packages/neon/neon_news/lib/dialogs/add_feed.dart index a22a35a8..32aac9de 100644 --- a/packages/neon/neon_news/lib/dialogs/add_feed.dart +++ b/packages/neon/neon_news/lib/dialogs/add_feed.dart @@ -45,7 +45,7 @@ class _NewsAddFeedDialogState extends State { @override Widget build(final BuildContext context) => ResultBuilder>( stream: widget.bloc.folders, - builder: (final context, final folders) => CustomDialog( + builder: (final context, final folders) => NeonDialog( title: Text(AppLocalizations.of(context).newsAddFeed), children: [ Form( @@ -66,13 +66,13 @@ class _NewsAddFeedDialogState extends State { ), if (widget.folderID == null) ...[ Center( - child: ExceptionWidget( + child: NeonException( folders.error, onRetry: widget.bloc.refresh, ), ), Center( - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( visible: folders.loading, ), ), diff --git a/packages/neon/neon_news/lib/dialogs/create_folder.dart b/packages/neon/neon_news/lib/dialogs/create_folder.dart index d192453d..bd538c86 100644 --- a/packages/neon/neon_news/lib/dialogs/create_folder.dart +++ b/packages/neon/neon_news/lib/dialogs/create_folder.dart @@ -21,7 +21,7 @@ class _NewsCreateFolderDialogState extends State { } @override - Widget build(final BuildContext context) => CustomDialog( + Widget build(final BuildContext context) => NeonDialog( title: Text(AppLocalizations.of(context).newsCreateFolder), children: [ Form( diff --git a/packages/neon/neon_news/lib/dialogs/move_feed.dart b/packages/neon/neon_news/lib/dialogs/move_feed.dart index 3edc7db8..c484954c 100644 --- a/packages/neon/neon_news/lib/dialogs/move_feed.dart +++ b/packages/neon/neon_news/lib/dialogs/move_feed.dart @@ -26,7 +26,7 @@ class _NewsMoveFeedDialogState extends State { } @override - Widget build(final BuildContext context) => CustomDialog( + Widget build(final BuildContext context) => NeonDialog( title: Text(AppLocalizations.of(context).newsMoveFeed), children: [ Form( diff --git a/packages/neon/neon_news/lib/pages/article.dart b/packages/neon/neon_news/lib/pages/article.dart index f7d5a258..f3e55c72 100644 --- a/packages/neon/neon_news/lib/pages/article.dart +++ b/packages/neon/neon_news/lib/pages/article.dart @@ -30,7 +30,7 @@ class _NewsArticlePageState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); WidgetsBinding.instance.addPostFrameCallback((final _) async { diff --git a/packages/neon/neon_news/lib/pages/main.dart b/packages/neon/neon_news/lib/pages/main.dart index b6eea45b..71b77801 100644 --- a/packages/neon/neon_news/lib/pages/main.dart +++ b/packages/neon/neon_news/lib/pages/main.dart @@ -20,7 +20,7 @@ class _NewsMainPageState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); } diff --git a/packages/neon/neon_news/lib/widgets/articles_view.dart b/packages/neon/neon_news/lib/widgets/articles_view.dart index 0a8699d1..f4159573 100644 --- a/packages/neon/neon_news/lib/widgets/articles_view.dart +++ b/packages/neon/neon_news/lib/widgets/articles_view.dart @@ -20,7 +20,7 @@ class _NewsArticlesViewState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); } @@ -36,7 +36,7 @@ class _NewsArticlesViewState extends State { sortPropertyOption: widget.newsBloc.options.articlesSortPropertyOption, sortBoxOrderOption: widget.newsBloc.options.articlesSortBoxOrderOption, input: articles.data, - builder: (final context, final sorted) => CustomListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'news-articles', items: feeds.data == null ? null : sorted, isLoading: articles.loading || feeds.loading, @@ -119,7 +119,7 @@ class _NewsArticlesViewState extends State { ), ), if (article.mediaThumbnail != null) ...[ - CachedURLImage( + NeonCachedUrlImage( url: article.mediaThumbnail!, width: 100, height: 50, diff --git a/packages/neon/neon_news/lib/widgets/feed_icon.dart b/packages/neon/neon_news/lib/widgets/feed_icon.dart index c133048a..b576b3d1 100644 --- a/packages/neon/neon_news/lib/widgets/feed_icon.dart +++ b/packages/neon/neon_news/lib/widgets/feed_icon.dart @@ -13,13 +13,13 @@ class NewsFeedIcon extends StatelessWidget { final BorderRadius? borderRadius; @override - Widget build(final BuildContext context) => ImageWrapper( + Widget build(final BuildContext context) => NeonImageWrapper( color: Colors.white, width: size, height: size, borderRadius: borderRadius, child: feed.faviconLink != null && feed.faviconLink != '' - ? CachedURLImage( + ? NeonCachedUrlImage( url: feed.faviconLink!, height: size, width: size, diff --git a/packages/neon/neon_news/lib/widgets/feeds_view.dart b/packages/neon/neon_news/lib/widgets/feeds_view.dart index 57fa5372..20b1351c 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -39,7 +39,7 @@ class NewsFeedsView extends StatelessWidget { input: folders.data == null ? null : feeds.data?.where((final f) => folderID == null || f.folderId == folderID).toList(), - builder: (final context, final sorted) => CustomListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'news-feeds', withFloatingActionButton: true, items: sorted, diff --git a/packages/neon/neon_news/lib/widgets/folders_view.dart b/packages/neon/neon_news/lib/widgets/folders_view.dart index a19ff77c..eca3c8e9 100644 --- a/packages/neon/neon_news/lib/widgets/folders_view.dart +++ b/packages/neon/neon_news/lib/widgets/folders_view.dart @@ -41,7 +41,7 @@ class NewsFoldersView extends StatelessWidget { ), ) .toList(), - builder: (final context, final sorted) => CustomListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'news-folders', withFloatingActionButton: true, items: sorted, diff --git a/packages/neon/neon_notes/lib/dialogs/create_note.dart b/packages/neon/neon_notes/lib/dialogs/create_note.dart index 71b3bc73..1c1d853a 100644 --- a/packages/neon/neon_notes/lib/dialogs/create_note.dart +++ b/packages/neon/neon_notes/lib/dialogs/create_note.dart @@ -28,7 +28,7 @@ class _NotesCreateNoteDialogState extends State { @override Widget build(final BuildContext context) => ResultBuilder>( stream: widget.bloc.notes, - builder: (final context, final notes) => CustomDialog( + builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).notesCreateNote), children: [ Form( @@ -49,13 +49,13 @@ class _NotesCreateNoteDialogState extends State { ), if (widget.category == null) ...[ Center( - child: ExceptionWidget( + child: NeonException( notes.error, onRetry: widget.bloc.refresh, ), ), Center( - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( visible: notes.loading, ), ), diff --git a/packages/neon/neon_notes/lib/dialogs/select_category.dart b/packages/neon/neon_notes/lib/dialogs/select_category.dart index 0bd56e13..d482bee3 100644 --- a/packages/neon/neon_notes/lib/dialogs/select_category.dart +++ b/packages/neon/neon_notes/lib/dialogs/select_category.dart @@ -28,7 +28,7 @@ class _NotesSelectCategoryDialogState extends State { @override Widget build(final BuildContext context) => ResultBuilder>( stream: widget.bloc.notes, - builder: (final context, final notes) => CustomDialog( + builder: (final context, final notes) => NeonDialog( title: Text(AppLocalizations.of(context).notesChangeCategory), children: [ Form( @@ -37,13 +37,13 @@ class _NotesSelectCategoryDialogState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Center( - child: ExceptionWidget( + child: NeonException( notes.error, onRetry: widget.bloc.refresh, ), ), Center( - child: CustomLinearProgressIndicator( + child: NeonLinearProgressIndicator( visible: notes.loading, ), ), diff --git a/packages/neon/neon_notes/lib/utils/exception_handler.dart b/packages/neon/neon_notes/lib/utils/exception_handler.dart index 22cb98c3..878d5dd3 100644 --- a/packages/neon/neon_notes/lib/utils/exception_handler.dart +++ b/packages/neon/neon_notes/lib/utils/exception_handler.dart @@ -2,8 +2,8 @@ part of '../neon_notes.dart'; void handleNotesException(final BuildContext context, final Object error) { if (error is NextcloudApiException && error.statusCode == 412) { - ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).notesNoteChangedOnServer); + NeonException.showSnackbar(context, AppLocalizations.of(context).notesNoteChangedOnServer); } else { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); } } diff --git a/packages/neon/neon_notes/lib/widgets/categories_view.dart b/packages/neon/neon_notes/lib/widgets/categories_view.dart index 62076b8c..38a267d8 100644 --- a/packages/neon/neon_notes/lib/widgets/categories_view.dart +++ b/packages/neon/neon_notes/lib/widgets/categories_view.dart @@ -25,7 +25,7 @@ class NotesCategoriesView extends StatelessWidget { ), ) .toList(), - builder: (final context, final sorted) => CustomListView( + builder: (final context, final sorted) => NeonListView( scrollKey: 'notes-categories', items: sorted, isLoading: notes.loading, diff --git a/packages/neon/neon_notes/lib/widgets/notes_view.dart b/packages/neon/neon_notes/lib/widgets/notes_view.dart index 8ad43126..7cb4fc2d 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_view.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_view.dart @@ -47,7 +47,7 @@ class NotesView extends StatelessWidget { input: category != null ? notes.data?.where((final note) => !note.favorite && note.category == category).toList() : notes.data?.where((final note) => !note.favorite).toList(), - builder: (final context, final sortedNonFavorites) => CustomListView( + builder: (final context, final sortedNonFavorites) => NeonListView( scrollKey: 'notes-notes', withFloatingActionButton: true, items: [ diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 79fc5520..21ffc71e 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -18,7 +18,7 @@ class _NotificationsMainPageState extends State { super.initState(); widget.bloc.errors.listen((final error) { - ExceptionWidget.showSnackbar(context, error); + NeonException.showSnackbar(context, error); }); } @@ -34,7 +34,7 @@ class _NotificationsMainPageState extends State { }, child: const Icon(MdiIcons.checkAll), ), - body: CustomListView( + body: NeonListView( scrollKey: 'notifications-notifications', withFloatingActionButton: true, items: notifications.data, @@ -82,7 +82,7 @@ class _NotificationsMainPageState extends State { : SizedBox( width: 40, height: 40, - child: CachedURLImage( + child: NeonCachedUrlImage( url: notification.icon, width: 40, height: 40,