Browse Source

dynamite,neon,nextcloud: Adapt to new linting rules

pull/176/head
jld3103 2 years ago
parent
commit
152ffd4134
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/dynamite/lib/src/openapi_builder.dart
  2. 4
      packages/neon/lib/main.dart
  3. 4
      packages/neon/lib/src/apps/files/dialogs/choose_folder.dart
  4. 2
      packages/neon/lib/src/apps/files/widgets/browser_view.dart
  5. 2
      packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart
  6. 8
      packages/neon/lib/src/pages/home.dart
  7. 2
      packages/neon/lib/src/pages/login.dart
  8. 2
      packages/neon/lib/src/widgets/account_tile.dart
  9. 6
      packages/nextcloud/test/webdav.dart

2
packages/dynamite/lib/src/openapi_builder.dart

@ -1327,7 +1327,7 @@ TypeResult resolveType(
(final b) { (final b) {
final s = schema.ofs![results.indexOf(result)]; final s = schema.ofs![results.indexOf(result)];
b b
..name = fields[result.name]! ..name = fields[result.name]
..type = refer(_makeNullable(result.name, true)) ..type = refer(_makeNullable(result.name, true))
..modifier = FieldModifier.final$ ..modifier = FieldModifier.final$
..docs.addAll([ ..docs.addAll([

4
packages/neon/lib/main.dart

@ -17,7 +17,9 @@ Future main() async {
} }
env = Env.fromMap(dotenv.env); env = Env.fromMap(dotenv.env);
} }
} catch (e) {} } catch (e) {
debugPrint('Failed to load env: $e');
}
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();

4
packages/neon/lib/src/apps/files/dialogs/choose_folder.dart

@ -51,8 +51,8 @@ class FilesChooseFolderDialog extends StatelessWidget {
child: Text(AppLocalizations.of(context).filesCreateFolder), child: Text(AppLocalizations.of(context).filesCreateFolder),
), ),
ElevatedButton( ElevatedButton(
onPressed: !(const ListEquality().equals(originalPath, pathSnapshot.data!)) onPressed: !(const ListEquality().equals(originalPath, pathSnapshot.data))
? () => Navigator.of(context).pop(pathSnapshot.data!) ? () => Navigator.of(context).pop(pathSnapshot.data)
: null, : null,
child: Text(AppLocalizations.of(context).filesChooseFolder), child: Text(AppLocalizations.of(context).filesChooseFolder),
), ),

2
packages/neon/lib/src/apps/files/widgets/browser_view.dart

@ -89,7 +89,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
hasPreview: null, hasPreview: null,
isFavorite: null, isFavorite: null,
), ),
uploadProgress: uploadTaskProgressSnapshot.data!, uploadProgress: uploadTaskProgressSnapshot.data,
downloadProgress: null, downloadProgress: null,
), ),
), ),

2
packages/neon/lib/src/apps/news/dialogs/feed_update_error.dart

@ -21,7 +21,7 @@ class _NewsFeedUpdateErrorDialogState extends State<NewsFeedUpdateErrorDialog> {
onPressed: () async { onPressed: () async {
await Clipboard.setData( await Clipboard.setData(
ClipboardData( ClipboardData(
text: widget.feed.lastUpdateError!, text: widget.feed.lastUpdateError,
), ),
); );
if (mounted) { if (mounted) {

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

@ -53,13 +53,13 @@ class _HomePageState extends State<HomePage> {
bool? supported; bool? supported;
switch (id) { switch (id) {
case 'core': case 'core':
supported = await widget.account.client.core.isSupported(result.data!); supported = await widget.account.client.core.isSupported(result.data);
break; break;
case 'news': case 'news':
supported = await widget.account.client.news.isSupported(); supported = await widget.account.client.news.isSupported();
break; break;
case 'notes': case 'notes':
supported = await widget.account.client.notes.isSupported(result.data!); supported = await widget.account.client.notes.isSupported(result.data);
break; break;
} }
if (!(supported ?? true)) { if (!(supported ?? true)) {
@ -460,7 +460,7 @@ class _HomePageState extends State<HomePage> {
if (accounts.length > 1) ...[ if (accounts.length > 1) ...[
Text( Text(
account.client.humanReadableID, account.client.humanReadableID,
style: Theme.of(context).textTheme.bodySmall!, style: Theme.of(context).textTheme.bodySmall,
), ),
], ],
], ],
@ -494,7 +494,7 @@ class _HomePageState extends State<HomePage> {
if (accounts.length > 1) ...[ if (accounts.length > 1) ...[
Text( Text(
account.client.humanReadableID, account.client.humanReadableID,
style: Theme.of(context).textTheme.bodySmall!, style: Theme.of(context).textTheme.bodySmall,
), ),
], ],
], ],

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

@ -29,7 +29,7 @@ class _LoginPageState extends State<LoginPage> {
_loginBloc = LoginBloc(_packageInfo); _loginBloc = LoginBloc(_packageInfo);
if (widget.serverURL != null) { if (widget.serverURL != null) {
_loginBloc.setServerURL(widget.serverURL!); _loginBloc.setServerURL(widget.serverURL);
} }
_loginBloc.loginFlowInit.listen((final init) { _loginBloc.loginFlowInit.listen((final init) {

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

@ -68,7 +68,7 @@ class AccountTile extends StatelessWidget {
width: 5, width: 5,
), ),
ExceptionWidget( ExceptionWidget(
userDetails.error!, userDetails.error,
onlyIcon: true, onlyIcon: true,
iconSize: 24, iconSize: 24,
onRetry: userDetailsBloc.refresh, onRetry: userDetailsBloc.refresh,

6
packages/nextcloud/test/webdav.dart

@ -49,7 +49,7 @@ Future run(final DockerImage image) async {
expect(file.hasPreview, isTrue); expect(file.hasPreview, isTrue);
expect(file.mimeType, 'image/png'); expect(file.mimeType, 'image/png');
expect(file.lastModified!.isBefore(DateTime.now()), isTrue); expect(file.lastModified!.isBefore(DateTime.now()), isTrue);
expect(file.size!, 50598); expect(file.size, 50598);
}); });
test('Create directory', () async { test('Create directory', () async {
@ -168,7 +168,7 @@ Future run(final DockerImage image) async {
expect(file.hasPreview, isTrue); expect(file.hasPreview, isTrue);
expect(file.mimeType, 'image/png'); expect(file.mimeType, 'image/png');
expect(file.lastModified!.isBefore(DateTime.now()), isTrue); expect(file.lastModified!.isBefore(DateTime.now()), isTrue);
expect(file.size!, 50598); expect(file.size, 50598);
}); });
test('Get directory props', () async { test('Get directory props', () async {
@ -189,7 +189,7 @@ Future run(final DockerImage image) async {
expect(file.name, 'test'); expect(file.name, 'test');
expect(file.mimeType, null); expect(file.mimeType, null);
expectDateInReasonableTimeRange(file.lastModified!, DateTime.now()); expectDateInReasonableTimeRange(file.lastModified!, DateTime.now());
expect(file.size!, data.lengthInBytes); expect(file.size, data.lengthInBytes);
}); });
test('Filter files', () async { test('Filter files', () async {

Loading…
Cancel
Save