refactor: move floor plan editor into own widget
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../domain/models/floor_plan_mode.dart';
|
||||
import '../../../providers.dart';
|
||||
import '../../floorplan/widgets/konva_web_view.dart';
|
||||
import '../../floorplan/widgets/floor_plan_editor.dart';
|
||||
|
||||
class StepFloorPlan extends ConsumerStatefulWidget {
|
||||
const StepFloorPlan({super.key, required this.onComplete});
|
||||
@@ -15,7 +15,7 @@ class StepFloorPlan extends ConsumerStatefulWidget {
|
||||
}
|
||||
|
||||
class _StepFloorPlanState extends ConsumerState<StepFloorPlan> {
|
||||
final _konvaKey = GlobalKey<KonvaWebViewState>();
|
||||
final _konvaKey = GlobalKey<FloorPlanEditorState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -42,11 +42,11 @@ class _StepFloorPlanState extends ConsumerState<StepFloorPlan> {
|
||||
style: Theme.of(context).textTheme.titleLarge),
|
||||
),
|
||||
Expanded(
|
||||
child: KonvaWebView(
|
||||
child: FloorPlanEditor(
|
||||
key: _konvaKey,
|
||||
mode: FloorPlanMode.edit,
|
||||
onSensorTapped: (_) {},
|
||||
onSensorMoved: (_, __, ___, ____) {},
|
||||
onSensorMoved: (_, _, _, _) {},
|
||||
onRoomsUpdated: (roomUpdates) async {
|
||||
final floor = ref.read(floorProvider).valueOrNull;
|
||||
if (floor == null) return;
|
||||
|
||||
Reference in New Issue
Block a user