How to mock the FirebaseApp in flutter

后端 未结 3 702
难免孤独
难免孤独 2021-01-22 09:32

I am trying to test a method that uses FirebaseFirestore but I am not able to mock the FirebaseFirestore.instance property.

I am following these examples:

  1. In
3条回答
  •  抹茶落季
    2021-01-22 09:54

    think that is for use FutureBuilder as first Widget o root widget of the tree, flutter needs always a MaterialApp or others(dont remmember right now).

    Recomendation, refactor FutureBuilder -> Wrap whit widget -> MaterialApp(home:FutureBuilder(...

    and check MyWidget() first widget, maybe same MaterialApp get error, but not sure.

    if you are using routes method to navigate use initialRoute.

    Luck!

提交回复
热议问题