Frontend first draft
This commit is contained in:
12
frontend/pweb/lib/utils/snapshot_haserror_check.dart
Normal file
12
frontend/pweb/lib/utils/snapshot_haserror_check.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
|
||||
bool hasError(AsyncSnapshot snapshot, String source) {
|
||||
if (snapshot.hasError) {
|
||||
Logger(source).warning('Error occurred', snapshot.error?.toString(), StackTrace.current);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user