title: How to run a function and get a value and add it in text in Flutter
body: <p>I have written the following code below in Flutter</p>
  <pre><code>import 'dart:ui';
  import 'package:flutter/material.dart';
  import 'dart:io';
  import 'package:geolocator/geolocator.dart';
  import 'package:http/http.dart' as http;
  import 'dart:convert';
  
  
  void main() =&gt; runApp(Myapp());
  
  
  
  class Myapp extends StatelessWidget {
    
    @override
    Widget build(BuildContext context) {
      return  MaterialApp(
  
    home: Scaffold(
      appBar: AppBar(
      title: Text('Hello World'),
      centerTitle: true,
      backgroundColor: Colors.blueAccent,
    ),
   
    body: Center(child: MyStatefulWidget(),
  ),
  )
      );
    }
  }
  
  class Weather extends StatefulWidget {
   UpdateTextState createState() =&gt; UpdateTextState();
  }
  
  class UpdateTextState extends State {
      // var textHolder = 'Getting';
      
      weath() async {
      Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
      print(position.latitude);
      print(position.longitude);
      var url = 'https://api.openweathermap.org/data/2.5/weather?lat=${position.latitude}&amp;lon=${position.longitude}&amp;appid=myapiid';
      print(url);
      var response = await http.get(url);
      var dart  = json.decode(response.body);
      var dartt = dart['main'];
      var climate = dartt['temp'];
      var weather = climate - 32 * 5/9;  
      // print('Response status: ${response.statusCode}');
      // print('Response body: ${json.decode(response.body)}');
      // print(dart['main']);
      // print(dartt['temp']);
      var textHolder = '${weather.toString()}C';
      return textHolder;
      }
   
    @override
    Widget build(BuildContext context) {
     var c  = weath();
     //print(textHolder);
      //changeText();
      return Scaffold(
        body: Center(child: Column(
          children: &lt;Widget&gt;[
          Container(
            padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
            child: Text(c),
            ),
  
          
        ]))
      );
    }
  }
  </code></pre>
  <p>if I run this program this is the output I am getting <a href="https://i.stack.imgur.com/ibzZX.png" rel="nofollow noreferrer">Please refer to This image</a> actually I want the weather that I get from the API which is text holder variable please Help me guys I have even tried without return statement too also I have tried adding the function directly which also didn't work out well basically is there any alternate way or did I make any mistake in the code</p>