LoginSignup
1
1

More than 3 years have passed since last update.

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

Last updated at Posted at 2020-12-26

前回

参考文献

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()
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1