forked from eatvio/eatvio_app
26 lines
659 B
Dart
26 lines
659 B
Dart
import 'package:eatvio_app/main.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ServerException implements Exception {}
|
|
|
|
class CacheException implements Exception {}
|
|
|
|
class NetworkException implements Exception {}
|
|
|
|
///can be used for throwing [NoInternetException]
|
|
class NoInternetException implements Exception {
|
|
late String _message;
|
|
|
|
NoInternetException([String message = 'NoInternetException Occurred']) {
|
|
if (globalMessengerKey.currentState != null) {
|
|
globalMessengerKey.currentState!.showSnackBar(SnackBar(content: Text(message)));
|
|
}
|
|
this._message = message;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return _message;
|
|
}
|
|
}
|