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