roomplan_flutter_plugin 0.0.4
roomplan_flutter_plugin: ^0.0.4 copied to clipboard
A plugin intergration RoomPlan for flutter.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:roomplan_flutter_plugin/roomplan_flutter_plugin.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late final TextEditingController _urlController;
late final RoomPlanViewController _roomPlanViewController;
@override
void initState() {
_urlController = TextEditingController(text: 'startSesssion');
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);
}
}