0
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

Organization

【Flutter】遭遇したエラー&&解決策まとめ②

前回

参考文献

ListViewの入れ子によるエラー

◆ エラー内容

The following assertion was thrown during performResize():
Vertical viewport was given unbounded height.

◆ 解決策

main.dart
ListView(
  shrinkWrap: true,   //追加
  physics: NeverScrollableScrollPhysics(),  //追加
  children: _sample,           
)

ビューポート(表示領域)が狭いエラー

◆ エラー内容

A RenderFlex overflowed by 92 pixels on the bottom.

◆ 解決策

main.dart
Widget build(BuildContext context) {
    return SingleChildScrollView(   //追加
      child: Column(
        ),
    );
}

Firebase.initializeApp()完了後に、runAppする方法

◆ 解決策

main.dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();   //追加
  await Firebase.initializeApp();
  runApp(MyApp());
}

FirestoreでorderByする方法

◆ 解決策

main.dart
void getList() {
    Firestore.instance
        .collection("sample")
        .where("active", isEqualTo: "running")  
        .orderBy("createdAt", descending: true)  //orderBy
        .snapshots()
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?