Splash Screen test

This commit is contained in:
Feodor Fitsner 2025-03-03 13:57:19 -08:00
parent 9fd40c0325
commit a3e067776e
1 changed files with 36 additions and 1 deletions

View File

@ -14,6 +14,13 @@ import 'package:window_manager/window_manager.dart';
import "python.dart";
/*
{% import "_macros.jinja2" as macros %}
{% set splash_screen = macros.get_value(cookiecutter.pyproject, "tool.flet.splash_screen") | default(True, true) %}
{% set splash_screen_text = macros.get_value(cookiecutter.pyproject, "tool.flet.splash_screen_text") | trim %}
*/
{% for dep in cookiecutter.flutter.dependencies %}
import 'package:{{ dep }}/{{ dep }}.dart' as {{ dep }};
{% endfor %}
@ -83,7 +90,7 @@ void main(List<String> args) async {
text: snapshot.error.toString()));
} else {
// loading
return const MaterialApp(home: BlankScreen());
return const MaterialApp(home: {% if splash_screen "BlankScreen()" else "SplashScreen()" %});
}
}));
}
@ -294,6 +301,34 @@ class ErrorScreen extends StatelessWidget {
}
}
class SplashScreen extends StatelessWidget {
const SplashScreen({
super.key,
});
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(strokeWidth: 3),
),
SizedBox(
height: 12,
),
Text("Getting things ready…")
],
),
),
);
}
}
class BlankScreen extends StatelessWidget {
const BlankScreen({
super.key,