<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with array]]></title><description><![CDATA[A list of topics that have been tagged with array]]></description><link>https://lankadevelopers.lk/tags/array</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 23:41:22 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/tags/array.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[Flutter Http call]]></title><description><![CDATA[<pre><code>import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;

Future&lt;Profile&gt; fetchProfile() async {
  final response =
      await http.get('https://hpb.health.gov.lk/api/get-current-statistical');

  if (response.statusCode == 200) {
    return Profile.fromJson(jsonDecode(response.body));
  } else {
    throw Exception('Failed to load Data');
  }
}

class Profile {
  String data;

  Profile({this.data});

  factory Profile.fromJson(Map&lt;String, dynamic&gt; json) {
    return Profile(data : json["data"]);
  }
}

void main() {
  runApp(new MaterialApp(
    home: new Button(),
  ));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() =&gt; _MyAppState();
}

class _MyAppState extends State&lt;MyApp&gt; {
  Future&lt;Profile&gt; futureProfile;

  @override
  void initState() {
    futureProfile = fetchProfile();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return FutureBuilder&lt;Profile&gt;(
      future: futureProfile,
      // ignore: missing_return
      builder: (contex, snapshot) {
        if (snapshot.hasData) {
          return Scaffold(
              body: Center(child: Container(child: Text(snapshot.data.data))));
        } else if (snapshot.hasError) {
          return Text("${snapshot.error}");
        }

        return Scaffold(
          body: Center(
            child: CircularProgressIndicator(
              backgroundColor: Colors.white,
              strokeWidth: 5,
            ),
          ),
        );
      },
    );
  }
}

class Button extends StatefulWidget {
  @override
  _ButtonState createState() =&gt; _ButtonState();
}

class _ButtonState extends State&lt;Button&gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Container(child: RaisedButton(
          onPressed: () {
            Navigator.of(context).push(MaterialPageRoute(builder: (_) {
              return MyApp();
            }));
          },
        )),
      ),
    );
  }
}


</code></pre>
<p dir="auto">මේ  කෝඩ් එක යට කියල තියෙන විදිහට වෙනස්  කරන්නෙ කොහොමද ?</p>
<p dir="auto">flutter වල ඉන්ටර්නෙට් එක හරහා  API  කෝල් කරනකොට ජේසන් ෆයිල් එකේ  ඇරේ එකක් ඇතුලේ තියෙන ඩේටා කෝල් කරන්නෙ කොහොමද ?</p>
<p dir="auto">උදාහරනයක් විදිහට මේ වගේ  එකකින්.<br />
<a href="https://hpb.health.gov.lk/api/get-current-statistical" target="_blank" rel="noopener noreferrer nofollow ugc">https://hpb.health.gov.lk/api/get-current-statistical</a></p>
<p dir="auto">මේකේ ඩේටා තියෙන්නෙ data කියන ඇරේ එක ඇතුලේ.<br />
ඒක කෝල් කරන්නෙ කොහොමද?:confused: :confused: :confused:</p>
]]></description><link>https://lankadevelopers.lk/topic/770/flutter-http-call</link><guid isPermaLink="true">https://lankadevelopers.lk/topic/770/flutter-http-call</guid><dc:creator><![CDATA[Muki Bwoi]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[arrays සම්බන්ද, මේ JavaScript ගැටලුව විසද ගන්න උදව් ඕන.]]></title><description><![CDATA[<p dir="auto">meken idea ekak ganna puluwan wei <a href="https://stackoverflow.com/questions/62949257/how-to-access-an-array-in-an-array-in-a-collection" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/62949257/how-to-access-an-array-in-an-array-in-a-collection</a></p>
]]></description><link>https://lankadevelopers.lk/topic/587/arrays-සම-බන-ද-ම-javascript-ග-ටල-ව-ව-සද-ගන-න-උදව-ඕන</link><guid isPermaLink="true">https://lankadevelopers.lk/topic/587/arrays-සම-බන-ද-ම-javascript-ග-ටල-ව-ව-සද-ගන-න-උදව-ඕන</guid><dc:creator><![CDATA[ijseGovindu]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>