Flutter library to Flutterflow - single coding task

Job ID: 36820660

Budget: $10 – $30 USD

I am posting this as a single task within a project.

Use a FFAppState callback to send the result to an app state variable in flutterflow
Guidance doc:https://docs.flutterflow.io/customizing-your-app/custom-functions/custom-widgets
I have shared above code here in a FF project... https://app.flutterflow.io/project/map-picker-test-srvxl8?tab=customCode&customCodeTab=widgets
The library is https://pub.dev/packages/place_picker or you can suggest another library to use for picking a location from a map and storing the GPS.

Flutterflow has built-in google map library which conflicts when using lat/lng so you may need to use an import alias. Task awarded to the first person that can show me the solution that compiles within Flutterflow without errors.

import 'package:place_picker/place_picker.dart';

class PickerDemo extends StatefulWidget {
const PickerDemo({
Key? key,
this.width,
this.height,
}) : super(key: key);

final double? width;
final double? height;

@override
_PickerDemoState createState() => _PickerDemoState();
}

class _PickerDemoState extends State<PickerDemo> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton(
child: Text("Pick Delivery location"),
onPressed: () {
showPlacePicker();
},
),
),
);
}

void showPlacePicker() async {
LocationResult? result = await Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
PlacePicker("API Key")));

// Handle the result in your way
print(result);
}
}
Related categories: Dart Coding Flutter