Browse Source

neon: Prefix all widget names

pull/240/head
jld3103 2 years ago
parent
commit
e902b05703
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 7
      packages/neon/neon/lib/neon.dart
  2. 12
      packages/neon/neon/lib/src/app.dart
  3. 4
      packages/neon/neon/lib/src/pages/account_settings.dart
  4. 28
      packages/neon/neon/lib/src/pages/home.dart
  5. 10
      packages/neon/neon/lib/src/pages/login.dart
  6. 10
      packages/neon/neon/lib/src/pages/settings.dart
  7. 2
      packages/neon/neon/lib/src/utils/rename_dialog.dart
  8. 6
      packages/neon/neon/lib/src/widgets/account_avatar.dart
  9. 6
      packages/neon/neon/lib/src/widgets/account_settings_tile.dart
  10. 10
      packages/neon/neon/lib/src/widgets/account_tile.dart
  11. 4
      packages/neon/neon/lib/src/widgets/app_implementation_icon.dart
  12. 4
      packages/neon/neon/lib/src/widgets/cached_api_image.dart
  13. 6
      packages/neon/neon/lib/src/widgets/cached_image.dart
  14. 4
      packages/neon/neon/lib/src/widgets/cached_url_image.dart
  15. 4
      packages/neon/neon/lib/src/widgets/dialog.dart
  16. 4
      packages/neon/neon/lib/src/widgets/exception.dart
  17. 4
      packages/neon/neon/lib/src/widgets/image_wrapper.dart
  18. 4
      packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart
  19. 8
      packages/neon/neon/lib/src/widgets/list_view.dart
  20. 11
      packages/neon/neon/lib/src/widgets/no_animation_page_route.dart
  21. 4
      packages/neon/neon/lib/src/widgets/text_settings_tile.dart
  22. 2
      packages/neon/neon_files/lib/dialogs/choose_create.dart
  23. 2
      packages/neon/neon_files/lib/dialogs/create_folder.dart
  24. 2
      packages/neon/neon_files/lib/pages/main.dart
  25. 4
      packages/neon/neon_files/lib/widgets/browser_view.dart
  26. 4
      packages/neon/neon_files/lib/widgets/file_preview.dart
  27. 6
      packages/neon/neon_news/lib/dialogs/add_feed.dart
  28. 2
      packages/neon/neon_news/lib/dialogs/create_folder.dart
  29. 2
      packages/neon/neon_news/lib/dialogs/move_feed.dart
  30. 2
      packages/neon/neon_news/lib/pages/article.dart
  31. 2
      packages/neon/neon_news/lib/pages/main.dart
  32. 6
      packages/neon/neon_news/lib/widgets/articles_view.dart
  33. 4
      packages/neon/neon_news/lib/widgets/feed_icon.dart
  34. 2
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  35. 2
      packages/neon/neon_news/lib/widgets/folders_view.dart
  36. 6
      packages/neon/neon_notes/lib/dialogs/create_note.dart
  37. 6
      packages/neon/neon_notes/lib/dialogs/select_category.dart
  38. 4
      packages/neon/neon_notes/lib/utils/exception_handler.dart
  39. 2
      packages/neon/neon_notes/lib/widgets/categories_view.dart
  40. 2
      packages/neon/neon_notes/lib/widgets/notes_view.dart
  41. 6
      packages/neon/neon_notifications/lib/pages/main.dart

7
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_api_image.dart';
part 'src/widgets/cached_image.dart'; part 'src/widgets/cached_image.dart';
part 'src/widgets/cached_url_image.dart'; part 'src/widgets/cached_url_image.dart';
part 'src/widgets/custom_dialog.dart'; part 'src/widgets/dialog.dart';
part 'src/widgets/custom_linear_progress_indicator.dart';
part 'src/widgets/custom_listview.dart';
part 'src/widgets/exception.dart'; part 'src/widgets/exception.dart';
part 'src/widgets/image_wrapper.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/neon_logo.dart';
part 'src/widgets/nextcloud_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/relative_time.dart';
part 'src/widgets/result_builder.dart'; part 'src/widgets/result_builder.dart';
part 'src/widgets/text_settings_tile.dart'; part 'src/widgets/text_settings_tile.dart';

12
packages/neon/neon/lib/src/app.dart

@ -91,7 +91,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
settings: settings, settings: settings,
builder: builder, builder: builder,
) )
: NoAnimationPageRoute( : _NoAnimationPageRoute(
settings: settings, settings: settings,
builder: builder, builder: builder,
), ),
@ -330,3 +330,13 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
), ),
); );
} }
class _NoAnimationPageRoute extends MaterialPageRoute {
_NoAnimationPageRoute({
required super.builder,
super.settings,
});
@override
Duration get transitionDuration => Duration.zero;
}

4
packages/neon/neon/lib/src/pages/account_settings.dart

@ -77,11 +77,11 @@ class AccountSettingsPage extends StatelessWidget {
), ),
), ),
], ],
ExceptionWidget( NeonException(
userDetails.error, userDetails.error,
onRetry: _userDetailsBloc.refresh, onRetry: _userDetailsBloc.refresh,
), ),
CustomLinearProgressIndicator( NeonLinearProgressIndicator(
visible: userDetails.loading, visible: userDetails.loading,
), ),
], ],

28
packages/neon/neon/lib/src/pages/home.dart

@ -113,7 +113,7 @@ class _HomePageState extends State<HomePage> {
} catch (e, s) { } catch (e, s) {
debugPrint(e.toString()); debugPrint(e.toString());
debugPrint(s.toString()); debugPrint(s.toString());
ExceptionWidget.showSnackbar(context, e); NeonException.showSnackbar(context, e);
} }
} }
@ -250,7 +250,7 @@ class _HomePageState extends State<HomePage> {
_accountsBloc.setActiveAccount(account); _accountsBloc.setActiveAccount(account);
}, },
icon: IntrinsicHeight( icon: IntrinsicHeight(
child: AccountAvatar( child: NeonAccountAvatar(
account: account, account: account,
), ),
), ),
@ -290,17 +290,17 @@ class _HomePageState extends State<HomePage> {
], ],
if (capabilities.data!.capabilities.theming?.logo != null) ...[ if (capabilities.data!.capabilities.theming?.logo != null) ...[
Flexible( Flexible(
child: CachedURLImage( child: NeonCachedUrlImage(
url: capabilities.data!.capabilities.theming!.logo!, url: capabilities.data!.capabilities.theming!.logo!,
), ),
), ),
], ],
] else ...[ ] else ...[
ExceptionWidget( NeonException(
capabilities.error, capabilities.error,
onRetry: _capabilitiesBloc.refresh, onRetry: _capabilitiesBloc.refresh,
), ),
CustomLinearProgressIndicator( NeonLinearProgressIndicator(
visible: capabilities.loading, visible: capabilities.loading,
), ),
], ],
@ -316,7 +316,7 @@ class _HomePageState extends State<HomePage> {
.map<DropdownMenuItem<String>>( .map<DropdownMenuItem<String>>(
(final account) => DropdownMenuItem<String>( (final account) => DropdownMenuItem<String>(
value: account.id, value: account.id,
child: AccountTile( child: NeonAccountTile(
account: account, account: account,
dense: true, dense: true,
textColor: textColor:
@ -343,12 +343,12 @@ class _HomePageState extends State<HomePage> {
return Container(); return Container();
}, },
), ),
ExceptionWidget( NeonException(
appImplementations.error, appImplementations.error,
onlyIcon: isQuickBar, onlyIcon: isQuickBar,
onRetry: _appsBloc.refresh, onRetry: _appsBloc.refresh,
), ),
CustomLinearProgressIndicator( NeonLinearProgressIndicator(
visible: appImplementations.loading, visible: appImplementations.loading,
), ),
if (appImplementations.data != null) ...[ if (appImplementations.data != null) ...[
@ -365,7 +365,7 @@ class _HomePageState extends State<HomePage> {
onPressed: () async { onPressed: () async {
await _appsBloc.setActiveApp(appImplementation.id); await _appsBloc.setActiveApp(appImplementation.id);
}, },
icon: AppImplementationIcon( icon: NeonAppImplementationIcon(
appImplementation: appImplementation, appImplementation: appImplementation,
unreadCount: unreadCount, unreadCount: unreadCount,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
@ -459,7 +459,7 @@ class _HomePageState extends State<HomePage> {
? Container( ? Container(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(5),
child: capabilities.data?.capabilities.theming?.logo != null child: capabilities.data?.capabilities.theming?.logo != null
? CachedURLImage( ? NeonCachedUrlImage(
url: capabilities.data!.capabilities.theming!.logo!, url: capabilities.data!.capabilities.theming!.logo!,
) )
: null, : null,
@ -494,7 +494,7 @@ class _HomePageState extends State<HomePage> {
width: 8, width: 8,
), ),
Expanded( Expanded(
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
color: Theme.of(context).appBarTheme.foregroundColor, color: Theme.of(context).appBarTheme.foregroundColor,
), ),
), ),
@ -517,7 +517,7 @@ class _HomePageState extends State<HomePage> {
final unreadCount = unreadCounterSnapshot.data ?? 0; final unreadCount = unreadCounterSnapshot.data ?? 0;
return IconButton( return IconButton(
key: Key('app-${notificationsAppImplementation.data!.id}'), key: Key('app-${notificationsAppImplementation.data!.id}'),
icon: AppImplementationIcon( icon: NeonAppImplementationIcon(
appImplementation: notificationsAppImplementation.data!, appImplementation: notificationsAppImplementation.data!,
unreadCount: unreadCount, unreadCount: unreadCount,
color: unreadCount > 0 color: unreadCount > 0
@ -539,7 +539,7 @@ class _HomePageState extends State<HomePage> {
], ],
IconButton( IconButton(
icon: IntrinsicWidth( icon: IntrinsicWidth(
child: AccountAvatar( child: NeonAccountAvatar(
account: account, account: account,
), ),
), ),
@ -564,7 +564,7 @@ class _HomePageState extends State<HomePage> {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
ExceptionWidget( NeonException(
appImplementations.error, appImplementations.error,
onRetry: _appsBloc.refresh, onRetry: _appsBloc.refresh,
), ),

10
packages/neon/neon/lib/src/pages/login.dart

@ -63,7 +63,7 @@ class _LoginPageState extends State<LoginPage> {
} else { } else {
for (final a in _accountsBloc.accounts.value) { for (final a in _accountsBloc.accounts.value) {
if (a.id == account.id) { if (a.id == account.id) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists); NeonException.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists);
await _loginBloc.refresh(); await _loginBloc.refresh();
return; return;
} }
@ -75,7 +75,7 @@ class _LoginPageState extends State<LoginPage> {
} catch (e, s) { } catch (e, s) {
debugPrint(e.toString()); debugPrint(e.toString());
debugPrint(s.toString()); debugPrint(s.toString());
ExceptionWidget.showSnackbar(context, e); NeonException.showSnackbar(context, e);
await _loginBloc.refresh(); await _loginBloc.refresh();
} }
} }
@ -212,17 +212,17 @@ class _LoginPageState extends State<LoginPage> {
), ),
Column( Column(
children: [ children: [
CustomLinearProgressIndicator( NeonLinearProgressIndicator(
visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading, visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading,
), ),
if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[ if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[
ExceptionWidget( NeonException(
AppLocalizations.of(context).errorUnableToReachServer, AppLocalizations.of(context).errorUnableToReachServer,
onRetry: _loginBloc.refresh, onRetry: _loginBloc.refresh,
), ),
], ],
if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[ if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[
ExceptionWidget( NeonException(
AppLocalizations.of(context).errorServerInMaintenanceMode, AppLocalizations.of(context).errorServerInMaintenanceMode,
onRetry: _loginBloc.refresh, onRetry: _loginBloc.refresh,
), ),

10
packages/neon/neon/lib/src/pages/settings.dart

@ -121,7 +121,7 @@ class _SettingsPageState extends State<SettingsPage> {
tiles: [ tiles: [
if (pushNotificationsEnabledEnabledSnapshot.data != null && if (pushNotificationsEnabledEnabledSnapshot.data != null &&
!pushNotificationsEnabledEnabledSnapshot.data!) ...[ !pushNotificationsEnabledEnabledSnapshot.data!) ...[
TextSettingsTile( NeonTextSettingsTile(
text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice, text: AppLocalizations.of(context).globalOptionsPushNotificationsEnabledDisabledNotice,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -178,7 +178,7 @@ class _SettingsPageState extends State<SettingsPage> {
), ),
], ],
for (final account in accountsSnapshot.data!) ...[ for (final account in accountsSnapshot.data!) ...[
AccountSettingsTile( NeonAccountSettingsTile(
account: account, account: account,
onTap: () async { onTap: () async {
await Navigator.of(context).push( await Navigator.of(context).push(
@ -250,7 +250,7 @@ class _SettingsPageState extends State<SettingsPage> {
} catch (e, s) { } catch (e, s) {
debugPrint(e.toString()); debugPrint(e.toString());
debugPrint(s.toString()); debugPrint(s.toString());
ExceptionWidget.showSnackbar(context, e); NeonException.showSnackbar(context, e);
} }
}, },
), ),
@ -272,7 +272,7 @@ class _SettingsPageState extends State<SettingsPage> {
if (!result.files.single.path!.endsWith('.json.base64')) { if (!result.files.single.path!.endsWith('.json.base64')) {
if (mounted) { if (mounted) {
ExceptionWidget.showSnackbar( NeonException.showSnackbar(
context, context,
AppLocalizations.of(context).settingsImportWrongFileExtension, AppLocalizations.of(context).settingsImportWrongFileExtension,
); );
@ -286,7 +286,7 @@ class _SettingsPageState extends State<SettingsPage> {
} catch (e, s) { } catch (e, s) {
debugPrint(e.toString()); debugPrint(e.toString());
debugPrint(s.toString()); debugPrint(s.toString());
ExceptionWidget.showSnackbar(context, e); NeonException.showSnackbar(context, e);
} }
}, },
), ),

2
packages/neon/neon/lib/src/utils/rename_dialog.dart

@ -41,7 +41,7 @@ class _RenameDialogState extends State<_RenameDialog> {
} }
@override @override
Widget build(final BuildContext context) => CustomDialog( Widget build(final BuildContext context) => NeonDialog(
title: Text(widget.title), title: Text(widget.title),
children: [ children: [
Form( Form(

6
packages/neon/neon/lib/src/widgets/account_avatar.dart

@ -2,8 +2,8 @@ part of '../../neon.dart';
const kAvatarSize = 40.0; const kAvatarSize = 40.0;
class AccountAvatar extends StatelessWidget { class NeonAccountAvatar extends StatelessWidget {
const AccountAvatar({ const NeonAccountAvatar({
required this.account, required this.account,
super.key, super.key,
}); });
@ -20,7 +20,7 @@ class AccountAvatar extends StatelessWidget {
CircleAvatar( CircleAvatar(
radius: kAvatarSize / 2, radius: kAvatarSize / 2,
child: ClipOval( child: ClipOval(
child: CachedAPIImage( child: NeonCachedApiImage(
account: account, account: account,
cacheKey: 'avatar-${account.id}-${isDark ? 'dark' : 'light'}$size', cacheKey: 'avatar-${account.id}-${isDark ? 'dark' : 'light'}$size',
download: () async { download: () async {

6
packages/neon/neon/lib/src/widgets/account_settings_tile.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class AccountSettingsTile extends SettingsTile { class NeonAccountSettingsTile extends SettingsTile {
const AccountSettingsTile({ const NeonAccountSettingsTile({
required this.account, required this.account,
this.color, this.color,
this.trailing, this.trailing,
@ -15,7 +15,7 @@ class AccountSettingsTile extends SettingsTile {
final VoidCallback? onTap; final VoidCallback? onTap;
@override @override
Widget build(final BuildContext context) => AccountTile( Widget build(final BuildContext context) => NeonAccountTile(
account: account, account: account,
color: color, color: color,
trailing: trailing, trailing: trailing,

10
packages/neon/neon/lib/src/widgets/account_tile.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class AccountTile extends StatelessWidget { class NeonAccountTile extends StatelessWidget {
const AccountTile({ const NeonAccountTile({
required this.account, required this.account,
this.color, this.color,
this.trailing, this.trailing,
@ -34,7 +34,7 @@ class AccountTile extends StatelessWidget {
) )
: null, : null,
leading: IntrinsicWidth( leading: IntrinsicWidth(
child: AccountAvatar( child: NeonAccountAvatar(
account: account, account: account,
), ),
), ),
@ -58,7 +58,7 @@ class AccountTile extends StatelessWidget {
width: 5, width: 5,
), ),
Expanded( Expanded(
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
color: textColor, color: textColor,
), ),
), ),
@ -67,7 +67,7 @@ class AccountTile extends StatelessWidget {
const SizedBox( const SizedBox(
width: 5, width: 5,
), ),
ExceptionWidget( NeonException(
userDetails.error, userDetails.error,
onlyIcon: true, onlyIcon: true,
iconSize: 24, iconSize: 24,

4
packages/neon/neon/lib/src/widgets/app_implementation_icon.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class AppImplementationIcon extends StatelessWidget { class NeonAppImplementationIcon extends StatelessWidget {
const AppImplementationIcon({ const NeonAppImplementationIcon({
required this.appImplementation, required this.appImplementation,
this.unreadCount = 0, this.unreadCount = 0,
this.color, this.color,

4
packages/neon/neon/lib/src/widgets/cached_api_image.dart

@ -2,8 +2,8 @@ part of '../../neon.dart';
typedef APIImageDownloader = Future<Uint8List> Function(); typedef APIImageDownloader = Future<Uint8List> Function();
class CachedAPIImage extends CachedImage { class NeonCachedApiImage extends NeonCachedImage {
CachedAPIImage({ NeonCachedApiImage({
required final Account account, required final Account account,
required final String cacheKey, required final String cacheKey,
required final APIImageDownloader download, required final APIImageDownloader download,

6
packages/neon/neon/lib/src/widgets/cached_image.dart

@ -2,8 +2,8 @@ part of '../../neon.dart';
final _cacheManager = DefaultCacheManager(); final _cacheManager = DefaultCacheManager();
abstract class CachedImage extends StatelessWidget { abstract class NeonCachedImage extends StatelessWidget {
const CachedImage({ const NeonCachedImage({
required this.future, required this.future,
this.isSvgHint = false, this.isSvgHint = false,
this.height, this.height,
@ -63,7 +63,7 @@ abstract class CachedImage extends StatelessWidget {
} }
return SizedBox( return SizedBox(
width: width, width: width,
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
color: iconColor, color: iconColor,
), ),
); );

4
packages/neon/neon/lib/src/widgets/cached_url_image.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class CachedURLImage extends CachedImage { class NeonCachedUrlImage extends NeonCachedImage {
CachedURLImage({ NeonCachedUrlImage({
required final String url, required final String url,
super.height, super.height,
super.width, super.width,

4
packages/neon/neon/lib/src/widgets/custom_dialog.dart → packages/neon/neon/lib/src/widgets/dialog.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class CustomDialog extends StatelessWidget { class NeonDialog extends StatelessWidget {
const CustomDialog({ const NeonDialog({
this.title, this.title,
this.children, this.children,
super.key, super.key,

4
packages/neon/neon/lib/src/widgets/exception.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class ExceptionWidget extends StatelessWidget { class NeonException extends StatelessWidget {
const ExceptionWidget( const NeonException(
this.exception, { this.exception, {
required this.onRetry, required this.onRetry,
this.onlyIcon = false, this.onlyIcon = false,

4
packages/neon/neon/lib/src/widgets/image_wrapper.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class ImageWrapper extends StatelessWidget { class NeonImageWrapper extends StatelessWidget {
const ImageWrapper({ const NeonImageWrapper({
required this.child, required this.child,
required this.color, required this.color,
this.width, this.width,

4
packages/neon/neon/lib/src/widgets/custom_linear_progress_indicator.dart → packages/neon/neon/lib/src/widgets/linear_progress_indicator.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class CustomLinearProgressIndicator extends StatelessWidget { class NeonLinearProgressIndicator extends StatelessWidget {
const CustomLinearProgressIndicator({ const NeonLinearProgressIndicator({
this.visible = true, this.visible = true,
this.margin = const EdgeInsets.symmetric(horizontal: 10), this.margin = const EdgeInsets.symmetric(horizontal: 10),
this.color, this.color,

8
packages/neon/neon/lib/src/widgets/custom_listview.dart → packages/neon/neon/lib/src/widgets/list_view.dart

@ -1,7 +1,7 @@
part of '../../neon.dart'; part of '../../neon.dart';
class CustomListView<T> extends StatelessWidget { class NeonListView<T> extends StatelessWidget {
const CustomListView({ const NeonListView({
required this.items, required this.items,
required this.isLoading, required this.isLoading,
required this.error, required this.error,
@ -32,7 +32,7 @@ class CustomListView<T> extends StatelessWidget {
if (topFixedChildren != null) ...[ if (topFixedChildren != null) ...[
...topFixedChildren!, ...topFixedChildren!,
], ],
CustomLinearProgressIndicator( NeonLinearProgressIndicator(
margin: const EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 5, vertical: 5,
@ -48,7 +48,7 @@ class CustomListView<T> extends StatelessWidget {
if (topScrollingChildren != null) ...[ if (topScrollingChildren != null) ...[
...topScrollingChildren!, ...topScrollingChildren!,
], ],
ExceptionWidget( NeonException(
error, error,
onRetry: onRefresh, onRetry: onRefresh,
), ),

11
packages/neon/neon/lib/src/widgets/no_animation_page_route.dart

@ -1,11 +0,0 @@
part of '../../neon.dart';
class NoAnimationPageRoute extends MaterialPageRoute {
NoAnimationPageRoute({
required super.builder,
super.settings,
});
@override
Duration get transitionDuration => Duration.zero;
}

4
packages/neon/neon/lib/src/widgets/text_settings_tile.dart

@ -3,8 +3,8 @@
part of '../../neon.dart'; part of '../../neon.dart';
class TextSettingsTile extends SettingsTile { class NeonTextSettingsTile extends SettingsTile {
const TextSettingsTile({ const NeonTextSettingsTile({
required this.text, required this.text,
this.style, this.style,
super.key, super.key,

2
packages/neon/neon_files/lib/dialogs/choose_create.dart

@ -49,7 +49,7 @@ class _FilesChooseCreateDialogState extends State<FilesChooseCreateDialog> {
} }
@override @override
Widget build(final BuildContext context) => CustomDialog( Widget build(final BuildContext context) => NeonDialog(
children: [ children: [
ListTile( ListTile(
leading: Icon( leading: Icon(

2
packages/neon/neon_files/lib/dialogs/create_folder.dart

@ -21,7 +21,7 @@ class _FilesCreateFolderDialogState extends State<FilesCreateFolderDialog> {
} }
@override @override
Widget build(final BuildContext context) => CustomDialog( Widget build(final BuildContext context) => NeonDialog(
title: Text(AppLocalizations.of(context).filesCreateFolder), title: Text(AppLocalizations.of(context).filesCreateFolder),
children: [ children: [
Form( Form(

2
packages/neon/neon_files/lib/pages/main.dart

@ -18,7 +18,7 @@ class _FilesMainPageState extends State<FilesMainPage> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
} }

4
packages/neon/neon_files/lib/widgets/browser_view.dart

@ -29,7 +29,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
} }
@ -62,7 +62,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
child: const Icon(Icons.add), child: const Icon(Icons.add),
) )
: null, : null,
body: CustomListView<Widget>( body: NeonListView<Widget>(
scrollKey: 'files-${pathSnapshot.data!.join('/')}', scrollKey: 'files-${pathSnapshot.data!.join('/')}',
withFloatingActionButton: true, withFloatingActionButton: true,
items: [ items: [

4
packages/neon/neon_files/lib/widgets/file_preview.dart

@ -34,7 +34,7 @@ class FilePreview extends StatelessWidget {
builder: (final context, final showPreviewsSnapshot) { builder: (final context, final showPreviewsSnapshot) {
if ((showPreviewsSnapshot.data ?? false) && (details.hasPreview ?? false)) { if ((showPreviewsSnapshot.data ?? false) && (details.hasPreview ?? false)) {
final account = Provider.of<AccountsBloc>(context, listen: false).activeAccount.value!; final account = Provider.of<AccountsBloc>(context, listen: false).activeAccount.value!;
final child = CachedAPIImage( final child = NeonCachedApiImage(
account: account, account: account,
cacheKey: 'preview-${details.path.join('/')}-$width-$height', cacheKey: 'preview-${details.path.join('/')}-$width-$height',
etag: details.etag, etag: details.etag,
@ -45,7 +45,7 @@ class FilePreview extends StatelessWidget {
), ),
); );
if (withBackground) { if (withBackground) {
return ImageWrapper( return NeonImageWrapper(
color: Colors.white, color: Colors.white,
borderRadius: borderRadius, borderRadius: borderRadius,
child: child, child: child,

6
packages/neon/neon_news/lib/dialogs/add_feed.dart

@ -45,7 +45,7 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
@override @override
Widget build(final BuildContext context) => ResultBuilder<NewsBloc, List<NextcloudNewsFolder>>( Widget build(final BuildContext context) => ResultBuilder<NewsBloc, List<NextcloudNewsFolder>>(
stream: widget.bloc.folders, stream: widget.bloc.folders,
builder: (final context, final folders) => CustomDialog( builder: (final context, final folders) => NeonDialog(
title: Text(AppLocalizations.of(context).newsAddFeed), title: Text(AppLocalizations.of(context).newsAddFeed),
children: [ children: [
Form( Form(
@ -66,13 +66,13 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
), ),
if (widget.folderID == null) ...[ if (widget.folderID == null) ...[
Center( Center(
child: ExceptionWidget( child: NeonException(
folders.error, folders.error,
onRetry: widget.bloc.refresh, onRetry: widget.bloc.refresh,
), ),
), ),
Center( Center(
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
visible: folders.loading, visible: folders.loading,
), ),
), ),

2
packages/neon/neon_news/lib/dialogs/create_folder.dart

@ -21,7 +21,7 @@ class _NewsCreateFolderDialogState extends State<NewsCreateFolderDialog> {
} }
@override @override
Widget build(final BuildContext context) => CustomDialog( Widget build(final BuildContext context) => NeonDialog(
title: Text(AppLocalizations.of(context).newsCreateFolder), title: Text(AppLocalizations.of(context).newsCreateFolder),
children: [ children: [
Form( Form(

2
packages/neon/neon_news/lib/dialogs/move_feed.dart

@ -26,7 +26,7 @@ class _NewsMoveFeedDialogState extends State<NewsMoveFeedDialog> {
} }
@override @override
Widget build(final BuildContext context) => CustomDialog( Widget build(final BuildContext context) => NeonDialog(
title: Text(AppLocalizations.of(context).newsMoveFeed), title: Text(AppLocalizations.of(context).newsMoveFeed),
children: [ children: [
Form( Form(

2
packages/neon/neon_news/lib/pages/article.dart

@ -30,7 +30,7 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
WidgetsBinding.instance.addPostFrameCallback((final _) async { WidgetsBinding.instance.addPostFrameCallback((final _) async {

2
packages/neon/neon_news/lib/pages/main.dart

@ -20,7 +20,7 @@ class _NewsMainPageState extends State<NewsMainPage> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
} }

6
packages/neon/neon_news/lib/widgets/articles_view.dart

@ -20,7 +20,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
} }
@ -36,7 +36,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
sortPropertyOption: widget.newsBloc.options.articlesSortPropertyOption, sortPropertyOption: widget.newsBloc.options.articlesSortPropertyOption,
sortBoxOrderOption: widget.newsBloc.options.articlesSortBoxOrderOption, sortBoxOrderOption: widget.newsBloc.options.articlesSortBoxOrderOption,
input: articles.data, input: articles.data,
builder: (final context, final sorted) => CustomListView<NextcloudNewsArticle>( builder: (final context, final sorted) => NeonListView<NextcloudNewsArticle>(
scrollKey: 'news-articles', scrollKey: 'news-articles',
items: feeds.data == null ? null : sorted, items: feeds.data == null ? null : sorted,
isLoading: articles.loading || feeds.loading, isLoading: articles.loading || feeds.loading,
@ -119,7 +119,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
), ),
), ),
if (article.mediaThumbnail != null) ...[ if (article.mediaThumbnail != null) ...[
CachedURLImage( NeonCachedUrlImage(
url: article.mediaThumbnail!, url: article.mediaThumbnail!,
width: 100, width: 100,
height: 50, height: 50,

4
packages/neon/neon_news/lib/widgets/feed_icon.dart

@ -13,13 +13,13 @@ class NewsFeedIcon extends StatelessWidget {
final BorderRadius? borderRadius; final BorderRadius? borderRadius;
@override @override
Widget build(final BuildContext context) => ImageWrapper( Widget build(final BuildContext context) => NeonImageWrapper(
color: Colors.white, color: Colors.white,
width: size, width: size,
height: size, height: size,
borderRadius: borderRadius, borderRadius: borderRadius,
child: feed.faviconLink != null && feed.faviconLink != '' child: feed.faviconLink != null && feed.faviconLink != ''
? CachedURLImage( ? NeonCachedUrlImage(
url: feed.faviconLink!, url: feed.faviconLink!,
height: size, height: size,
width: size, width: size,

2
packages/neon/neon_news/lib/widgets/feeds_view.dart

@ -39,7 +39,7 @@ class NewsFeedsView extends StatelessWidget {
input: folders.data == null input: folders.data == null
? null ? null
: feeds.data?.where((final f) => folderID == null || f.folderId == folderID).toList(), : feeds.data?.where((final f) => folderID == null || f.folderId == folderID).toList(),
builder: (final context, final sorted) => CustomListView<NextcloudNewsFeed>( builder: (final context, final sorted) => NeonListView<NextcloudNewsFeed>(
scrollKey: 'news-feeds', scrollKey: 'news-feeds',
withFloatingActionButton: true, withFloatingActionButton: true,
items: sorted, items: sorted,

2
packages/neon/neon_news/lib/widgets/folders_view.dart

@ -41,7 +41,7 @@ class NewsFoldersView extends StatelessWidget {
), ),
) )
.toList(), .toList(),
builder: (final context, final sorted) => CustomListView<FolderFeedsWrapper>( builder: (final context, final sorted) => NeonListView<FolderFeedsWrapper>(
scrollKey: 'news-folders', scrollKey: 'news-folders',
withFloatingActionButton: true, withFloatingActionButton: true,
items: sorted, items: sorted,

6
packages/neon/neon_notes/lib/dialogs/create_note.dart

@ -28,7 +28,7 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
@override @override
Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>( Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>(
stream: widget.bloc.notes, stream: widget.bloc.notes,
builder: (final context, final notes) => CustomDialog( builder: (final context, final notes) => NeonDialog(
title: Text(AppLocalizations.of(context).notesCreateNote), title: Text(AppLocalizations.of(context).notesCreateNote),
children: [ children: [
Form( Form(
@ -49,13 +49,13 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
), ),
if (widget.category == null) ...[ if (widget.category == null) ...[
Center( Center(
child: ExceptionWidget( child: NeonException(
notes.error, notes.error,
onRetry: widget.bloc.refresh, onRetry: widget.bloc.refresh,
), ),
), ),
Center( Center(
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
visible: notes.loading, visible: notes.loading,
), ),
), ),

6
packages/neon/neon_notes/lib/dialogs/select_category.dart

@ -28,7 +28,7 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
@override @override
Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>( Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>(
stream: widget.bloc.notes, stream: widget.bloc.notes,
builder: (final context, final notes) => CustomDialog( builder: (final context, final notes) => NeonDialog(
title: Text(AppLocalizations.of(context).notesChangeCategory), title: Text(AppLocalizations.of(context).notesChangeCategory),
children: [ children: [
Form( Form(
@ -37,13 +37,13 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Center( Center(
child: ExceptionWidget( child: NeonException(
notes.error, notes.error,
onRetry: widget.bloc.refresh, onRetry: widget.bloc.refresh,
), ),
), ),
Center( Center(
child: CustomLinearProgressIndicator( child: NeonLinearProgressIndicator(
visible: notes.loading, visible: notes.loading,
), ),
), ),

4
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) { void handleNotesException(final BuildContext context, final Object error) {
if (error is NextcloudApiException && error.statusCode == 412) { if (error is NextcloudApiException && error.statusCode == 412) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).notesNoteChangedOnServer); NeonException.showSnackbar(context, AppLocalizations.of(context).notesNoteChangedOnServer);
} else { } else {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
} }
} }

2
packages/neon/neon_notes/lib/widgets/categories_view.dart

@ -25,7 +25,7 @@ class NotesCategoriesView extends StatelessWidget {
), ),
) )
.toList(), .toList(),
builder: (final context, final sorted) => CustomListView<NoteCategory>( builder: (final context, final sorted) => NeonListView<NoteCategory>(
scrollKey: 'notes-categories', scrollKey: 'notes-categories',
items: sorted, items: sorted,
isLoading: notes.loading, isLoading: notes.loading,

2
packages/neon/neon_notes/lib/widgets/notes_view.dart

@ -47,7 +47,7 @@ class NotesView extends StatelessWidget {
input: category != null input: category != null
? notes.data?.where((final note) => !note.favorite && note.category == category).toList() ? notes.data?.where((final note) => !note.favorite && note.category == category).toList()
: notes.data?.where((final note) => !note.favorite).toList(), : notes.data?.where((final note) => !note.favorite).toList(),
builder: (final context, final sortedNonFavorites) => CustomListView<NextcloudNotesNote>( builder: (final context, final sortedNonFavorites) => NeonListView<NextcloudNotesNote>(
scrollKey: 'notes-notes', scrollKey: 'notes-notes',
withFloatingActionButton: true, withFloatingActionButton: true,
items: [ items: [

6
packages/neon/neon_notifications/lib/pages/main.dart

@ -18,7 +18,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
super.initState(); super.initState();
widget.bloc.errors.listen((final error) { widget.bloc.errors.listen((final error) {
ExceptionWidget.showSnackbar(context, error); NeonException.showSnackbar(context, error);
}); });
} }
@ -34,7 +34,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
}, },
child: const Icon(MdiIcons.checkAll), child: const Icon(MdiIcons.checkAll),
), ),
body: CustomListView<NextcloudNotificationsNotification>( body: NeonListView<NextcloudNotificationsNotification>(
scrollKey: 'notifications-notifications', scrollKey: 'notifications-notifications',
withFloatingActionButton: true, withFloatingActionButton: true,
items: notifications.data, items: notifications.data,
@ -82,7 +82,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
: SizedBox( : SizedBox(
width: 40, width: 40,
height: 40, height: 40,
child: CachedURLImage( child: NeonCachedUrlImage(
url: notification.icon, url: notification.icon,
width: 40, width: 40,
height: 40, height: 40,

Loading…
Cancel
Save