feat(neon): add AppImplementation equality
@ -4,9 +4,9 @@ import 'package:neon_news/neon_news.dart';
import 'package:neon_notes/neon_notes.dart';
import 'package:neon_notifications/neon_notifications.dart';
final List<AppImplementation> appImplementations = [
final Set<AppImplementation> appImplementations = {
FilesApp(),
NewsApp(),
NotesApp(),
NotificationsApp(),
];
};
@ -21,7 +21,7 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
Future<void> runNeon({
required final Iterable<AppImplementation> appImplementations,
required final Set<AppImplementation> appImplementations,
required final NeonTheme theme,
@visibleForTesting final WidgetsBinding? bindingOverride,
@visibleForTesting final Account? account,
@ -124,6 +124,12 @@ abstract class AppImplementation<T extends Bloc, R extends NextcloudAppOptions>
///
/// You can later access it through `Theme.of(context).extension<ThemeName>()`.
final ThemeExtension? theme = null;
@override
bool operator ==(final Object other) => other is AppImplementation && other.id == id;
int get hashCode => id.hashCode;
}
extension AppImplementationFind on Iterable<AppImplementation> {
@ -1,3 +1,5 @@
// ignore_for_file: avoid_implementing_value_types
import 'package:mocktail/mocktail.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:test/test.dart';
@ -21,7 +21,9 @@ part 'options.dart';
part 'pages/main.dart';
class NotificationsApp extends AppImplementation<NotificationsBloc, NotificationsAppSpecificOptions>
implements NotificationsAppInterface<NotificationsBloc, NotificationsAppSpecificOptions> {
implements
// ignore: avoid_implementing_value_types
NotificationsAppInterface<NotificationsBloc, NotificationsAppSpecificOptions> {
NotificationsApp();