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