Loading...
Searching...
No Matches
location_view.dart
Go to the documentation of this file.
1import 'dart:ffi';
2import 'package:flutter/material.dart';
3
4import 'package:navigine_sdk/platform_view.dart';
5import 'package:navigine_sdk/com/navigine/idl/location_window.dart';
6import 'package:navigine_sdk/com/navigine/idl/navigine_sdk.dart';
7
21class LocationView extends StatefulWidget {
22 const LocationView({Key? key, required this.onViewCreated, this.textDirection, }): super(key: key);
23
24 @override
25 State<StatefulWidget> createState() {
26 return _LocationViewState();
27 }
28
34 final void Function(LocationWindow) onViewCreated;
35 final TextDirection? textDirection;
36}
37
38class _LocationViewState extends State<LocationView> {
39 @override
40 Widget build(BuildContext context) {
41 return PlatformView.create(
42 (view) {
43 if (!mounted) {
44 return false;
45 }
46
47 final window = NavigineSdk.getInstance().createLocationWindow(view);
48 widget.onViewCreated(window);
49
50 return true;
51 },
52 textDirection: widget.textDirection,
53 );
54 }
55}