Tags down


I am getting a error in flutter that method "+" was called on null

By : Briannah
Date : July 30 2020, 07:00 AM
I wish did fix the issue. Presently I am playing around with a course on flutter on Udemy with the app named as Personal Expenses , I solved it by :-
making the value of totalSum = 0
code :
double totalSum = 0

Share : facebook icon twitter icon

Getting "This method or property cannot be called on Null values" error

By : bonzai yagami
Date : March 29 2020, 07:55 AM
I hope this helps you . This is because reader.GetString should not be called on DBNull values. Try changing your code as follows:
code :
client_group_details.Add(new ClientGroupDetails(
    reader.IsDbNull(Col2Index) ? null : reader.GetString(Col2Index),
    reader.IsDbNull(Col3Index) ? null : reader.GetString(Col3Index)));

Getter "Snapshot" called on null with StreamBuilder in Flutter

By : Daniel Z
Date : March 29 2020, 07:55 AM
may help you . You need to explicitly state all your data manipulation inside the else that has the build layout for your if (snapshot!=null) {//do something}
Something like this:
code :
else //event.data.snapshot.value != null
Map myMap = event.data.snapshot.value; //store each map
                        var titles = myMap.values;

                        List onesTitles = new List();
                        List onesIds = new List();
                        List onesImages = new List();
                        List onesRank = new List();

                        for (var items in titles) {

                        names = onesTitles;
                        ids = onesIds;
                        numbers = onesRank;
                        vidImages = onesImages;

//return my layout 

flutter.io "NoSuchMethodError: The getter 'isMacOS' was called on null."

By : Daniel F
Date : March 29 2020, 07:55 AM
it fixes the issue I've been wanting to play around with flutter.io for a while now and got around to installing it today. I was following the Getting Started page on the flutter website but I have run into the following error message when running "flutter doctor"...is there something I am doing wrong? Or a workaround to get around this? , try flutter upgrade and then flutter doctor

How to fix 'getter "documents" was called on null.' in flutter

By : Muhammad Aniq
Date : March 29 2020, 07:55 AM
Does that help You should check that the snapshot.data is not null before you call snapshot.data.documents. This is often the first thing I do in the build method of a stream builder. If the stream is empty, like it will be when it is first listened to but before firestore has returned the data being requested, the snapshot.data will be null. In that case you might want to show a container or a circular progress indicator:
code :
Widget getContent(BuildContext context) {
  return StreamBuilder<QuerySnapshot>(
    stream: Firestore.instance.collection("posts").snapshots(),
    builder: (context, snap) {

      //just add this line
      if(snap.data == null) return CircularProgressIndicator();

      return CarouselSlider(
        enlargeCenterPage: true,
        height: MediaQuery.of(context).size.height,
        items: getItems(context, snap.data.documents),

List<Widget> getItems(BuildContext context, List<DocumentSnapshot> 
  return docs.map(
    (doc) {
      String content = doc.data["content"];
      return Text(content);

getting error " getter 'year' was called on null " when clearing textfield in flutter

By : mrtmerlin
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The formatter in the onChanged can't format a null date. So you can add a null check in your DateTimeField's onChanged method.
Like this:
code :
onChanged: (date) {
           if (date != null){
            _isoDate = DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(date);
Privacy Policy - Terms - Contact Us © voile276.org