mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-16 06:36:44 +02:00
Added toast package for errors
This commit is contained in:
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:obtainium/services/apk_service.dart';
|
import 'package:obtainium/services/apk_service.dart';
|
||||||
import 'package:obtainium/services/source_service.dart';
|
import 'package:obtainium/services/source_service.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:toast/toast.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@ -64,6 +65,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
ToastContext().init(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(widget.title),
|
title: Text(widget.title),
|
||||||
@ -88,7 +90,10 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
ind = ind == (urls.length - 1) ? 0 : ind + 1;
|
ind = ind == (urls.length - 1) ? 0 : ind + 1;
|
||||||
});
|
});
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
print(err);
|
if (err is! String) {
|
||||||
|
err = "Unknown Error";
|
||||||
|
}
|
||||||
|
Toast.show(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
tooltip: 'Increment',
|
tooltip: 'Increment',
|
||||||
|
19
pubspec.lock
19
pubspec.lock
@ -130,6 +130,11 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
http:
|
http:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -144,6 +149,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.1"
|
version: "4.0.1"
|
||||||
|
js:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: js
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.4"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -324,6 +336,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.0"
|
version: "0.8.0"
|
||||||
|
toast:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: toast
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.0"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -42,6 +42,7 @@ dependencies:
|
|||||||
flutter_local_notifications: ^9.7.0
|
flutter_local_notifications: ^9.7.0
|
||||||
provider: ^6.0.3
|
provider: ^6.0.3
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
|
toast: ^0.3.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Reference in New Issue
Block a user