docs: update quickstart

This commit is contained in:
Nick Fisher
2024-06-26 12:42:13 +08:00
parent b117a4a19c
commit f7c22d2480

View File

@@ -70,18 +70,21 @@ class _MyAppState extends State<MyApp> {
class _MyAppState extends State<MyApp> {
late ThermionFlutterPlugin _thermionFlutterPlugin; 
late Future<ThermionViewer> _thermionViewer;
ThermionViewer? _thermionViewer;
void initState() {   
_thermionFlutterPlugin = ThermionFlutterPlugin();
_thermionViewer = _thermionFlutterPlugin.initialize();
_thermionFlutterPlugin.createViewer().then((viewer) {
setState(() {
_thermionViewer = viewer;
});
});
}   
Widget build(BuildContext context) {
return Stack(children:[
if(_thermionViewer != null)
    Positioned.fill(
child:ThermionWidget(
plugin:_thermionFlutterPlugin
plugin:_thermionViewer!
        ) 
    )
    ]); 
@@ -104,11 +107,12 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return Stack(children:[
    if(_thermionViewer != null)
    Positioned.fill(
child:ThermionWidget(
plugin:_thermionFlutterPlugin
plugin:_thermionViewer!
        ) 
    ),
    ),
if (!_loaded)
Center(
child: ElevatedButton(