Browse Source

chore(dynamite,neon,neon_files,neon_news,nextcloud): Fix linter complaints

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/579/head
jld3103 1 year ago
parent
commit
e2ba362baf
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/dynamite/dynamite/lib/src/openapi_builder.dart
  2. 34
      packages/dynamite/dynamite_runtime/test/content_string_test.dart
  3. 4
      packages/neon/neon/lib/src/pages/home.dart
  4. 10
      packages/neon/neon/lib/src/pages/settings.dart
  5. 2
      packages/neon/neon/lib/src/router.dart
  6. 2
      packages/neon/neon/lib/src/widgets/account_switcher.dart
  7. 2
      packages/neon/neon/lib/src/widgets/image_wrapper.dart
  8. 15
      packages/neon/neon_files/lib/widgets/actions.dart
  9. 2
      packages/neon/neon_files/lib/widgets/file_list_tile.dart
  10. 9
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  11. 3
      packages/neon/neon_news/lib/widgets/folders_view.dart
  12. 4
      packages/nextcloud/lib/src/api/core.openapi.dart
  13. 6
      packages/nextcloud/lib/src/api/files_sharing.openapi.dart
  14. 28
      packages/nextcloud/lib/src/api/provisioning_api.openapi.dart
  15. 2
      packages/nextcloud/lib/src/api/settings.openapi.dart
  16. 2
      packages/nextcloud/lib/src/api/user_status.openapi.dart

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

@ -1113,7 +1113,7 @@ TypeResult resolveObject(
..type = refer('String')
..annotations.add(refer('override'))
..assignment = Code("r'${state.prefix}$identifier'"),
)
),
])
..methods.addAll([
Method((final b) {
@ -1389,7 +1389,7 @@ TypeResult resolveType(
..type = refer('String')
..annotations.add(refer('override'))
..assignment = Code("r'${state.prefix}$identifier'"),
)
),
])
..methods.addAll([
Method((final b) {

34
packages/dynamite/dynamite_runtime/test/content_string_test.dart

@ -20,14 +20,14 @@ final Serializers serializers = (_$serializers.toBuilder()
..addBuilderFactory(const FullType(ContentString, [FullType(double)]), ContentStringBuilder<double>.new)
..addBuilderFactory(
const FullType(ContentString, [
FullType(BuiltList, [FullType(int)])
FullType(BuiltList, [FullType(int)]),
]),
ContentStringBuilder<BuiltList<int>>.new,
)
..addBuilderFactory(const FullType(BuiltList, [FullType(int)]), ListBuilder<int>.new)
..addBuilderFactory(
const FullType(ContentString, [
FullType(BuiltMap, [FullType(String), FullType(int)])
FullType(BuiltMap, [FullType(String), FullType(int)]),
]),
ContentStringBuilder<BuiltMap<String, int>>.new,
)
@ -36,7 +36,7 @@ final Serializers serializers = (_$serializers.toBuilder()
..addBuilderFactory(const FullType(ContentString, [FullType(String)]), ContentStringBuilder<String>.new)
..addBuilderFactory(
const FullType(ContentString, [
FullType(ContentString, [FullType(String)])
FullType(ContentString, [FullType(String)]),
]),
ContentStringBuilder<ContentString<String>>.new,
))
@ -62,7 +62,7 @@ void main() {
final serialized = json.decode(
json.encode({
r'$': 'ContentString',
'content': {r'$': 'bool', '': true}
'content': {r'$': 'bool', '': true},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -95,7 +95,7 @@ void main() {
final serialized = json.decode(
json.encode({
r'$': 'ContentString',
'content': {r'$': 'double', '': 42.5}
'content': {r'$': 'double', '': 42.5},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -113,7 +113,7 @@ void main() {
final data = ContentString<BuiltList<int>>((final b) => b..content = BuiltList([1, 2, 3]));
final serialized = json.encode([1, 2, 3]);
const specifiedType = FullType(ContentString, [
FullType(BuiltList, [FullType(int)])
FullType(BuiltList, [FullType(int)]),
]);
test('can be serialized', () {
@ -135,9 +135,9 @@ void main() {
'': [
{r'$': 'int', '': 1},
{r'$': 'int', '': 2},
{r'$': 'int', '': 3}
]
}
{r'$': 'int', '': 3},
],
},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -158,7 +158,7 @@ void main() {
// using the StandardJsonPlugin will encode it to a valid Map<String, int>.
final serialized = json.encode({'one': 1, 'two': 2, 'three': 3});
const specifiedType = FullType(ContentString, [
FullType(BuiltMap, [FullType(String), FullType(int)])
FullType(BuiltMap, [FullType(String), FullType(int)]),
]);
test('can be serialized', () {
@ -179,8 +179,8 @@ void main() {
r'$': 'encoded_map',
r'{"$":"String","":"one"}': {r'$': 'int', '': 1},
r'{"$":"String","":"two"}': {r'$': 'int', '': 2},
r'{"$":"String","":"three"}': {r'$': 'int', '': 3}
}
r'{"$":"String","":"three"}': {r'$': 'int', '': 3},
},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -216,7 +216,7 @@ void main() {
final serialized = json.decode(
json.encode({
r'$': 'ContentString',
'content': {r'$': 'int', '': 42}
'content': {r'$': 'int', '': 42},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -249,7 +249,7 @@ void main() {
final serialized = json.decode(
json.encode({
r'$': 'ContentString',
'content': {r'$': 'String', '': 'test'}
'content': {r'$': 'String', '': 'test'},
}),
) as Object;
const specifiedType = FullType.unspecified;
@ -272,7 +272,7 @@ void main() {
);
final serialized = json.encode(json.encode('test'));
const specifiedType = FullType(ContentString, [
FullType(ContentString, [FullType(String)])
FullType(ContentString, [FullType(String)]),
]);
test('can be serialized', () {
@ -296,8 +296,8 @@ void main() {
r'$': 'ContentString',
'content': {
r'$': 'ContentString',
'content': {r'$': 'String', '': 'test'}
}
'content': {r'$': 'String', '': 'test'},
},
}),
) as Object;
const specifiedType = FullType.unspecified;

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

@ -89,7 +89,9 @@ class _HomePageState extends State<HomePage> {
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());
NeonException.showSnackbar(context, e);
if (mounted) {
NeonException.showSnackbar(context, e);
}
}
}

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

@ -217,7 +217,7 @@ class _SettingsPageState extends State<SettingsPage> {
icon: Icon(MdiIcons.accountPlus),
label: Text(AppLocalizations.of(context).globalOptionsAccountsAdd),
),
)
),
],
),
SettingsCategory(
@ -264,7 +264,9 @@ class _SettingsPageState extends State<SettingsPage> {
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());
NeonException.showSnackbar(context, e);
if (mounted) {
NeonException.showSnackbar(context, e);
}
}
},
),
@ -302,7 +304,9 @@ class _SettingsPageState extends State<SettingsPage> {
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());
NeonException.showSnackbar(context, e);
if (mounted) {
NeonException.showSnackbar(context, e);
}
}
},
),

2
packages/neon/neon/lib/src/router.dart

@ -109,7 +109,7 @@ class AccountSettingsRoute extends GoRouteData {
name: 'AccountSettings',
),
],
)
),
],
)
@immutable

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

@ -59,7 +59,7 @@ class AccountSwitcherButton extends StatelessWidget {
Navigator.of(context).pop();
const SettingsRoute(initialCategory: SettingsCageories.accounts).push(context);
},
)
),
],
);

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

@ -16,7 +16,7 @@ class NeonImageWrapper extends StatelessWidget {
@override
Widget build(final BuildContext context) => ClipRRect(
borderRadius: borderRadius,
borderRadius: borderRadius ?? BorderRadius.zero,
child: ColorFiltered(
colorFilter: ColorFilter.mode(color, BlendMode.dstATop),
child: SizedBox.fromSize(

15
packages/neon/neon_files/lib/widgets/actions.dart

@ -33,6 +33,9 @@ class FileActions extends StatelessWidget {
),
);
case FilesFileAction.rename:
if (!context.mounted) {
return;
}
final result = await showRenameDialog(
context: context,
title:
@ -43,6 +46,9 @@ class FileActions extends StatelessWidget {
bloc.rename(details.path, result);
}
case FilesFileAction.move:
if (!context.mounted) {
return;
}
final b = bloc.getNewFilesBrowserBloc();
final originalPath = details.path.sublist(0, details.path.length - 1);
b.setPath(originalPath);
@ -59,6 +65,9 @@ class FileActions extends StatelessWidget {
bloc.move(details.path, result..add(details.name));
}
case FilesFileAction.copy:
if (!context.mounted) {
return;
}
final b = bloc.getNewFilesBrowserBloc();
final originalPath = details.path.sublist(0, details.path.length - 1);
b.setPath(originalPath);
@ -75,6 +84,9 @@ class FileActions extends StatelessWidget {
bloc.copy(details.path, result..add(details.name));
}
case FilesFileAction.sync:
if (!context.mounted) {
return;
}
final sizeWarning = browserBloc.options.downloadSizeWarning.value;
if (sizeWarning != null && details.size != null && details.size! > sizeWarning) {
if (!(await showConfirmationDialog(
@ -89,6 +101,9 @@ class FileActions extends StatelessWidget {
}
bloc.syncFile(details.path);
case FilesFileAction.delete:
if (!context.mounted) {
return;
}
if (await showConfirmationDialog(
context,
details.isDirectory

2
packages/neon/neon_files/lib/widgets/file_list_tile.dart

@ -122,7 +122,7 @@ class _FileIcon extends StatelessWidget {
size: 14,
color: Colors.yellow,
),
)
),
],
);
}

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

@ -112,6 +112,9 @@ class NewsFeedsView extends StatelessWidget {
),
);
case NewsFeedAction.delete:
if (!context.mounted) {
return;
}
if (await showConfirmationDialog(
context,
AppLocalizations.of(context).feedRemoveConfirm(feed.title),
@ -119,6 +122,9 @@ class NewsFeedsView extends StatelessWidget {
bloc.removeFeed(feed.id);
}
case NewsFeedAction.rename:
if (!context.mounted) {
return;
}
final result = await showRenameDialog(
context: context,
title: AppLocalizations.of(context).feedRename,
@ -128,6 +134,9 @@ class NewsFeedsView extends StatelessWidget {
bloc.renameFeed(feed.id, result);
}
case NewsFeedAction.move:
if (!context.mounted) {
return;
}
final result = await showDialog<List<int?>>(
context: context,
builder: (final context) => NewsMoveFeedDialog(

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

@ -93,6 +93,9 @@ class NewsFoldersView extends StatelessWidget {
bloc.deleteFolder(folder.id);
}
case NewsFolderAction.rename:
if (!context.mounted) {
return;
}
final result = await showRenameDialog(
context: context,
title: AppLocalizations.of(context).folderRename,

4
packages/nextcloud/lib/src/api/core.openapi.dart

@ -4138,7 +4138,7 @@ class _$CoreReferenceApiResolveResponse200ApplicationJson_Ocs_Data_ReferencesSer
@override
final Iterable<Type> types = const [
CoreReferenceApiResolveResponse200ApplicationJson_Ocs_Data_References,
_$CoreReferenceApiResolveResponse200ApplicationJson_Ocs_Data_References
_$CoreReferenceApiResolveResponse200ApplicationJson_Ocs_Data_References,
];
@override
@ -4282,7 +4282,7 @@ class _$CoreReferenceApiExtractResponse200ApplicationJson_Ocs_Data_ReferencesSer
@override
final Iterable<Type> types = const [
CoreReferenceApiExtractResponse200ApplicationJson_Ocs_Data_References,
_$CoreReferenceApiExtractResponse200ApplicationJson_Ocs_Data_References
_$CoreReferenceApiExtractResponse200ApplicationJson_Ocs_Data_References,
];
@override

6
packages/nextcloud/lib/src/api/files_sharing.openapi.dart

@ -2379,7 +2379,7 @@ class _$FilesSharingShareesapiShareesapiSearchHeadersSerializer
@override
final Iterable<Type> types = const [
FilesSharingShareesapiShareesapiSearchHeaders,
_$FilesSharingShareesapiShareesapiSearchHeaders
_$FilesSharingShareesapiShareesapiSearchHeaders,
];
@override
@ -3455,7 +3455,7 @@ class _$FilesSharingShareesapiFindRecommendedShareTypeSerializer
@override
final Iterable<Type> types = const [
FilesSharingShareesapiFindRecommendedShareType,
_$FilesSharingShareesapiFindRecommendedShareType
_$FilesSharingShareesapiFindRecommendedShareType,
];
@override
@ -4119,7 +4119,7 @@ final Serializers _serializers = (Serializers().toBuilder()
)
..addBuilderFactory(
const FullType(BuiltList, [
FullType(BuiltMap, [FullType(String), FullType(JsonObject)])
FullType(BuiltMap, [FullType(String), FullType(JsonObject)]),
]),
ListBuilder<BuiltMap>.new,
)

28
packages/nextcloud/lib/src/api/provisioning_api.openapi.dart

@ -1043,7 +1043,7 @@ class ProvisioningApiPreferencesClient {
queryParameters['configs'] = _jsonSerializers.serialize(
configs,
specifiedType: const FullType(ContentString, [
FullType(BuiltMap, [FullType(String), FullType(String)])
FullType(BuiltMap, [FullType(String), FullType(String)]),
]),
);
path = path.replaceAll('{appId}', Uri.encodeQueryComponent(appId));
@ -1313,8 +1313,8 @@ class ProvisioningApiUsersClient {
specifiedType: const FullType(ContentString, [
FullType(BuiltMap, [
FullType(String),
FullType(BuiltList, [FullType(String)])
])
FullType(BuiltList, [FullType(String)]),
]),
]),
);
headers['OCS-APIRequest'] = oCSAPIRequest;
@ -3349,7 +3349,7 @@ class _$ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_
@override
final Iterable<Type> types = const [
ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users,
_$ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users
_$ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users,
];
@override
@ -4140,7 +4140,7 @@ class _$ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_U
@override
final Iterable<Type> types = const [
ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users,
_$ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users
_$ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users,
];
@override
@ -5510,7 +5510,7 @@ final Serializers _serializers = (Serializers().toBuilder()
..addBuilderFactory(
const FullType(BuiltMap, [
FullType(String),
FullType(ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users)
FullType(ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users),
]),
MapBuilder<String, ProvisioningApiGroupsGetGroupUsersDetailsResponse200ApplicationJson_Ocs_Data_Users>.new,
)
@ -5585,7 +5585,7 @@ final Serializers _serializers = (Serializers().toBuilder()
)
..addBuilderFactory(
const FullType(ContentString, [
FullType(BuiltMap, [FullType(String), FullType(String)])
FullType(BuiltMap, [FullType(String), FullType(String)]),
]),
ContentString<BuiltMap<String, String>>.new,
)
@ -5666,16 +5666,16 @@ final Serializers _serializers = (Serializers().toBuilder()
)
..add(ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users1.serializer)
..addBuilderFactory(
const FullType(
BuiltMap,
[FullType(String), FullType(ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users)],
),
const FullType(BuiltMap, [
FullType(String),
FullType(ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users),
]),
MapBuilder<String, ProvisioningApiUsersGetUsersDetailsResponse200ApplicationJson_Ocs_Data_Users>.new,
)
..addBuilderFactory(
const FullType(BuiltMap, [
FullType(String),
FullType(BuiltList, [FullType(String)])
FullType(BuiltList, [FullType(String)]),
]),
MapBuilder<String, BuiltList>.new,
)
@ -5683,8 +5683,8 @@ final Serializers _serializers = (Serializers().toBuilder()
const FullType(ContentString, [
FullType(BuiltMap, [
FullType(String),
FullType(BuiltList, [FullType(String)])
])
FullType(BuiltList, [FullType(String)]),
]),
]),
ContentString<BuiltMap<String, BuiltList<String>>>.new,
)

2
packages/nextcloud/lib/src/api/settings.openapi.dart

@ -151,7 +151,7 @@ class _$SettingsLogSettingsLogSettingsDownloadHeadersSerializer
@override
final Iterable<Type> types = const [
SettingsLogSettingsLogSettingsDownloadHeaders,
_$SettingsLogSettingsLogSettingsDownloadHeaders
_$SettingsLogSettingsLogSettingsDownloadHeaders,
];
@override

2
packages/nextcloud/lib/src/api/user_status.openapi.dart

@ -1258,7 +1258,7 @@ class _$UserStatusUserStatusRevertStatusResponse200ApplicationJson_Ocs_DataSeria
@override
final Iterable<Type> types = const [
UserStatusUserStatusRevertStatusResponse200ApplicationJson_Ocs_Data,
_$UserStatusUserStatusRevertStatusResponse200ApplicationJson_Ocs_Data
_$UserStatusUserStatusRevertStatusResponse200ApplicationJson_Ocs_Data,
];
@override

Loading…
Cancel
Save