docs: update quickstart
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user