From 4e60f528cb6019dcdfc161c00dc9a51d0b0308ca Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 4 Dec 2021 05:31:27 +0100 Subject: [PATCH] Update history loading screen --- lib/view/screens/history.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/view/screens/history.dart b/lib/view/screens/history.dart index 9c52df6..f413512 100644 --- a/lib/view/screens/history.dart +++ b/lib/view/screens/history.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; +import 'package:jisho_study_tool/view/components/common/loading.dart'; import 'package:sembast/sembast.dart'; import '../../models/history/search.dart'; @@ -37,11 +38,14 @@ class HistoryView extends StatelessWidget { return StreamBuilder>( stream: searchStream, builder: (context, snapshot) { - if (!snapshot.hasData) + if (!snapshot.hasData) return const LoadingScreen(); + + final List data = snapshot.data!; + if (data.isEmpty) return const Center( child: Text('The history is empty.\nTry searching for something!'), ); - final List data = snapshot.data!; + return OpaqueBox( child: ListView.separated( itemCount: data.length + 1,