Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 对象列表对于期间为空,并且使用延迟数据进行充值_Flutter_Dart - Fatal编程技术网

Flutter 对象列表对于期间为空,并且使用延迟数据进行充值

Flutter 对象列表对于期间为空,并且使用延迟数据进行充值,flutter,dart,Flutter,Dart,我是Flatter的初学者,当我编写一个调用足球运动员api的应用程序,然后将他们放入名为SelectedPlayer的列表时,我遇到了一个问题。这是我的目标,在调用它们之后,它们必须显示在小部件中,如指示emptyPlayer函数 在这里我们可以看到,当这个屏幕打开时,SelectedPlayer列表仍然为空 以下是我尝试过的: class TeamDisplayView extends StatefulWidget { List<Playerr> selectedPl

我是Flatter的初学者,当我编写一个调用足球运动员api的应用程序,然后将他们放入名为SelectedPlayer的列表时,我遇到了一个问题。这是我的目标,在调用它们之后,它们必须显示在小部件中,如指示emptyPlayer函数

在这里我们可以看到,当这个屏幕打开时,SelectedPlayer列表仍然为空

以下是我尝试过的:

   class TeamDisplayView extends StatefulWidget {
  List<Playerr> selectedPlayers = [];

  TeamDisplayView({
    Key key,
    players,
    selectedPlayers,
  }): selectedPlayers = (selectedPlayers == null) ? new List<Playerr>.generate(16, (int index) => null) : selectedPlayers;

  @override
  _TeamDisplayViewState createState() => _TeamDisplayViewState();
}

class _TeamDisplayViewState extends State<TeamDisplayView> {
  getClubId() async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    int clubid = prefs.getInt("clubID");
    print(clubid);
    makePostRequest(clubid);
    setState(() {
      _isLoading = false;
    });
    print(_isLoading);
  }

  Future<void> makePostRequest(int clubid) async {
    // set up POST request arguments
    String url = '${ApiKey.url}/api/questions/getclub';
    Map<String, String> headers = {"Content-type": "application/json"};
    String json = '{"clubid": "' + clubid.toString() + '"}';

    Response response = await post(url, headers: headers, body: json);
    String res = response.body;
    Map parsed = jsonDecode(res);
    ClubEdit club = ClubEdit.fromJson(parsed);



    setState(() {
      clubName = club.data.name;
      budget = club.data.price.toDouble();
      points = club.data.points;
      fixture = club.data.fixture;
      for (var item in club.data.players) {
        widget.selectedPlayers.add(Playerr(
            item.id,
            item.firstname,
            item.lastname,
            item.position,
            "equipe",
            item.rating,
            item.appearences,
            item.goals,
            item.assists,
            item.cleansheets,
            item.redcards,
            item.yellowcards));
        print(item.id);
        print(item.firstname);
        print("selected");

      }

    });

    for (var item in widget.selectedPlayers) {
      print(item.position);
    }
    print("clubname" + clubName);
    print("budget" + budget.toString());
    print("points" + points.toString());
    print("fixture" + fixture.toString());
    print(_isLoading);
  }

  updateRequest(int userid, String email, int points, String fixtures,
      String password, String name, double price, List<Playerr> players) async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    email = prefs.getString("userEmail");
    password = prefs.getString("userPassword");

    setState(() {
      userid = prefs.getInt("userID");
    });

// set up POST request arguments
    final url = Uri.parse('${ApiKey.url}/api/questions/updateQuestion');
    Map<String, String> headers = {"Content-type": "application/json"};
    List<PlayerJson> pl = [];
    for (var item in players) {
      pl.add(PlayerJson(
          id: item.playerID,
          firstname: item.firstName.toString(),
          lastname: item.lastName.toString(),
          position: item.position.toString(),
          price: item.price,
          appearences: item.appearances,
          goals: item.goals,
          assists: item.assists,
          cleansheets: item.cleanSheets,
          redcards: item.redCards,
          yellowcards: item.yellowCards,
          image: item.image));
    }
    ClubJson club = ClubJson(
        userid: userid,
        email: email,
        password: password,
        name: name,
        price: price,
        players: pl);

    var json = jsonEncode(club.toJson());

    print(club.name);

    print(club.name);
    print(club.price);
    for (var item in club.players) {
      print(item.price);
    }

    // make POST request
    Response response = await post(url, headers: headers, body: json);
    // check the status code for the result
    int statusCode = response.statusCode;
    // this API passes back the id of the new item added to the body
    String body = response.body;
    print("response body" + response.body);

    // var res = jsonDecode(response.body);
    // if(res == "success"){
    //
    //Navigator.push(context, MaterialPageRoute(builder: (context)=>BodyFantasy(),),);
    return response;
  }

  int clubid;
  String clubName;
  bool _isLoading = true;
  double budget;
  int points;
  String fixture;
  String _teamName = "";
  Widget _saveChanges = Text("Press to save changes");
  int userid;
  String email;
  String password;

  @override
  void initState() {
    this.getClubId();
    for (Playerr player in widget.selectedPlayers) {
      if (player != null) {
        budget -= player.price;
      }
      // print(player.price.toString());
      // print(player.goals.toString());
    }
    print("clubname" + clubName.toString());
    print("budget" + budget.toString());
    print("points" + points.toString());
    print("fixture" + fixture.toString());
    print(_isLoading);
    super.initState();
  }

  emptyPlayer(int index) {

    Playerr player = widget.selectedPlayers[index];
    Widget playerView;

    if (player == null) {
      playerView = Image.asset(
        "Assets/shirt_blank.png",
        fit: BoxFit.fitHeight,
      );
    } else {
      playerView = Column(
        children: <Widget>[
          Expanded(
            child: Image.asset(
              player.image,
              fit: BoxFit.fitHeight,
            ),
          ),
          Container(
            color: Colors.black,
            child: Text(
              player.firstName.substring(0, 1) + ". " + player.lastName,
              textAlign: TextAlign.center,
              softWrap: false,
              overflow: TextOverflow.fade,
            ),
          ),
          Container(
            color: Colors.black,
            child: Text("£${player.price}m", textAlign: TextAlign.center),
          ),
        ],
      );
    }

    return Expanded(
      child: InkWell(
          onTap: () =>
              Navigator.pushReplacement(context,
                  MaterialPageRoute(builder: (BuildContext context) {
                    return PlayerUpdateView(
                      selectedPlayers: widget.selectedPlayers,
                      playerIndex: index,
                    );
                  })),
          child: Padding(
            padding: EdgeInsets.only(left: 3.0, right: 3.0),
            child: playerView,
          )),
    );

  }

  @override
  Widget build(BuildContext context) {
    return _isLoading == true
        ? Container(
            color: Colors.white,
            child: Center(
              child: CircularProgressIndicator(
                valueColor: AlwaysStoppedAnimation<Color>(
                  Color(0xFFe70066),
                ),
              ),
            ),
          )
        : WillPopScope(
            onWillPop: () async => false,
            child: Scaffold(
                appBar: AppBar(
                  title: Text("Your team"),
                ),
                body: Stack(
                  children: <Widget>[
                    Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: <Widget>[
                        Expanded(
                            child: Stack(children: <Widget>[
                          Positioned.fill(
                              child: Image.asset(
                            "Assets/pitch.jpg",
                            fit: BoxFit.fitWidth,
                            alignment: Alignment.topLeft,
                          ))
                        ])),
                      ],
                    ),
                    Column(
                      //players
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: <Widget>[
                        Expanded(flex: 1, child: Container()),
                        Expanded(
                            flex: 6,
                            child: Padding(
                              padding: EdgeInsets.only(left: 40.0, right: 40.0),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceAround,
                                children: List.generate(
                                    2, (index) => emptyPlayer(index)),
                              ),
                            )),
                        Expanded(flex: 1, child: Container()),
                        Expanded(
                            flex: 6,
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceAround,
                              children: List.generate(
                                  5, (index) => emptyPlayer(index + 2)),
                            )),
                        Expanded(flex: 1, child: Container()),
                        Expanded(
                            flex: 6,
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceAround,
                              children: List.generate(
                                  5, (index) => emptyPlayer(index + 7)),
                            )),
                        Expanded(flex: 1, child: Container()),
                        Expanded(
                            flex: 6,
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceAround,
                              children: List.generate(
                                  4, (index) => emptyPlayer(index + 12)),
                            )),
                        Expanded(flex: 1, child: Container()),
                        Container(
                          color: Styles.colorAccentDark,
                          padding: EdgeInsets.only(left: 8.0, right: 8.0),
                          child: Column(
                            children: <Widget>[
                              Padding(
                                padding: EdgeInsets.only(top: 4.0, bottom: 4.0),
                                child: Row(
                                  children: <Widget>[
                                    Expanded(
                                      child: Text(
                                        "Team Name",
                                        style: Styles.budgetLabel,
                                      ),
                                    ),
                                    Text(
                                      "${clubName}",
                                      style: Styles.budgetLabel,
                                    )
                                  ],
                                ),
                              ),
                              Padding(
                                padding: EdgeInsets.only(top: 4.0, bottom: 4.0),
                                child: Row(
                                  children: <Widget>[
                                    Expanded(
                                      child: Text(
                                        "Fixture",
                                        style: Styles.budgetLabel,
                                      ),
                                    ),
                                    Text(
                                      "${fixture}",
                                      style: Styles.budgetLabel,
                                    )
                                  ],
                                ),
                              ),
                              Padding(
                                padding: EdgeInsets.only(top: 4.0, bottom: 4.0),
                                child: Row(
                                  children: <Widget>[
                                    Expanded(
                                      child: Text(
                                        "Remaining Budget",
                                        style: Styles.budgetLabel,
                                      ),
                                    ),
                                    Text(
                                      "£${budget}m",
                                      style: Styles.budgetLabel,
                                    )
                                  ],
                                ),
                              ),
                              Padding(
                                padding: EdgeInsets.only(top: 4.0, bottom: 4.0),
                                child: Row(
                                  children: <Widget>[
                                    Expanded(
                                      child: Text(
                                        "Points",
                                        style: Styles.budgetLabel,
                                      ),
                                    ),
                                    Text(
                                      "${points}",
                                      style: Styles.budgetLabel,
                                    )
                                  ],
                                ),
                              ),

                              /* Padding(
                          padding: EdgeInsets.only(top: 4.0, bottom: 4.0),
                          child: Column(
                            children: <Widget>[
                              Expanded(
                                child: Text("Next Fixture", style: Styles.budgetLabel,),
                              ),
                              Text("yyy", style: Styles.budgetLabel,)
                            ],
                          ),
                        ),*/
                            ],
                          ),
                        ),
                        new MaterialButton(
                            height: 50.0,
                            minWidth: double.infinity,
                            color: Styles.colorButton,
                            splashColor: Colors.teal,
                            textColor: Colors.white,
                            child: _saveChanges,
                            onPressed: () {
                              if (widget.selectedPlayers.length == 16) {
                                updateRequest(
                                    userid,
                                    "dhya@hotmail.com",
                                    20,
                                    "22",
                                    "password",
                                    "name",
                                    25.0,
                                    widget.selectedPlayers);
                              }
                            }),
                      ],
                    ),
                  ],
                )));
  }
}
class TeamDisplayView扩展了StatefulWidget{
列出所选玩家=[];
TeamDisplayView({
关键点,
球员们,
精选球员,
}):selectedPlayers=(selectedPlayers==null)?新建列表。生成(16,(int索引)=>null):selectedPlayers;
@凌驾
_TeamDisplayViewState createState()=>\u TeamDisplayViewState();
}
类_TeamDisplayViewState扩展状态{
getClubId()异步{
SharedReferences prefs=等待SharedReferences.getInstance();
int clubid=prefs.getInt(“clubid”);
印刷品(clubid);
makePostRequest(clubid);
设置状态(){
_isLoading=false;
});
打印(卸载);
}
未来makePostRequest(int-clubid)异步{
//设置请求后参数
字符串url='${ApiKey.url}/api/questions/getclub';
映射头={“内容类型”:“应用程序/json”};
字符串json='{“clubid”:“'+clubid.toString()+'”}”;
Response-Response=wait-post(url,headers:headers,body:json);
String res=response.body;
Map parsed=jsonDecode(res);
ClubEdit club=ClubEdit.fromJson(已解析);
设置状态(){
clubName=club.data.name;
budget=club.data.price.toDouble();
积分=club.data.points;
fixture=club.data.fixture;
for(club.data.players中的var项){
widget.selectedPlayers.add(Playerr(
项目编号:,
item.firstname,
item.lastname,
项目.职位,
“装备”,
项目1.评级,
项目1.外观,
项目1.目标,
项目1.协助,
项目1.清洁表,
项目1.红色卡片,
项目:黄卡);;
打印(项目id);
打印(项目名称);
打印(“选定”);
}
});
for(widget.selectedPlayers中的变量项){
打印(项目位置);
}
打印(“clubname”+clubname);
打印(“budget”+budget.toString());
打印(“points”+points.toString());
打印(“fixture”+fixture.toString());
打印(卸载);
}
updateRequest(int userid、字符串电子邮件、int points、字符串fixture、,
字符串密码、字符串名称、双倍价格、列表播放器)异步{
SharedReferences prefs=等待SharedReferences.getInstance();
email=prefs.getString(“userEmail”);
password=prefs.getString(“userPassword”);
设置状态(){
userid=prefs.getInt(“userid”);
});
//设置请求后参数
final url=Uri.parse('${ApiKey.url}/api/questions/updateQuestion');
映射头={“内容类型”:“应用程序/json”};
列表pl=[];
for(玩家中的var项目){
pl.add(PlayerJson)(
id:item.playerID,
firstname:item.firstname.toString(),
lastname:item.lastname.toString(),
位置:item.position.toString(),
价格:item.price,
外观:项。外观,
目标:item.goals,
助攻:项目。助攻,
cleansheets:item.cleansheets,
redcards:item.redcards,
yellowcards:item.yellowcards,
图像:item.image);
}
ClubJson club=ClubJson(
userid:userid,
电邮:电邮,,
密码:密码,
姓名:姓名,,
价格:价格,
玩家:pl);
var json=jsonEncode(club.toJson());
打印(俱乐部名称);
打印(俱乐部名称);
打印(俱乐部价格);
用于(俱乐部球员中的var项目){
打印(项目价格);
}
//发帖
Response-Response=wait-post(url,headers:headers,body:json);
//检查结果的状态代码
int statusCode=response.statusCode;
//此API传回添加到主体的新项的id
字符串体=response.body;
打印(“响应正文”+响应正文);
//var res=jsonDecode(response.body);
//如果(res==“成功”){
//
//push(context,MaterialPageRoute(builder:(context)=>BodyFantasy(),);
返回响应;
}
国际俱乐部;
字符串clubName;
bool_isLoading=true;
双重预算;
积分;
线夹具;
字符串_teamName=“”;
小部件_saveChanges=文本(“按以保存更改”);
int用户标识;
字符串电子邮件;
字符串密码;
@凌驾
void initState(){
这个.getClubId();
for(小部件中的Playerr播放器。selectedPlayers){
如果(玩家!=null){
预算-=玩家价格;
}
//打印(player.price.toString());
//打印(player.goals.toString());
}
打印(“clubname”+clubname.toString());
打印(“budget”+budget.toString());
打印(“points”+points.toString());
打印(“fixture”+fixture.toString());
打印(卸载);
super.initState();
}
空层(整数索引){
Playerr player=widget.selectedPlayers[index];
小部件playerView;
if(player==null){
playerView=Image.asset(
“Assets/shirt_blank.png”,
适合度:BoxFit.fit高度,
);
}否则{
playerView=列(
儿童:[
扩大(
子:Image.asset(
player.image,
适合度:BoxFit.fit高度,
),
),
容器(
颜色:颜色,黑色,
子:文本(
player.firstName.substring(0,1)+“+player.lastName,
textAlign:textAlign.center,
软包装:错误,
溢出:TextOverflow.fade,
),
),
容器(
颜色:颜色,黑色,
子项:Text(£${player.price}m),textAlign:textAlign.center),
    I/zygote  ( 6982): Background concurrent copying GC freed 4231(210KB) AllocSpace objects, 24(1248KB) LOS objects, 55% free, 1211KB/2MB, paused 7.463ms total 20.500ms
    I/flutter ( 6982): clubnamenull
    I/flutter ( 6982): budgetnull
    I/flutter ( 6982): pointsnull
    I/flutter ( 6982): fixturenull
    I/flutter ( 6982): false
    
      I/flutter ( 6982): clubnamenull
I/flutter ( 6982): budgetnull
I/flutter ( 6982): pointsnull
I/flutter ( 6982): fixturenull
I/flutter ( 6982): true
D/EGL_emulation( 6982): eglMakeCurrent: 0xe9204780: ver 2 0 (tinfo 0xe9203c60)
I/flutter ( 6982): 1
I/flutter ( 6982): false
I/flutter ( 6982): 19827
I/flutter ( 6982): Joshua Jon
I/flutter ( 6982): selected
I/flutter ( 6982): 1438
I/flutter ( 6982): Bernd
I/flutter ( 6982): selected
I/flutter ( 6982): 657
I/flutter ( 6982): Kenny Joelle
I/flutter ( 6982): selected
I/flutter ( 6982): 18893
I/flutter ( 6982): Federico
I/flutter ( 6982): selected
I/flutter ( 6982): 629
I/flutter ( 6982): Kevin
I/flutter ( 6982): selected
I/flutter ( 6982): 49923
I/flutter ( 6982): Aboubakar
I/flutter ( 6982): selected
I/flutter ( 6982): 904
I/flutter ( 6982): Paul
I/flutter ( 6982): selected
I/flutter ( 6982): 18918
I/flutter ( 6982): Charlie
I/flutter ( 6982): selected
I/flutter ( 6982): 20619
I/flutter ( 6982): Illan
I/flutter ( 6982): selected
I/flutter ( 6982): 889
I/flutter ( 6982): Victor
I/flutter ( 6982): selected
I/flutter ( 6982): 2806
I/flutter ( 6982): Fabian Lukas
I/flutter ( 6982): selected
I/flutter ( 6982): 18945
I/flutter ( 6982): Stuart
I/flutter ( 6982): selected
I/flutter ( 6982): 1826
I/flutter ( 6982): Sébastien
I/flutter ( 6982): selected
I/flutter ( 6982): 12975
I/flutter ( 6982): Odion Jude
I/flutter ( 6982): selected
I/flutter ( 6982): 19027
I/flutter ( 6982): Neeskens
I/flutter ( 6982): selected
I/flutter ( 6982): 2678
I/flutter ( 6982): Diogo José
I/flutter ( 6982): selected
E/flutter ( 6982): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The getter 'position' was called on null.
E/flutter ( 6982): Receiver: null
E/flutter ( 6982): Tried calling: position
E/flutter ( 6982): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 6982): #1      _TeamDisplayViewState.makePostRequest (package:footyappp/Fantazyy/team_display_view.dart:83:18)
E/flutter ( 6982): <asynchronous suspension>
E/flutter ( 6982): #2      _TeamDisplayViewState.getClubId (package:footyappp/Fantazyy/team_display_view.dart:35:5)
E/flutter ( 6982): <asynchronous suspension>
E/flutter ( 6982): #3      _TeamDisplayViewState.initState (package:footyappp/Fantazyy/team_display_view.dart:168:10)
E/flutter ( 6982): #4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58)
E/flutter ( 6982): #5      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter ( 6982): #6      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #7      Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #8      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter ( 6982): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter ( 6982): #12     Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter ( 6982): #13     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter ( 6982): #14     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter ( 6982): #15     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #17     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter ( 6982): #18     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #19     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #20     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter ( 6982): #21     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter ( 6982): #24     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4800:11)
E/flutter ( 6982): #25     Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter ( 6982): #26     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter ( 6982): #27     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4791:11)
E/flutter ( 6982): #28     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter ( 6982): #29     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #31     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter ( 6982): #32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #33     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #34     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter ( 6982): #35     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #36     Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter ( 6982): #37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter ( 6982): #38     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4800:11)
E/flutter ( 6982): #39     Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter ( 6982): #40     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter ( 6982): #41     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4791:11)
E/flutter ( 6982): #42     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter ( 6982): #43     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter ( 6982): #44     Element.updateChild (