Added test for login page

This commit is contained in:
Anton Stubenbord
2022-12-05 19:15:00 +01:00
parent 0a63259693
commit d79682a011
20 changed files with 444 additions and 50 deletions

View File

@@ -33,7 +33,7 @@ import 'package:paperless_mobile/generated/l10n.dart';
import 'package:paperless_mobile/util.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
void main() async {
Future<void> startAppProd() async {
Bloc.observer = BlocChangesObserver();
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
@@ -42,25 +42,22 @@ void main() async {
// Required for self signed client certificates
HttpOverrides.global = X509HttpOverrides();
configureDependencies();
configureDependencies('prod');
// Remove temporarily downloaded files.
(await FileService.temporaryDirectory).deleteSync(recursive: true);
kPackageInfo = await PackageInfo.fromPlatform();
// Load application settings and stored authentication data
getIt<ConnectivityCubit>().initialize();
await getIt<ConnectivityCubit>().initialize();
await getIt<ApplicationSettingsCubit>().initialize();
await getIt<AuthenticationCubit>().initialize();
// Preload asset images
// WARNING: This seems to bloat up the app up to almost 200mb!
// await Future.forEach<AssetImage>(
// AssetImages.values.map((e) => e.image),
// (img) => loadImage(img),
// );
runApp(const PaperlessMobileEntrypoint());
}
void main() async {
await startAppProd();
}
class PaperlessMobileEntrypoint extends StatefulWidget {
const PaperlessMobileEntrypoint({Key? key}) : super(key: key);
@@ -114,11 +111,7 @@ class _PaperlessMobileEntrypointState extends State<PaperlessMobileEntrypoint> {
),
),
themeMode: settings.preferredThemeMode,
supportedLocales: const [
Locale('en'), // Default if system locale is not available
Locale('de'),
Locale('cs'),
],
supportedLocales: S.delegate.supportedLocales,
locale: Locale.fromSubtags(
languageCode: settings.preferredLocaleSubtag),
localizationsDelegates: const [