mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-20 05:33:44 +02:00
feat: add device preview package to the example app
With Device Preview it is easy to view the userstory on different kinds of devices and change settings like language
This commit is contained in:
parent
e34e370165
commit
73048837a3
2 changed files with 21 additions and 1 deletions
|
@ -1,8 +1,19 @@
|
|||
import "package:device_preview/device_preview.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter_availability/flutter_availability.dart";
|
||||
|
||||
void main() {
|
||||
runApp(const App());
|
||||
runApp(
|
||||
DevicePreview(
|
||||
enabled: true,
|
||||
isToolbarVisible: true,
|
||||
availableLocales: const [
|
||||
Locale("en_US"),
|
||||
Locale("nl_NL"),
|
||||
],
|
||||
builder: (_) => const App(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
|
@ -10,6 +21,14 @@ class App extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) => MaterialApp(
|
||||
builder: DevicePreview.appBuilder,
|
||||
locale: DevicePreview.locale(context),
|
||||
supportedLocales: const [
|
||||
Locale("en", "US"),
|
||||
Locale("nl", "NL"),
|
||||
],
|
||||
theme: ThemeData.light(),
|
||||
darkTheme: ThemeData.dark(),
|
||||
home: AvailabilityUserStory(
|
||||
userId: "",
|
||||
options: AvailabilityOptions(),
|
||||
|
|
|
@ -9,6 +9,7 @@ environment:
|
|||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
device_preview: ^1.2.0
|
||||
flutter_availability:
|
||||
path: ../../packages/flutter_availability
|
||||
|
||||
|
|
Loading…
Reference in a new issue