mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-17 04:35:26 +00:00
Show snack when encountering a server error
This commit is contained in:
@ -3,10 +3,13 @@ import 'dart:async';
|
||||
import 'package:inventree/api.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:inventree/inventree/sentry.dart';
|
||||
import 'package:inventree/widget/dialogs.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import '../l10.dart';
|
||||
|
||||
|
||||
// Paginated response object
|
||||
class InvenTreePageResponse {
|
||||
@ -162,6 +165,11 @@ class InvenTreeModel {
|
||||
}
|
||||
);
|
||||
|
||||
showServerError(
|
||||
L10().serverError,
|
||||
L10().errorFetch,
|
||||
);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -226,6 +234,11 @@ class InvenTreeModel {
|
||||
}
|
||||
);
|
||||
|
||||
showServerError(
|
||||
L10().serverError,
|
||||
L10().errorFetch,
|
||||
);
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
@ -260,6 +273,12 @@ class InvenTreeModel {
|
||||
}
|
||||
);
|
||||
|
||||
showServerError(
|
||||
L10().serverError,
|
||||
L10().errorCreate,
|
||||
);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user