Skip to content

Commit

Permalink
fic(dictionary): fixed dictionary not being scrollable
Browse files Browse the repository at this point in the history
style(dictionary): fixed loading indicator size
  • Loading branch information
SethCohen committed Apr 3, 2023
1 parent c7281cf commit 4ca3d38
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/lib/features/dictionary/dictionary_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,35 @@ class _DictionaryPageState extends State<DictionaryPage> {
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,
),
);
},
),
),
);
},
Expand Down

0 comments on commit 4ca3d38

Please sign in to comment.