From 4ca3d38b9c8ecec40bdcb86960b0b1204e75bf88 Mon Sep 17 00:00:00 2001 From: SethCohen Date: Mon, 3 Apr 2023 04:19:00 -0400 Subject: [PATCH] fic(dictionary): fixed dictionary not being scrollable style(dictionary): fixed loading indicator size --- .../features/dictionary/dictionary_page.dart | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/lib/features/dictionary/dictionary_page.dart b/src/lib/features/dictionary/dictionary_page.dart index 9b78482..065eb16 100644 --- a/src/lib/features/dictionary/dictionary_page.dart +++ b/src/lib/features/dictionary/dictionary_page.dart @@ -32,33 +32,35 @@ class _DictionaryPageState extends State { query: flashcardsQuery, builder: (context, snapshot, _) { if (snapshot.isFetching) { - return const CircularProgressIndicator(); + return const Center(child: CircularProgressIndicator()); } if (snapshot.hasError) { debugPrint('error ${snapshot.error}'); return Text('error ${snapshot.error}'); } - return Wrap( - spacing: 8, - runSpacing: 8, - children: List.generate( - snapshot.docs.length, - (index) { - if (snapshot.hasMore && index + 1 == snapshot.docs.length) { - snapshot.fetchMore(); - } + return SingleChildScrollView( + child: Wrap( + spacing: 8, + runSpacing: 8, + children: List.generate( + snapshot.docs.length, + (index) { + if (snapshot.hasMore && index + 1 == snapshot.docs.length) { + snapshot.fetchMore(); + } - return ConstrainedBox( - constraints: BoxConstraints( - maxWidth: screenWidth * 0.2, - ), - child: Flashcard( - card: snapshot.docs[index].data(), - type: CardType.dictionary, - ), - ); - }, + return ConstrainedBox( + constraints: BoxConstraints( + maxWidth: screenWidth * 0.2, + ), + child: Flashcard( + card: snapshot.docs[index].data(), + type: CardType.dictionary, + ), + ); + }, + ), ), ); },