Change toast
This commit is contained in:
@@ -4,9 +4,6 @@ PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_native_splash (0.0.1):
|
||||
- Flutter
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- GoogleDataTransport (9.2.5):
|
||||
- GoogleUtilities/Environment (~> 7.7)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
@@ -98,7 +95,6 @@ PODS:
|
||||
- sqlite3/fts5
|
||||
- sqlite3/perf-threadsafe
|
||||
- sqlite3/rtree
|
||||
- Toast (4.0.0)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
|
||||
@@ -106,7 +102,6 @@ DEPENDENCIES:
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
@@ -134,7 +129,6 @@ SPEC REPOS:
|
||||
- Sentry
|
||||
- SentryPrivate
|
||||
- sqlite3
|
||||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
device_info_plus:
|
||||
@@ -143,8 +137,6 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter
|
||||
flutter_native_splash:
|
||||
:path: ".symlinks/plugins/flutter_native_splash/ios"
|
||||
fluttertoast:
|
||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||
mobile_scanner:
|
||||
:path: ".symlinks/plugins/mobile_scanner/ios"
|
||||
package_info_plus:
|
||||
@@ -168,7 +160,6 @@ SPEC CHECKSUMS:
|
||||
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
||||
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
|
||||
GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
|
||||
GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34
|
||||
@@ -192,7 +183,6 @@ SPEC CHECKSUMS:
|
||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||
sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273
|
||||
sqlite3_flutter_libs: eb769059df0356dc52ddda040f09cacc9391a7cf
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86
|
||||
|
||||
PODFILE CHECKSUM: dc959e9c395cfc0ed667b3f83251a823e01b945a
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// import 'package:accessibility_tools/accessibility_tools.dart';
|
||||
import 'package:accessibility_tools/accessibility_tools.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:hiddify/core/core_providers.dart';
|
||||
@@ -11,6 +12,8 @@ import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
|
||||
bool _debugAccessibility = false;
|
||||
|
||||
class AppView extends HookConsumerWidget with PresLogger {
|
||||
const AppView({super.key});
|
||||
|
||||
@@ -25,13 +28,6 @@ class AppView extends HookConsumerWidget with PresLogger {
|
||||
final upgrader = ref.watch(upgraderProvider);
|
||||
|
||||
return MaterialApp.router(
|
||||
// builder: (context, child) {
|
||||
// return AccessibilityTools(
|
||||
// checkFontOverflows: true,
|
||||
// child: child,
|
||||
// );
|
||||
// },
|
||||
// showSemanticsDebugger: true,
|
||||
routerConfig: router,
|
||||
locale: locale,
|
||||
supportedLocales: AppLocaleUtils.supportedLocales,
|
||||
@@ -41,20 +37,20 @@ class AppView extends HookConsumerWidget with PresLogger {
|
||||
theme: theme.light(),
|
||||
darkTheme: theme.dark(),
|
||||
title: Constants.appName,
|
||||
// https://github.com/ponnamkarthik/FlutterToast/issues/393
|
||||
builder: (context, child) => Overlay(
|
||||
initialEntries: [
|
||||
if (child != null) ...[
|
||||
OverlayEntry(
|
||||
builder: (context) => UpgradeAlert(
|
||||
builder: (context, child) {
|
||||
child = UpgradeAlert(
|
||||
upgrader: upgrader,
|
||||
navigatorKey: router.routerDelegate.navigatorKey,
|
||||
child: child ?? const SizedBox(),
|
||||
);
|
||||
if (kDebugMode && _debugAccessibility) {
|
||||
return AccessibilityTools(
|
||||
checkFontOverflows: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return child;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:toastification/toastification.dart';
|
||||
|
||||
class CustomAlertDialog extends StatelessWidget {
|
||||
const CustomAlertDialog({
|
||||
@@ -49,7 +49,17 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
enum AlertType { info, error, success }
|
||||
enum AlertType {
|
||||
info,
|
||||
error,
|
||||
success;
|
||||
|
||||
ToastificationType get _toastificationType => switch (this) {
|
||||
success => ToastificationType.success,
|
||||
error => ToastificationType.error,
|
||||
info => ToastificationType.info,
|
||||
};
|
||||
}
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
const CustomToast(
|
||||
@@ -105,11 +115,18 @@ class CustomToast extends StatelessWidget {
|
||||
}
|
||||
|
||||
void show(BuildContext context) {
|
||||
final fToast = FToast().init(context);
|
||||
fToast.showToast(
|
||||
child: this,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
toastDuration: duration,
|
||||
toastification.show(
|
||||
context: context,
|
||||
title: message,
|
||||
type: type._toastificationType,
|
||||
alignment: Alignment.bottomLeft,
|
||||
autoCloseDuration: duration,
|
||||
style: ToastificationStyle.fillColored,
|
||||
pauseOnHover: true,
|
||||
showProgressBar: false,
|
||||
dragToClose: true,
|
||||
closeOnClick: true,
|
||||
closeButtonShowType: CloseButtonShowType.onHover,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
40
pubspec.lock
40
pubspec.lock
@@ -353,6 +353,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.13.1"
|
||||
equatable:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: equatable
|
||||
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -509,14 +517,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
fluttertoast:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: fluttertoast
|
||||
sha256: "69a5c4fcfe9a163bc927ff386c0dedd62575913bba942d0ce80c1fd092885255"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.2.3"
|
||||
fpdart:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -661,6 +661,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
iconsax_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: iconsax_flutter
|
||||
sha256: "95b65699da8ea98f87c5d232f06b0debaaf1ec1332b697e4d90969ec9a93037d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -909,6 +917,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
pausable_timer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pausable_timer
|
||||
sha256: "35b1f77eb2fb0f42e823360321fbed9b9a8b1c7043a07a58aeda17d01f84659a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0+1"
|
||||
percent_indicator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -1394,6 +1410,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
toastification:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: toastification
|
||||
sha256: "14e7f9178db0393df00509cd921de3d3db310d06c7c122e873f31d3c8d18cf4e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
tray_manager:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -62,11 +62,11 @@ dependencies:
|
||||
flutter_svg: ^2.0.9
|
||||
gap: ^3.0.1
|
||||
percent_indicator: ^4.2.3
|
||||
fluttertoast: ^8.2.3
|
||||
sliver_tools: ^0.2.12
|
||||
flutter_adaptive_scaffold: ^0.1.7+1
|
||||
humanizer: ^2.2.0
|
||||
upgrader: ^8.2.0
|
||||
toastification: ^1.1.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user