Untitled
unknown
dart
a year ago
1.1 kB
1
Indexable
Never
import 'package:flutter/material.dart'; import 'package:weather/Worker/worker.dart'; class Loading extends StatefulWidget { const Loading({super.key}); @override State<Loading> createState() => _LoadingState(); } class _LoadingState extends State<Loading> { String? temperature; String? humid; String? wind_speed; String? describe; startApp() async{ worker instance = worker(location: 'Dhaka'); await instance.getData(); temperature=instance.temp; humid=instance.humidity; wind_speed=instance.air_speed; describe= instance.describtion; Navigator.pushReplacementNamed(context, '/home_page',arguments: { "temp_value":temperature, "humidity_value":humid, "air_speed_value":wind_speed, "describtion_value":describe }); } @override void initState() { // TODO: implement initState super.initState(); startApp(); } @override Widget build(BuildContext context) { return Scaffold( body: SafeArea(child: Text("Loading")) ); } }