m3_lightmeter/lib/application.dart
Vadim f0d707b071
Show Lightmeter Pro price before purchase (#183)
* Upgraded `targetSdkVersion` to 34

* added price to `IAPProduct`

* implemented `ProFeaturesScreen` (wip)

* finalized `ProFeaturesScreen` layout

* replaced `ProFeaturesDialog` with `ProFeaturesScreen`

* added translations

* fixed feature checkbox width calculation

* fixed tests

* separated android & ios features

* NPE

* changed "get pro" tile colors

* unified Lightmeter Pro related naming

* typo

* updated golden tests

* use iap 0.11.0

* revert unrelated changes

This reverts commit bae5ead8f0.

* lint

* adjusted eng translation

* updated goldens
2024-07-23 23:19:41 +02:00

54 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:lightmeter/data/models/supported_locale.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/platform_config.dart';
import 'package:lightmeter/providers/user_preferences_provider.dart';
import 'package:lightmeter/screens/lightmeter_pro/screen_lightmeter_pro.dart';
import 'package:lightmeter/screens/metering/flow_metering.dart';
import 'package:lightmeter/screens/settings/flow_settings.dart';
import 'package:lightmeter/screens/shared/release_notes_dialog/flow_dialog_release_notes.dart';
import 'package:lightmeter/screens/timer/flow_timer.dart';
class Application extends StatelessWidget {
const Application({super.key});
@override
Widget build(BuildContext context) {
final theme = UserPreferencesProvider.themeOf(context);
final systemIconsBrightness = ThemeData.estimateBrightnessForColor(theme.colorScheme.onSurface);
return AnnotatedRegion(
value: SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarBrightness: systemIconsBrightness == Brightness.light ? Brightness.dark : Brightness.light,
statusBarIconBrightness: systemIconsBrightness,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarIconBrightness: systemIconsBrightness,
),
child: MaterialApp(
debugShowCheckedModeBanner: !PlatformConfig.isTest,
theme: theme,
locale: Locale(UserPreferencesProvider.localeOf(context).intlName),
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
builder: (context, child) => MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: child!,
),
initialRoute: "metering",
routes: {
"metering": (_) => const ReleaseNotesFlow(child: MeteringFlow()),
"settings": (_) => const SettingsFlow(),
"lightmeterPro": (_) => LightmeterProScreen(),
"timer": (context) => TimerFlow(args: ModalRoute.of(context)!.settings.arguments! as TimerFlowArgs),
},
),
);
}
}