For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
+
+## Useful environment variables
+
+- **DEBUG_DISPLAY** enables the Device Preview.
+- **DISABLE_BKG_ANIMATION** disables the main background animation.
+
+Use them like this:
+
+```
+flutter run --dart-define=DEBUG_DISPLAY=true,DISABLE_BKG_ANIMATION=true
+```
\ No newline at end of file
void main() async {
WidgetsFlutterBinding.ensureInitialized();
+ const debugDisplay = bool.fromEnvironment('DEBUG_DISPLAY');
runApp(DevicePreview(
- enabled: false,
+ enabled: debugDisplay,
tools: const [
...DevicePreview.defaultTools,
],
) {
return Consumer(builder: (context, ref, child) {
final state = ref.read(appProvider);
+ const disableBkgAnimation = bool.fromEnvironment('DISABLE_BKG_ANIMATION');
+ if(disableBkgAnimation)
+ print('Background animation: disabled');
return Scaffold(
key: homeScaffoldKey,
extendBody: true,
appBar: const CustomTopBar(),
body: Stack(
children: [
- Lottie.asset(
- 'animations/BG-dotwaveform.json',
- fit: BoxFit.cover,
- repeat: true,
- ),
+ if (!disableBkgAnimation)
+ Lottie.asset(
+ 'animations/BG-dotwaveform.json',
+ fit: BoxFit.cover,
+ repeat: true,
+ ),
FlowBuilder<AppState>(
state: ref.watch(appProvider),
onGeneratePages: onGenerateAppViewPages,