Flutter - Build Local JSON App | Android & iOS

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

Комментарии • 107

  • @anshulgupta7812
    @anshulgupta7812 5 лет назад +4

    for new users who are working now a days JSON.decode will occur errors so to solve this... import 'dart:convert' show json; and then in place of var myData =.... type this >> var myData = json.decode(snapshot.data.toString()); >> This will work for you!! :)

  • @DreamSafal
    @DreamSafal 5 лет назад +8

    the JSON.decode wasn't working for me, instead jsonDecode() method worked. no clues why.?
    var mydata= jsonDecode(snapshot.data.toString());

  • @mvn3949
    @mvn3949 4 года назад +5

    Wow man, thanks very much, this has helped me.

  • @gayatrigadewar4443
    @gayatrigadewar4443 Год назад

    which is better option to workout flutter vs code or anriod studio?

  • @mahmudurrahmanshovon185
    @mahmudurrahmanshovon185 5 лет назад +1

    That was really helpful. Thanks a lot, vai. I've been a fan of you. Keep it up.

  • @apnatuition55
    @apnatuition55 3 года назад

    what about convert notes to json file

  • @talhawaqar99
    @talhawaqar99 6 лет назад +14

    Hay friend there is an error inthis line can you correct this
    var mydata = json.decode(snapshot.data.toString());

    • @Lokesh_Karki
      @Lokesh_Karki 6 лет назад +8

      it's more like jsonDecode ()

    • @shaiksaqlain2413
      @shaiksaqlain2413 4 года назад +1

      @@Lokesh_Karki tq bro

    • @nayburz
      @nayburz 4 года назад

      @@Lokesh_Karki you the man. thanks!

    • @sahilkachhap
      @sahilkachhap 4 года назад

      You need to import dàrt: convert , it will work fine then

  • @Riazkhan-sc6ik
    @Riazkhan-sc6ik 4 года назад +1

    Dear sir How can we implement search in this local json file.. please please please make a video on this as well..

  • @fabricendja9719
    @fabricendja9719 4 года назад +2

    Merci ce tutoriel m'a beaucoup aidé a comprendre

  • @zonairraja7575
    @zonairraja7575 6 лет назад +6

    the JSON.decode wasn't working for me, instead jsonDecode() method worked. no clues why.

  • @hassainbasha9195
    @hassainbasha9195 5 лет назад +2

    Hello, can you explain the 'BuildContext context' how it's looping with the list of elements in json and also the context and snapshot of FutureBuilder(builder:(context, snapshot){})

  • @tanupriya9849
    @tanupriya9849 6 лет назад +1

    very nice, very helpful for beginners like me, keep making these kinds of videos, once again great work sir, keep it up :)

  • @kunalbatra6262
    @kunalbatra6262 3 года назад

    The following TypeErrorImpl was thrown building:
    Expected a value of type 'String', but got one of type 'Null'
    I am getting this error Please help!

  • @jaycrijaygandhi
    @jaycrijaygandhi 6 лет назад +1

    What does DefaultAssetBundle actually do?
    Can't understand form the docs

  • @ganeshuchagaonkar3712
    @ganeshuchagaonkar3712 5 лет назад +1

    This video was really helpful for me ....thank you so much!!!!!!

  • @pranitkarale6697
    @pranitkarale6697 4 года назад +1

    In the updated flutter we have to use json.decode

  • @uzairleo2910
    @uzairleo2910 4 года назад

    and also can u mention plz is there any other approach rather than this one for decoding or deserialization of data from json file

  • @clementbabaniyi
    @clementbabaniyi 4 года назад

    Trying to create an horizontal scrollable listview with values gotten from json,,, It keeps giving the vertical.. Help!!!!!!!!!

  • @christophersmith8839
    @christophersmith8839 6 лет назад +2

    This was really helpful thank you! Quick question though, is there anyway to write to the Json file within the assets file from the app?

  • @shammipd
    @shammipd 5 лет назад

    Can you build a map page having text field in body which offers auto search location suggestion using directly google api. I am struggling to get such

  • @brezartrama
    @brezartrama 4 года назад

    Very helpful tutorial, i would like to ask if there is a way to delete an object from json file

  • @Kumar2k12
    @Kumar2k12 3 года назад

    Please give me the github link for this video or json application and also try to make video for arithemetic or mathematical operations

  • @SoyAaaron
    @SoyAaaron 4 года назад

    hi, i know this vid is a bit old, but after i have this set up how could i click on an item and send data to another screen?

  • @JoshStilwell
    @JoshStilwell 6 лет назад +1

    My json data is not showing. I double checked my code with yours and restarted the app..

  • @sanjeevgupta8956
    @sanjeevgupta8956 4 года назад

    It is helpful video,but I have to ask how you auto save the code

  • @CodingWithOmer
    @CodingWithOmer 3 года назад

    if I want to build text and image json how can I call ?

  • @ReadyMeta1
    @ReadyMeta1 6 лет назад +2

    Thanks for doing this tutorial 👍🏾

  • @itssnh3003
    @itssnh3003 4 года назад +1

    How to solve JSON.decode() error?

  • @trustcode9804
    @trustcode9804 6 лет назад

    thx dude your video is very helpfull, but how i put search filter bar on this app

  • @lhexb4797
    @lhexb4797 6 лет назад

    Hi! I really like your video, but at the end of the video I can see that you have two filled in the lib directory, is it possible to have the entire content of both files in the PDF file or in your Github account, that will be very helpful.

  • @Abu2385
    @Abu2385 6 лет назад +1

    Hiii.
    I am using same code .
    But json data is not being fetched .
    Despite there is not a single error.
    App is running on emulator.
    But json data is not coming

  • @hassanmeer7114
    @hassanmeer7114 6 лет назад +1

    not working properly Not Showing data.
    json.decode(sanpshot.data.toString()); in this data is not working as List type variable ???
    @pawan kumar

    • @ananyajain5472
      @ananyajain5472 5 лет назад

      Same issue. If your issue got resolved,pls help me too:)

  • @sadabwasim9850
    @sadabwasim9850 6 лет назад

    Is there any other way to decode json I've seen somewhere that json.decode(api_url); works

  • @arshiajs
    @arshiajs 3 года назад +1

    tnq, source code ?

  • @ezaldeenalayed7291
    @ezaldeenalayed7291 5 лет назад

    can you make for this app refresh so when and new data come I make refresh to get it +++ can you make a notification system for this app so when any new data come the notification appear

  • @zuriafricasafaris
    @zuriafricasafaris 5 лет назад

    Im a fan of ur channel, been looking bloc tutorial from ur channel, if u wont mind, i want to read data from an api using stream as well as send request to the api using the bloc logic, can u help with that

  • @dkq986
    @dkq986 6 лет назад

    I'm trying to hit a java rest API which takes input values. Based on the values the records are fetched. Can you tell me how to pass a parameter through http request object??
    Your videos are really helpful btw! Thanks a ton.

    • @HelloCodepur
      @HelloCodepur  6 лет назад

      parameter as in ? you want to do post request ?

  • @shreyanshdokania9008
    @shreyanshdokania9008 3 года назад +4

    I was getting some errors after decoding the json file and then I figured it out..
    Here's the code with maybe some changes, if anyone of u get stuck at some errors or something
    import 'package:flutter/material.dart';
    import 'dart:convert';
    void main() => runApp(new MaterialApp(
    theme: new ThemeData(
    primarySwatch: Colors.blue,
    ),
    home: new HomePage(),
    ));
    class HomePage extends StatefulWidget {
    @override
    _HomePageState createState() => _HomePageState();
    }
    class _HomePageState extends State {
    List data;
    @override
    Widget build(BuildContext context) {
    return new Scaffold(
    appBar: new AppBar(
    title: new Text(
    "Loading Json App using flutter",
    ),
    ),
    body: new Container(
    child: new Center(
    child: new FutureBuilder(
    future: DefaultAssetBundle.of(context)
    .loadString('loadjson/person.json'),
    builder: (context, snapshot) {
    //decode json
    var mydata = JsonDecoder().convert(snapshot.data.toString());
    return new ListView.builder(
    itemBuilder: (BuildContext context, int index) {
    return new Card(
    child: new Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: [
    new Text("Name : " + mydata[index]['name']),
    new Text("Age : " + mydata[index]['age']),
    new Text("Height : " + mydata[index]['height']),
    new Text("Gender : " + mydata[index]['gender']),
    new Text("Hair Color : " + mydata[index]['hair_color']),
    ],
    ),
    );
    },
    itemCount: mydata == null ? 0 : mydata.length,
    );
    },
    ),
    ),
    ),
    );
    }
    }

    • @shaansen6821
      @shaansen6821 3 года назад

      you the man! Been smashing my head over how to get the itemCount data. Thanks for being a great help!

  • @lhexb4797
    @lhexb4797 6 лет назад

    It seems impossible for me to read the file, so any help please

  • @gamingwithkj6012
    @gamingwithkj6012 5 лет назад

    formatException: unexcepted character (at character 1) is coming pls hellp

  • @mohdfaisalsaiyed5057
    @mohdfaisalsaiyed5057 4 года назад

    Invalid argument(s) error

  • @shamyusof701
    @shamyusof701 6 лет назад

    hi..how to return 1 data only??? where id = 2

    • @naufalhafizi1044
      @naufalhafizi1044 5 лет назад

      change index to 2 and itemCount true to 1 data only

  • @furqankaleem3565
    @furqankaleem3565 5 лет назад +1

    Data is not showing :(

  • @letsgetcopyright2603
    @letsgetcopyright2603 3 года назад

    Where is the source code?

  • @deepikadeep4524
    @deepikadeep4524 6 лет назад

    How to render images from local json

    • @HelloCodepur
      @HelloCodepur  6 лет назад

      What's the issue ? It will be the same assuming that you have stored some url for images?

    • @deepikadeep4524
      @deepikadeep4524 6 лет назад

      Can you give a example like how to do

  • @tarunjain8423
    @tarunjain8423 5 лет назад

    hey dude plzzz provide me the code or the repository link on github of above code asap!!

  • @uzairleo2910
    @uzairleo2910 4 года назад

    also make a tutorial for json.encode()
    like how to serialized the data or saved or write the data to json file

  • @reactsolutions9608
    @reactsolutions9608 5 лет назад

    bro plz show this code on your git and type 'String' is not a subtype of type 'int' i got this types of error

    • @abhi_in_sydney
      @abhi_in_sydney 3 года назад

      remove new Text("Age: " + mydata[index]['age']) and run it is because the output is an int but we have declare a string

  • @indianpsycho8878
    @indianpsycho8878 2 года назад

    Thanks but it would be helpful if you upload the source code too!

  • @codewithcong
    @codewithcong 6 лет назад

    Great
    Thank you very much

  • @darish155
    @darish155 6 лет назад

    What is a JSON file?

    • @HelloCodepur
      @HelloCodepur  6 лет назад +1

      JSON stands for JAVASCRIPT OBJECT NOTATION. You can google it more information

    • @darish155
      @darish155 6 лет назад

      @@HelloCodepur Thankyou!!

  • @pingkeeng7305
    @pingkeeng7305 6 лет назад

    How do we write/edit to the json file ?
    (Not talking about app storage. -> flutter.io/cookbook/persistence/reading-writing-files/)

  • @المحاميالشرعيمعتزالشريدة

    Project file plz !

  • @mathankumar3368
    @mathankumar3368 5 лет назад

    Nice Video

  • @BipinOli90
    @BipinOli90 6 лет назад

    Thanks for this

  • @samwd5039
    @samwd5039 6 лет назад

    Says JSON is depreciated and shouldn't be used.

  • @VishalSingh-nn1px
    @VishalSingh-nn1px 4 года назад

    Thanks bro

  • @thetechaholic1944
    @thetechaholic1944 6 лет назад +1

    20:13 Exactly my opinion XD

  • @RaviPandeyInventersDen
    @RaviPandeyInventersDen 5 лет назад +1

    thats a weak json file .. use a complex json file having structure like having nested dictionaries. that would be more useful .

  • @aakashdabas9490
    @aakashdabas9490 5 лет назад +1

    Bhai simulator pe error dika raha h....kya karu😈
    Baki sab code sahi h

  • @studysmart24
    @studysmart24 6 лет назад

    We know english ..but we want it hindi plz

  • @studysmart24
    @studysmart24 6 лет назад

    We want Hindi

  • @osamasan8288
    @osamasan8288 4 года назад

    you talk a lot and your explanation is boring and not brief ,I am not a mocker but for you to be better

  • @furkanvatandas4819
    @furkanvatandas4819 6 лет назад

    That's hard

  • @mahmudulhussain5401
    @mahmudulhussain5401 6 лет назад +4

    bhai ..english why ..plz hindi

    • @studysmart24
      @studysmart24 6 лет назад

      Right bro... English sabko ata hai..lekin we are indian hindi mai video banavo

  • @ananyajain5472
    @ananyajain5472 5 лет назад

    not working properly Not Showing data.
    json.decode(sanpshot.data.toString()); in this data is not working as List type variable ???
    @pawan kumar

    • @kranthi4692
      @kranthi4692 5 лет назад

      Make sure you are actually loading the asset in your pubspec , since yaml space sensitive if you dont maintain the exact spacing as in the vid you will not see data populate.