I am having an issue getting data from the firebase realtime database in the tab bar view. Data showing in Tabbar view from real-time database flutter .. but last tab data same showing in all tabs. All the tab bar views data are different but it is showing data of one tab in all tabs. I think it overwrites previous data with data we got at last tab.

Screen Shot1 Screen Shot 2

loadsubcategories()  {
    ref = FirebaseDatabase.instance;
    ref.reference().child('Categories').child(id).child("Subcategories")
      //   .onValue
      //   .listen((event) {
      // var snapshot = event.snapshot;
        .once()
        .then((DataSnapshot snapshot){
      if(snapshot.value != null){
        var keys = snapshot.value.keys;
        var value = snapshot.value;
        //listtab = new List();
        listtab.clear();
        for (var key in keys) {
          print(key);
          TabNews data = TabNews(
            value[key]['subcategory'],
            0,
            value[key]['id'],
          );
          listtab.add(data);
        }
      } else {
        print("chal Chutti kr");
      }
      // setState(() {
      //
      // });
      setState(() {
        // _controller = TabController( length: listtab.length, initialIndex: 0);
        // _controller.addListener(_handleTabSelection);
      });
    }
    );
  }

tabbarviewdata(String  subcategoryid) {
    print("fajasl"+id);
    cardref = FirebaseDatabase.instance;
    cardref.reference().child('Categories').child(id).child("Subcategories").child(subcategoryid).child("Personalities")
      //   .onValue
      //   .listen((event) {
      // var snapshot = event.snapshot;
        .once()
        .then((DataSnapshot snapshot){
          if(snapshot.value != null){
            var keys = snapshot.value.keys;
            var value = snapshot.value;
           // cardlist= new List();
            cardlist.clear();
            for (var key in keys) {
              //  print(key);
              CardList data = CardList(
                value[key]['image'],
                value[key]['name'],
                value[key]['designation'],
                value[key]['subscribeCount'],
                "",
                false,
                value[key]['id'],
              );
              cardlist.add(data);
              // print(data.designation);
            }
          }
          else {
            print("No Data");
          }

    }
    );
        return
             ListView.builder(
                itemCount: 1,
                itemBuilder: (context, i) {
                  return Column(
                    children: [
                      for (int i = 0; i < cardlist.length; i++)
                        Padding(
                          padding: EdgeInsets.only(
                              left: MediaQuery.of(context).size.width / 70,
                              right: MediaQuery.of(context).size.width / 30),
                          child: GestureDetector(
                            onTap: () {
                              dialogDisplay(context, i);
                              // displaysnaplist(context, i);
                            },
                            child: Container(
                              child: Card(
                                shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(20.0),
                                ),
                                elevation: 0,
                                child: Row(
                                  //mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  // crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Padding(
                                      padding: EdgeInsets.only(
                                        top: ScreenUtil().setHeight(40),
                                        left: ScreenUtil().setHeight(40),
                                        bottom: ScreenUtil().setHeight(40),
                                      ),
                                      child: Container(
                                        height: ScreenUtil().setHeight(250),
                                        width: ScreenUtil().setHeight(250),
                                        child: Text(""),
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(10),
                                          image: DecorationImage(
                                            // scale: 20,
                                            image: NetworkImage(
                                              cardlist[i].image,
                                            ),
                                            fit: BoxFit.cover,
                                            //   fit: BoxFit.fitWidth
                                          ),
                                        ),
                                      ),
                                    ),
                                    SizedBox(
                                      width: ScreenUtil().setWidth(50),
                                    ),
                                    Expanded(
                                      child: Padding(
                                        padding: EdgeInsets.only(
                                            top: MediaQuery
                                                .of(context)
                                                .size
                                                .height /
                                                28),
                                        child: Column(
                                          crossAxisAlignment: CrossAxisAlignment.start,
                                          children: [
                                            Text(
                                              cardlist[i].name,
                                              style: TextStyle(
                                                decoration: TextDecoration.none,
                                                fontFamily: 'roboto',
                                                fontWeight: FontWeight.w600,
                                                color: Colors.black,
                                              ),
                                            ),
                                            SizedBox(
                                              height:
                                              MediaQuery
                                                  .of(context)
                                                  .size
                                                  .height /
                                                  120,
                                            ),
                                            Text(
                                              cardlist[i].designation,
                                              style: TextStyle(
                                                decoration: TextDecoration.none,
                                                fontFamily: 'roboto',
                                                fontSize: 10,
                                                color: Colors.blue,
                                              ),
                                            ),
                                            SizedBox(
                                              height:
                                              MediaQuery
                                                  .of(context)
                                                  .size
                                                  .height /
                                                  120,
                                            ),
                                            Row(
                                              children: [
                                                Text(
                                                  cardlist[i].subscribeCount.toString(),
                                                  style: TextStyle(
                                                    decoration: TextDecoration.none,
                                                    fontFamily: 'roboto',
                                                    color: Colors.grey[700],
                                                    fontSize: 10,
                                                  ),
                                                ),
                                                SizedBox(
                                                  width: MediaQuery
                                                      .of(context)
                                                      .size
                                                      .width /
                                                      100,
                                                ),
                                                Text(
                                                  'Subscribed',
                                                  style: TextStyle(
                                                      decoration: TextDecoration.none,
                                                      fontFamily: 'roboto',
                                                      color: Colors.grey[700],
                                                      fontSize: 10),
                                                ),
                                              ],
                                            ),
                                          ],
                                        ),
                                      ),
                                    ),
                                    Padding(
                                      padding: EdgeInsets.only(
                                        top: ScreenUtil().setHeight(120),
                                        right: ScreenUtil().setHeight(50),
                                      ),
                                      child: Column(
                                        children: [
                                          Visibility(
                                            visible: cardlist[i].show ?? true,
                                            child: RaisedButton(
                                                elevation: 0,
                                                // minWidth: 100,
                                                shape: RoundedRectangleBorder(
                                                  borderRadius: BorderRadius.circular(
                                                      10.0),
                                                ),
                                                color: Color(0xffF8D4D3),
                                                child: Text(
                                                  cardlist[i].newstype,
                                                  style: TextStyle(
                                                      color: Color(0xffB53B38),
                                                      fontSize: 10),
                                                ),
                                                onPressed: () {
                                                  dialogDisplay(context, i);
                                                }),
                                          ),
                                        ],
                                      ),
                                    )
                                  ],
                                ),
                              ),
                            ),
                          ),
                        ),
                    ],
                  );
                });
        //   }
        // );

  }