roomplan_flutter_plugin 0.0.2
roomplan_flutter_plugin: ^0.0.2 copied to clipboard
A plugin intergration RoomPlan for flutter.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:sample_plugin_flutter/sample_plugin_flutter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late final TextEditingController _urlController;
late final RoomPlanViewController _roomPlanViewController;
@override
void initState() {
_urlController = TextEditingController(text: 'https://flutter.dev/');
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Column(
children: [
ElevatedButton(
onPressed: () =>
_roomPlanViewController.getStringJSON(),
child: const Text('PRINT JSON SCAN'),
),
Expanded(
child: RoomPlanView(
onMapViewCreated: _onMapViewCreated,
),
),
],
),
),
);
}
void _onMapViewCreated(RoomPlanViewController controller) {
_roomPlanViewController = controller;
controller.startSession(start: _urlController.text);
}
}