Browse Source

neon, app: don't require widget WidgetsBinding

pull/374/head
Nikolas Rimikis 2 years ago
parent
commit
dc648d85c0
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 2
      packages/app/integration_test/screenshot_test.dart
  2. 2
      packages/app/lib/main.dart
  3. 3
      packages/neon/neon/lib/neon.dart

2
packages/app/integration_test/screenshot_test.dart

@ -93,9 +93,9 @@ Future runTestApp(
final Account? account,
}) async {
await runNeon(
binding: binding,
getAppImplementations: getAppImplementations,
branding: getNeonBranding(),
bindingOverride: binding,
sharedPreferencesOverride: MemorySharedPreferences(),
account: account,
firstLaunchDisabled: true,

2
packages/app/lib/main.dart

@ -1,11 +1,9 @@
import 'package:app/apps.dart';
import 'package:app/branding.dart';
import 'package:flutter/material.dart';
import 'package:neon/neon.dart';
Future main() async {
await runNeon(
binding: WidgetsFlutterBinding.ensureInitialized(),
getAppImplementations: getAppImplementations,
branding: getNeonBranding(),
);

3
packages/neon/neon/lib/neon.dart

@ -102,15 +102,16 @@ part 'src/widgets/text_settings_tile.dart';
part 'src/widgets/user_avatar.dart';
Future runNeon({
required final WidgetsBinding binding,
required final Iterable<AppImplementation> Function(SharedPreferences, RequestManager, NeonPlatform)
getAppImplementations,
required final Branding branding,
final WidgetsBinding? bindingOverride,
final SharedPreferences? sharedPreferencesOverride,
final Account? account,
final bool firstLaunchDisabled = false,
final bool nextPushDisabled = false,
}) async {
final binding = bindingOverride ?? WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: binding);
final sharedPreferences = sharedPreferencesOverride ?? await SharedPreferences.getInstance();

Loading…
Cancel
Save