From e137bd6fdec341fceb1b394613295425ec14b6c8 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 11 Jan 2023 08:52:27 +0100 Subject: [PATCH 1/3] neon: Fix l10n linter exclusion --- packages/neon/analysis_options.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neon/analysis_options.yaml b/packages/neon/analysis_options.yaml index f7732dad..b5cc8bc5 100644 --- a/packages/neon/analysis_options.yaml +++ b/packages/neon/analysis_options.yaml @@ -2,4 +2,4 @@ include: package:nit_picking/flutter.yaml analyzer: exclude: - - lib/src/l10n/** + - lib/l10n/** From 280374626d0099cb06a1572cf243a5048b43e5aa Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 11 Jan 2023 09:16:04 +0100 Subject: [PATCH 2/3] Update nit_picking dependency --- packages/dynamite/pubspec.yaml | 2 +- packages/file_icons/pubspec.yaml | 2 +- packages/neon/pubspec.lock | 4 ++-- packages/neon/pubspec.yaml | 2 +- packages/nextcloud/pubspec.yaml | 2 +- packages/nextcloud_push_proxy/pubspec.yaml | 2 +- packages/nextcloud_test/pubspec.yaml | 2 +- packages/settings/pubspec.yaml | 2 +- packages/sort_box/pubspec.yaml | 2 +- packages/spec_templates/pubspec.yaml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/dynamite/pubspec.yaml b/packages/dynamite/pubspec.yaml index 25a4b159..f24c6365 100644 --- a/packages/dynamite/pubspec.yaml +++ b/packages/dynamite/pubspec.yaml @@ -17,4 +17,4 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d diff --git a/packages/file_icons/pubspec.yaml b/packages/file_icons/pubspec.yaml index 0ff0e677..934e0322 100644 --- a/packages/file_icons/pubspec.yaml +++ b/packages/file_icons/pubspec.yaml @@ -14,7 +14,7 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d flutter: fonts: diff --git a/packages/neon/pubspec.lock b/packages/neon/pubspec.lock index 1840252c..cd8b33ca 100644 --- a/packages/neon/pubspec.lock +++ b/packages/neon/pubspec.lock @@ -565,8 +565,8 @@ packages: dependency: "direct dev" description: path: "." - ref: "9f625eb" - resolved-ref: "9f625ebd64e0fd74a94f3c5409282e0e9f825548" + ref: "0b2ee0d" + resolved-ref: "0b2ee0d6d6871a04aaf85e88cd7e877f654d15e3" url: "https://github.com/stack11/dart_nit_picking" source: git version: "0.0.0" diff --git a/packages/neon/pubspec.yaml b/packages/neon/pubspec.yaml index aec42069..1d387ad7 100644 --- a/packages/neon/pubspec.yaml +++ b/packages/neon/pubspec.yaml @@ -69,7 +69,7 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d flutter: uses-material-design: true diff --git a/packages/nextcloud/pubspec.yaml b/packages/nextcloud/pubspec.yaml index bfcb1851..ab0f5c98 100644 --- a/packages/nextcloud/pubspec.yaml +++ b/packages/nextcloud/pubspec.yaml @@ -26,5 +26,5 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d test: ^1.16.0 diff --git a/packages/nextcloud_push_proxy/pubspec.yaml b/packages/nextcloud_push_proxy/pubspec.yaml index 625d7a1c..00f72a92 100644 --- a/packages/nextcloud_push_proxy/pubspec.yaml +++ b/packages/nextcloud_push_proxy/pubspec.yaml @@ -13,4 +13,4 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d diff --git a/packages/nextcloud_test/pubspec.yaml b/packages/nextcloud_test/pubspec.yaml index 9066a25b..0791f50b 100644 --- a/packages/nextcloud_test/pubspec.yaml +++ b/packages/nextcloud_test/pubspec.yaml @@ -15,4 +15,4 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d diff --git a/packages/settings/pubspec.yaml b/packages/settings/pubspec.yaml index aa25e4a6..37a40e8d 100644 --- a/packages/settings/pubspec.yaml +++ b/packages/settings/pubspec.yaml @@ -15,4 +15,4 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d diff --git a/packages/sort_box/pubspec.yaml b/packages/sort_box/pubspec.yaml index 97928e08..be7d5a16 100644 --- a/packages/sort_box/pubspec.yaml +++ b/packages/sort_box/pubspec.yaml @@ -8,5 +8,5 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d test: ^1.21.1 diff --git a/packages/spec_templates/pubspec.yaml b/packages/spec_templates/pubspec.yaml index 2a2ecb3e..b5ec9cc9 100644 --- a/packages/spec_templates/pubspec.yaml +++ b/packages/spec_templates/pubspec.yaml @@ -13,4 +13,4 @@ dev_dependencies: nit_picking: git: url: https://github.com/stack11/dart_nit_picking - ref: 9f625eb + ref: 0b2ee0d From 152ffd4134385798c46cbfb6a4ce1f0892af0572 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 11 Jan 2023 09:16:27 +0100 Subject: [PATCH 3/3] dynamite,neon,nextcloud: Adapt to new linting rules --- packages/dynamite/lib/src/openapi_builder.dart | 2 +- packages/neon/lib/main.dart | 4 +++- .../neon/lib/src/apps/files/dialogs/choose_folder.dart | 4 ++-- .../neon/lib/src/apps/files/widgets/browser_view.dart | 2 +- .../neon/lib/src/apps/news/dialogs/feed_update_error.dart | 2 +- packages/neon/lib/src/pages/home.dart | 8 ++++---- packages/neon/lib/src/pages/login.dart | 2 +- packages/neon/lib/src/widgets/account_tile.dart | 2 +- packages/nextcloud/test/webdav.dart | 6 +++--- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index cad80e5c..9763e6b0 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -1327,7 +1327,7 @@ TypeResult resolveType( (final b) { final s = schema.ofs![results.indexOf(result)]; b - ..name = fields[result.name]! + ..name = fields[result.name] ..type = refer(_makeNullable(result.name, true)) ..modifier = FieldModifier.final$ ..docs.addAll([ diff --git a/packages/neon/lib/main.dart b/packages/neon/lib/main.dart index a32cf6ee..0ad030ad 100644 --- a/packages/neon/lib/main.dart +++ b/packages/neon/lib/main.dart @@ -17,7 +17,9 @@ Future main() async { } env = Env.fromMap(dotenv.env); } - } catch (e) {} + } catch (e) { + debugPrint('Failed to load env: $e'); + } WidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/neon/lib/src/apps/files/dialogs/choose_folder.dart b/packages/neon/lib/src/apps/files/dialogs/choose_folder.dart index 17c42f20..59330922 100644 --- a/packages/neon/lib/src/apps/files/dialogs/choose_folder.dart +++ b/packages/neon/lib/src/apps/files/dialogs/choose_folder.dart @@ -51,8 +51,8 @@ class FilesChooseFolderDialog extends StatelessWidget { child: Text(AppLocalizations.of(context).filesCreateFolder), ), ElevatedButton( - onPressed: !(const ListEquality().equals(originalPath, pathSnapshot.data!)) - ? () => Navigator.of(context).pop(pathSnapshot.data!) + onPressed: !(const ListEquality().equals(originalPath, pathSnapshot.data)) + ? () => Navigator.of(context).pop(pathSnapshot.data) : null, child: Text(AppLocalizations.of(context).filesChooseFolder), ), diff --git a/packages/neon/lib/src/apps/files/widgets/browser_view.dart b/packages/neon/lib/src/apps/files/widgets/browser_view.dart index 5fa2382e..a0ab73a8 100644 --- a/packages/neon/lib/src/apps/files/widgets/browser_view.dart +++ b/packages/neon/lib/src/apps/files/widgets/browser_view.dart @@ -89,7 +89,7 @@ class _FilesBrowserViewState extends State { hasPreview: null, isFavorite: null, ), - uploadProgress: uploadTaskProgressSnapshot.data!, + uploadProgress: uploadTaskProgressSnapshot.data, downloadProgress: null, ), ), diff --git a/packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart b/packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart index 461f514f..b518bf4e 100644 --- a/packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart +++ b/packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart @@ -21,7 +21,7 @@ class _NewsFeedUpdateErrorDialogState extends State { onPressed: () async { await Clipboard.setData( ClipboardData( - text: widget.feed.lastUpdateError!, + text: widget.feed.lastUpdateError, ), ); if (mounted) { diff --git a/packages/neon/lib/src/pages/home.dart b/packages/neon/lib/src/pages/home.dart index e39f9d11..c05c8d93 100644 --- a/packages/neon/lib/src/pages/home.dart +++ b/packages/neon/lib/src/pages/home.dart @@ -53,13 +53,13 @@ class _HomePageState extends State { bool? supported; switch (id) { case 'core': - supported = await widget.account.client.core.isSupported(result.data!); + supported = await widget.account.client.core.isSupported(result.data); break; case 'news': supported = await widget.account.client.news.isSupported(); break; case 'notes': - supported = await widget.account.client.notes.isSupported(result.data!); + supported = await widget.account.client.notes.isSupported(result.data); break; } if (!(supported ?? true)) { @@ -460,7 +460,7 @@ class _HomePageState extends State { if (accounts.length > 1) ...[ Text( account.client.humanReadableID, - style: Theme.of(context).textTheme.bodySmall!, + style: Theme.of(context).textTheme.bodySmall, ), ], ], @@ -494,7 +494,7 @@ class _HomePageState extends State { if (accounts.length > 1) ...[ Text( account.client.humanReadableID, - style: Theme.of(context).textTheme.bodySmall!, + style: Theme.of(context).textTheme.bodySmall, ), ], ], diff --git a/packages/neon/lib/src/pages/login.dart b/packages/neon/lib/src/pages/login.dart index 6f120c86..c2f1dd9f 100644 --- a/packages/neon/lib/src/pages/login.dart +++ b/packages/neon/lib/src/pages/login.dart @@ -29,7 +29,7 @@ class _LoginPageState extends State { _loginBloc = LoginBloc(_packageInfo); if (widget.serverURL != null) { - _loginBloc.setServerURL(widget.serverURL!); + _loginBloc.setServerURL(widget.serverURL); } _loginBloc.loginFlowInit.listen((final init) { diff --git a/packages/neon/lib/src/widgets/account_tile.dart b/packages/neon/lib/src/widgets/account_tile.dart index 171739dc..9adf38a5 100644 --- a/packages/neon/lib/src/widgets/account_tile.dart +++ b/packages/neon/lib/src/widgets/account_tile.dart @@ -68,7 +68,7 @@ class AccountTile extends StatelessWidget { width: 5, ), ExceptionWidget( - userDetails.error!, + userDetails.error, onlyIcon: true, iconSize: 24, onRetry: userDetailsBloc.refresh, diff --git a/packages/nextcloud/test/webdav.dart b/packages/nextcloud/test/webdav.dart index 486742b8..feb4787a 100644 --- a/packages/nextcloud/test/webdav.dart +++ b/packages/nextcloud/test/webdav.dart @@ -49,7 +49,7 @@ Future run(final DockerImage image) async { expect(file.hasPreview, isTrue); expect(file.mimeType, 'image/png'); expect(file.lastModified!.isBefore(DateTime.now()), isTrue); - expect(file.size!, 50598); + expect(file.size, 50598); }); test('Create directory', () async { @@ -168,7 +168,7 @@ Future run(final DockerImage image) async { expect(file.hasPreview, isTrue); expect(file.mimeType, 'image/png'); expect(file.lastModified!.isBefore(DateTime.now()), isTrue); - expect(file.size!, 50598); + expect(file.size, 50598); }); test('Get directory props', () async { @@ -189,7 +189,7 @@ Future run(final DockerImage image) async { expect(file.name, 'test'); expect(file.mimeType, null); expectDateInReasonableTimeRange(file.lastModified!, DateTime.now()); - expect(file.size!, data.lengthInBytes); + expect(file.size, data.lengthInBytes); }); test('Filter files', () async {