You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In this simple program I notes that the scipt php is called for 2 times. I want to know if it is possibile to call it only one time.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return GetMaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
RxString response = ''.obs;
Future fetchData() async {
try {
final response = await GetConnect().get('http://192.168.1.21/test.php');
}
@OverRide
Widget build(BuildContext context) {
// Chiamare fetchData all'avvio dell'app
fetchData();
}
}
Beta Was this translation helpful? Give feedback.
All reactions