Flutter FutureBuilder Widget - API call using FutureBuilder | Flutter Tutorial Video Tutorial : https://youtu.be/2XCM878cZJc Source Code: import 'dart:convert' ; import 'package:flutter/material.dart' ; import 'package:http/http.dart' as http; void main () { runApp ( const MyApp ()); } class MyApp extends StatefulWidget { const MyApp ({ Key ? key }) : super ( key : key ); @ override State < MyApp > createState () => _MyAppState (); } class _MyAppState extends State < MyApp > { Future < int > getData () async { final data = await http. get ( Uri . parse ( "http://www.randomnumberapi.com/api/v1.0/random?min=100&max=1000&count=1" )); final body = json. decode (data.body); int number = (body as List ).first; return number; } @ override Widget build ( BuildContext context ) { ...
Get to know about the latest market technologies and its implementations. Availaible source code for android and flutter functional implementations