HomePage: Call super.initiate() first

This commit is contained in:
Neeraj Gupta 2023-08-01 12:50:24 +05:30
parent 010c32ecf7
commit 39d415bab6

View file

@ -54,6 +54,7 @@ class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
_textController.addListener(_applyFilteringAndRefresh);
_loadCodes();
_streamSubscription = Bus.instance.on<CodesUpdatedEvent>().listen((event) {
@ -64,7 +65,7 @@ class _HomePageState extends State<HomePage> {
await autoLogoutAlert(context);
});
_initDeepLinks();
super.initState();
}
void _loadCodes() {
@ -222,7 +223,11 @@ class _HomePageState extends State<HomePage> {
} else {
final list = ListView.builder(
itemBuilder: ((context, index) {
return CodeWidget(_filteredCodes[index]);
try {
return CodeWidget(_filteredCodes[index]);
} catch(e) {
return const Text("Failed");
}
}),
itemCount: _filteredCodes.length,
);