Flutter with python backend
310
You can use this plugin navigate to web site https://pub.dev/packages/url_launcher
_launchURL() async {
const url = 'https://flutter.dev';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Author by
Lara Wehbe
Updated on December 23, 2022Comments
-
Lara Wehbe over 1 year
i have a website python-based that consists of a form that i want to fill from flutter. this form takes one input text field (get request ) when submit is pressed, it will generate an output based on the python script ( it is an natural language processing) is it possible to connect to this website using flutter and fill the form ? i have tried using 'HTTP' package in flutter but i was not able to connect to the form any help will be appreciated i tried the following:
Future<String> sendQuery(query) async{ final http.Response response = await http.get( 'http://127.0.0.1:5000/getQuery/', headers: <String, String>{ 'Content-Type': 'application/json; charset=UTF-8', }, ); }
-
Lara Wehbe over 3 yearsHello, Thank you for your help i really appreciate. Is there a way to get to fill the form, press submit and get the output on a widget in flutter ? here is my specific question. i have been surfing the internet so far but i cannot get good questions
-
Johny Saini over 3 yearsyeah you can do this
-
Lara Wehbe over 3 yearsI am checking the Flutter package 'http' , to send and get requests , so if i want to send the sentence to the form on the website, how can i write it ? i was thinking about the code i have written in the code . but how can i press the submit on the website form to get the needed output ? do you have any idea ?
-
Johny Saini over 3 yearsThere are two way what you want 1. You want to fill form from flutter and send request then get response back show in flutter widget. 2. If you want go website fill form there and get response in flutter widget.