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_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';

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

@ -91,7 +91,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
settings: settings,
builder: builder,
)
: NoAnimationPageRoute(
: _NoAnimationPageRoute(
settings: settings,
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,
onRetry: _userDetailsBloc.refresh,
),
CustomLinearProgressIndicator(
NeonLinearProgressIndicator(
visible: userDetails.loading,
),
],

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

@ -113,7 +113,7 @@ class _HomePageState extends State<HomePage> {
} 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<HomePage> {
_accountsBloc.setActiveAccount(account);
},
icon: IntrinsicHeight(
child: AccountAvatar(
child: NeonAccountAvatar(
account: account,
),
),
@ -290,17 +290,17 @@ class _HomePageState extends State<HomePage> {
],
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<HomePage> {
.map<DropdownMenuItem<String>>(
(final account) => DropdownMenuItem<String>(
value: account.id,
child: AccountTile(
child: NeonAccountTile(
account: account,
dense: true,
textColor:
@ -343,12 +343,12 @@ class _HomePageState extends State<HomePage> {
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<HomePage> {
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<HomePage> {
? 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<HomePage> {
width: 8,
),
Expanded(
child: CustomLinearProgressIndicator(
child: NeonLinearProgressIndicator(
color: Theme.of(context).appBarTheme.foregroundColor,
),
),
@ -517,7 +517,7 @@ class _HomePageState extends State<HomePage> {
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<HomePage> {
],
IconButton(
icon: IntrinsicWidth(
child: AccountAvatar(
child: NeonAccountAvatar(
account: account,
),
),
@ -564,7 +564,7 @@ class _HomePageState extends State<HomePage> {
Expanded(
child: Column(
children: [
ExceptionWidget(
NeonException(
appImplementations.error,
onRetry: _appsBloc.refresh,
),

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

@ -63,7 +63,7 @@ class _LoginPageState extends State<LoginPage> {
} 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<LoginPage> {
} 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<LoginPage> {
),
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,
),

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

@ -121,7 +121,7 @@ class _SettingsPageState extends State<SettingsPage> {
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<SettingsPage> {
),
],
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<SettingsPage> {
} 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<SettingsPage> {
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<SettingsPage> {
} catch (e, s) {
debugPrint(e.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
Widget build(final BuildContext context) => CustomDialog(
Widget build(final BuildContext context) => NeonDialog(
title: Text(widget.title),
children: [
Form(

6
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 {

6
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,

10
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,

4
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,

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

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

4
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,

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';
class CustomDialog extends StatelessWidget {
const CustomDialog({
class NeonDialog extends StatelessWidget {
const NeonDialog({
this.title,
this.children,
super.key,

4
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,

4
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,

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';
class CustomLinearProgressIndicator extends StatelessWidget {
const CustomLinearProgressIndicator({
class NeonLinearProgressIndicator extends StatelessWidget {
const NeonLinearProgressIndicator({
this.visible = true,
this.margin = const EdgeInsets.symmetric(horizontal: 10),
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';
class CustomListView<T> extends StatelessWidget {
const CustomListView({
class NeonListView<T> extends StatelessWidget {
const NeonListView({
required this.items,
required this.isLoading,
required this.error,
@ -32,7 +32,7 @@ class CustomListView<T> extends StatelessWidget {
if (topFixedChildren != null) ...[
...topFixedChildren!,
],
CustomLinearProgressIndicator(
NeonLinearProgressIndicator(
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
@ -48,7 +48,7 @@ class CustomListView<T> extends StatelessWidget {
if (topScrollingChildren != null) ...[
...topScrollingChildren!,
],
ExceptionWidget(
NeonException(
error,
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';
class TextSettingsTile extends SettingsTile {
const TextSettingsTile({
class NeonTextSettingsTile extends SettingsTile {
const NeonTextSettingsTile({
required this.text,
this.style,
super.key,

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

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

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

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

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

@ -18,7 +18,7 @@ class _FilesMainPageState extends State<FilesMainPage> {
super.initState();
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();
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),
)
: null,
body: CustomListView<Widget>(
body: NeonListView<Widget>(
scrollKey: 'files-${pathSnapshot.data!.join('/')}',
withFloatingActionButton: true,
items: [

4
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<AccountsBloc>(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,

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

@ -45,7 +45,7 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
@override
Widget build(final BuildContext context) => ResultBuilder<NewsBloc, List<NextcloudNewsFolder>>(
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<NewsAddFeedDialog> {
),
if (widget.folderID == null) ...[
Center(
child: ExceptionWidget(
child: NeonException(
folders.error,
onRetry: widget.bloc.refresh,
),
),
Center(
child: CustomLinearProgressIndicator(
child: NeonLinearProgressIndicator(
visible: folders.loading,
),
),

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

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

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

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

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

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

4
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,

2
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<NextcloudNewsFeed>(
builder: (final context, final sorted) => NeonListView<NextcloudNewsFeed>(
scrollKey: 'news-feeds',
withFloatingActionButton: true,
items: sorted,

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

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

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

@ -28,7 +28,7 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
@override
Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>(
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<NotesCreateNoteDialog> {
),
if (widget.category == null) ...[
Center(
child: ExceptionWidget(
child: NeonException(
notes.error,
onRetry: widget.bloc.refresh,
),
),
Center(
child: CustomLinearProgressIndicator(
child: NeonLinearProgressIndicator(
visible: notes.loading,
),
),

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

@ -28,7 +28,7 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
@override
Widget build(final BuildContext context) => ResultBuilder<NotesBloc, List<NextcloudNotesNote>>(
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<NotesSelectCategoryDialog> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Center(
child: ExceptionWidget(
child: NeonException(
notes.error,
onRetry: widget.bloc.refresh,
),
),
Center(
child: CustomLinearProgressIndicator(
child: NeonLinearProgressIndicator(
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) {
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);
}
}

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

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

2
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<NextcloudNotesNote>(
builder: (final context, final sortedNonFavorites) => NeonListView<NextcloudNotesNote>(
scrollKey: 'notes-notes',
withFloatingActionButton: true,
items: [

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

@ -18,7 +18,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
super.initState();
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),
),
body: CustomListView<NextcloudNotificationsNotification>(
body: NeonListView<NextcloudNotificationsNotification>(
scrollKey: 'notifications-notifications',
withFloatingActionButton: true,
items: notifications.data,
@ -82,7 +82,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
: SizedBox(
width: 40,
height: 40,
child: CachedURLImage(
child: NeonCachedUrlImage(
url: notification.icon,
width: 40,
height: 40,

Loading…
Cancel
Save