kopia lustrzana https://gitlab.com/mysocialportal/relatica
Add device_preview to the app for better previewing capabilities
rodzic
e28cf85b46
commit
aa0fd14c5a
|
@ -1,3 +1,5 @@
|
|||
import 'package:device_preview/device_preview.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:multi_trigger_autocomplete/multi_trigger_autocomplete.dart';
|
||||
|
@ -25,6 +27,7 @@ import 'utils/old_android_letsencrypte_cert.dart';
|
|||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// await dotenv.load(fileName: '.env');
|
||||
const enablePreview = false;
|
||||
Logger.root.level = Level.FINER;
|
||||
Logger.root.onRecord.listen((event) {
|
||||
final logName = event.loggerName.isEmpty ? 'ROOT' : event.loggerName;
|
||||
|
@ -36,7 +39,10 @@ void main() async {
|
|||
await fixLetsEncryptCertOnOldAndroid();
|
||||
await dependencyInjectionInitialization();
|
||||
|
||||
runApp(const App());
|
||||
runApp(DevicePreview(
|
||||
enabled: !kReleaseMode && enablePreview,
|
||||
builder: (context) => const App(),
|
||||
));
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
|
@ -102,6 +108,9 @@ class App extends StatelessWidget {
|
|||
)
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
useInheritedMediaQuery: true,
|
||||
locale: DevicePreview.locale(context),
|
||||
builder: DevicePreview.appBuilder,
|
||||
theme: AppTheme.light,
|
||||
darkTheme: AppTheme.dark,
|
||||
themeMode: getIt<SettingsService>().themeMode,
|
||||
|
|
37
pubspec.lock
37
pubspec.lock
|
@ -249,6 +249,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
device_frame:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: device_frame
|
||||
sha256: afe76182aec178d171953d9b4a50a43c57c7cf3c77d8b09a48bf30c8fa04dd9d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
device_info_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -265,6 +273,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
device_preview:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: device_preview
|
||||
sha256: "2f097bf31b929e15e6756dbe0ec1bcb63952ab9ed51c25dc5a2c722d2b21fdaf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -358,6 +374,11 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
flutter_localizations:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -456,6 +477,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.10.0"
|
||||
freezed_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: freezed_annotation
|
||||
sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -600,6 +629,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.3"
|
||||
intl:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.17.0"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -52,6 +52,7 @@ dependencies:
|
|||
carousel_slider: ^4.2.1
|
||||
device_info_plus: ^8.0.0
|
||||
string_validator: ^0.3.0
|
||||
device_preview: ^1.1.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
Ładowanie…
Reference in New Issue