Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. Muki Bwoi
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 6
    • Best 2
    • Controversial 0
    • Groups 2

    Posts made by Muki Bwoi

    • RE: What Responsibility Do I Need To Fulfil As A Freelance Net Full Stack Developer?

      Thank you for posting

      posted in Web Development
      Muki Bwoi
      Muki Bwoi
    • FLutter App Development

      new banner.png

      Google Form : - https://forms.gle/Qs4i6DmyDnMNMYt99

      posted in Front-End Development
      Muki Bwoi
      Muki Bwoi
    • RE: Flutter App එකක සිංහල අකුරු ටයිප් කරන්න

      Pencil software eka use krnna. eka unicode support

      posted in Flutter
      Muki Bwoi
      Muki Bwoi
    • RE: Flutter Auth UI

      patta bro keep it up

      posted in Flutter
      Muki Bwoi
      Muki Bwoi
    • RE: We wish you all Happy New Year 2021

      Same to you Bro

      posted in Announcements
      Muki Bwoi
      Muki Bwoi
    • Flutter Http call
      import 'package:flutter/material.dart';
      import 'dart:convert';
      import 'package:http/http.dart' as http;
      
      Future<Profile> 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<String, dynamic> json) {
          return Profile(data : json["data"]);
        }
      }
      
      void main() {
        runApp(new MaterialApp(
          home: new Button(),
        ));
      }
      
      class MyApp extends StatefulWidget {
        @override
        _MyAppState createState() => _MyAppState();
      }
      
      class _MyAppState extends State<MyApp> {
        Future<Profile> futureProfile;
      
        @override
        void initState() {
          futureProfile = fetchProfile();
          super.initState();
        }
      
        @override
        Widget build(BuildContext context) {
          return FutureBuilder<Profile>(
            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() => _ButtonState();
      }
      
      class _ButtonState extends State<Button> {
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: Container(child: RaisedButton(
                onPressed: () {
                  Navigator.of(context).push(MaterialPageRoute(builder: (_) {
                    return MyApp();
                  }));
                },
              )),
            ),
          );
        }
      }
      
      
      

      මේ කෝඩ් එක යට කියල තියෙන විදිහට වෙනස් කරන්නෙ කොහොමද ?

      flutter වල ඉන්ටර්නෙට් එක හරහා API කෝල් කරනකොට ජේසන් ෆයිල් එකේ ඇරේ එකක් ඇතුලේ තියෙන ඩේටා කෝල් කරන්නෙ කොහොමද ?

      උදාහරනයක් විදිහට මේ වගේ එකකින්.
      https://hpb.health.gov.lk/api/get-current-statistical

      මේකේ ඩේටා තියෙන්නෙ data කියන ඇරේ එක ඇතුලේ.
      ඒක කෝල් කරන්නෙ කොහොමද?:confused: :confused: :confused:

      posted in Flutter
      Muki Bwoi
      Muki Bwoi
    • 1 / 1