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 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([

4
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();

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

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

@ -89,7 +89,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
hasPreview: null,
isFavorite: null,
),
uploadProgress: uploadTaskProgressSnapshot.data!,
uploadProgress: uploadTaskProgressSnapshot.data,
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 {
await Clipboard.setData(
ClipboardData(
text: widget.feed.lastUpdateError!,
text: widget.feed.lastUpdateError,
),
);
if (mounted) {

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

@ -53,13 +53,13 @@ class _HomePageState extends State<HomePage> {
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<HomePage> {
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<HomePage> {
if (accounts.length > 1) ...[
Text(
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);
if (widget.serverURL != null) {
_loginBloc.setServerURL(widget.serverURL!);
_loginBloc.setServerURL(widget.serverURL);
}
_loginBloc.loginFlowInit.listen((final init) {

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

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

Loading…
Cancel
Save