diff --git a/.flutter-plugins b/.flutter-plugins
index 1417b7b..b0a2f29 100644
--- a/.flutter-plugins
+++ b/.flutter-plugins
@@ -9,12 +9,6 @@ path_provider_android=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_and
path_provider_foundation=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/
path_provider_linux=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
-shared_preferences=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences-2.2.3/
-shared_preferences_android=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.2/
-shared_preferences_foundation=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/
-shared_preferences_linux=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/
-shared_preferences_web=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/
-shared_preferences_windows=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/
url_launcher=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher-6.2.6/
url_launcher_android=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/
url_launcher_ios=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/
diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies
index c024959..f8aae7f 100644
--- a/.flutter-plugins-dependencies
+++ b/.flutter-plugins-dependencies
@@ -1 +1 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.2/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.3.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-01 18:49:00.636912","version":"3.19.5"}
\ No newline at end of file
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-01 20:58:48.397737","version":"3.19.5"}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4ecb89..52bf210 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## [1.1.0] - 2024-05-01
+
+* Remove `nylo` dependency.
+* Add `flutter_secure_storage` dependency.
+* Update debug and release widget.
+
## [1.0.0] - 2024-05-01
* Initial release.
diff --git a/README.md b/README.md
index 02478bf..62dbfbb 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
## Usage
-
+
### Simple to use
diff --git a/example/.flutter-plugins b/example/.flutter-plugins
index 50d66d6..059731c 100644
--- a/example/.flutter-plugins
+++ b/example/.flutter-plugins
@@ -1,20 +1,14 @@
# This is a generated file; do not edit or check into version control.
flutter_secure_storage=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/
-flutter_secure_storage_linux=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.1.3/
-flutter_secure_storage_macos=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.0/
-flutter_secure_storage_web=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.1/
+flutter_secure_storage_linux=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/
+flutter_secure_storage_macos=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/
+flutter_secure_storage_web=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/
flutter_secure_storage_windows=/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/
path_provider=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider-2.0.15/
path_provider_android=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/
path_provider_foundation=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/
path_provider_linux=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.7/
path_provider_windows=/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/
-shared_preferences=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences-2.2.1/
-shared_preferences_android=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/
-shared_preferences_foundation=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/
-shared_preferences_linux=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.1/
-shared_preferences_web=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.1/
-shared_preferences_windows=/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.1/
url_launcher=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher-6.2.6/
url_launcher_android=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.2/
url_launcher_ios=/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/
diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies
index d889ff3..7df417e 100644
--- a/example/.flutter-plugins-dependencies
+++ b/example/.flutter-plugins-dependencies
@@ -1 +1 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.1.3/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.1/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.1/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.1/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-01 18:49:00.721833","version":"3.19.5"}
\ No newline at end of file
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-05-01 20:58:48.447432","version":"3.19.5"}
\ No newline at end of file
diff --git a/example/main.dart b/example/main.dart
index 683aa69..bbdcf48 100644
--- a/example/main.dart
+++ b/example/main.dart
@@ -2,6 +2,7 @@ import 'package:error_stack/error_stack.dart';
import 'package:flutter/material.dart';
void main() {
+ WidgetsFlutterBinding.ensureInitialized();
ErrorStack.init();
runApp(MyApp());
}
diff --git a/example/pubspec.lock b/example/pubspec.lock
index de0a5c4..19848d5 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -1,14 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
- animate_do:
- dependency: transitive
- description:
- name: animate_do
- sha256: "7a3162729f0ea042f9dd84da217c5bde5472ad9cef644079929d4304a5dc4ca0"
- url: "https://pub.dev"
- source: hosted
- version: "3.3.4"
async:
dependency: transitive
description:
@@ -49,22 +41,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.18.0"
- dio:
- dependency: transitive
- description:
- name: dio
- sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5"
- url: "https://pub.dev"
- source: hosted
- version: "5.4.3+1"
- equatable:
- dependency: transitive
- description:
- name: equatable
- sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
- url: "https://pub.dev"
- source: hosted
- version: "2.0.5"
error_stack:
dependency: "direct dev"
description:
@@ -101,19 +77,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- flutter_dotenv:
- dependency: transitive
- description:
- name: flutter_dotenv
- sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77"
- url: "https://pub.dev"
- source: hosted
- version: "5.1.0"
- flutter_localizations:
- dependency: transitive
- description: flutter
- source: sdk
- version: "0.0.0"
flutter_secure_storage:
dependency: transitive
description:
@@ -126,34 +89,34 @@ packages:
dependency: transitive
description:
name: flutter_secure_storage_linux
- sha256: "0912ae29a572230ad52d8a4697e5518d7f0f429052fd51df7e5a7952c7efe2a3"
+ sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e"
url: "https://pub.dev"
source: hosted
- version: "1.1.3"
+ version: "1.2.0"
flutter_secure_storage_macos:
dependency: transitive
description:
name: flutter_secure_storage_macos
- sha256: "083add01847fc1c80a07a08e1ed6927e9acd9618a35e330239d4422cd2a58c50"
+ sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c
url: "https://pub.dev"
source: hosted
- version: "3.0.0"
+ version: "3.0.1"
flutter_secure_storage_platform_interface:
dependency: transitive
description:
name: flutter_secure_storage_platform_interface
- sha256: b3773190e385a3c8a382007893d678ae95462b3c2279e987b55d140d3b0cb81b
+ sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e"
url: "https://pub.dev"
source: hosted
- version: "1.0.1"
+ version: "1.0.2"
flutter_secure_storage_web:
dependency: transitive
description:
name: flutter_secure_storage_web
- sha256: "42938e70d4b872e856e678c423cc0e9065d7d294f45bc41fc1981a4eb4beaffe"
+ sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20"
url: "https://pub.dev"
source: hosted
- version: "1.1.1"
+ version: "1.1.2"
flutter_secure_storage_windows:
dependency: transitive
description:
@@ -162,22 +125,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
- flutter_staggered_grid_view:
- dependency: transitive
- description:
- name: flutter_staggered_grid_view
- sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395"
- url: "https://pub.dev"
- source: hosted
- version: "0.7.0"
- flutter_styled_toast:
- dependency: transitive
- description:
- name: flutter_styled_toast
- sha256: e667f13a665820eb0fa8506547e47eacbcddf1948d6d3036cfd3b089bd4b0516
- url: "https://pub.dev"
- source: hosted
- version: "2.2.1"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -188,30 +135,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- get_time_ago:
- dependency: transitive
- description:
- name: get_time_ago
- sha256: "982d1b82c7b2cbb8f443cee5db9508e6c8efb7f7be5b659f17d3575c340d09d3"
- url: "https://pub.dev"
- source: hosted
- version: "1.3.1"
- http_parser:
- dependency: transitive
- description:
- name: http_parser
- sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
- url: "https://pub.dev"
- source: hosted
- version: "4.0.2"
- intl:
- dependency: transitive
- description:
- name: intl
- sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
- url: "https://pub.dev"
- source: hosted
- version: "0.18.1"
js:
dependency: transitive
description:
@@ -268,22 +191,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.11.0"
- nylo_support:
- dependency: transitive
- description:
- name: nylo_support
- sha256: c3f371843fa15ff7c2cc44c5c3464bbad62506231d40290ae72690a57bada1ed
- url: "https://pub.dev"
- source: hosted
- version: "5.67.1"
- page_transition:
- dependency: transitive
- description:
- name: page_transition
- sha256: dee976b1f23de9bbef5cd512fe567e9f6278caee11f5eaca9a2115c19dc49ef6
- url: "https://pub.dev"
- source: hosted
- version: "2.1.0"
path:
dependency: transitive
description:
@@ -356,14 +263,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.3"
- pretty_dio_logger:
- dependency: transitive
- description:
- name: pretty_dio_logger
- sha256: "00b80053063935cf9a6190da344c5373b9d0e92da4c944c878ff2fbef0ef6dc2"
- url: "https://pub.dev"
- source: hosted
- version: "1.3.1"
process:
dependency: transitive
description:
@@ -372,94 +271,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.2.4"
- pull_to_refresh_flutter3:
- dependency: transitive
- description:
- name: pull_to_refresh_flutter3
- sha256: "37a88d901cca9a46dbdd46523de8e7b35a3e58634a0e775b1a5904981f69b353"
- url: "https://pub.dev"
- source: hosted
- version: "2.0.2"
- recase:
- dependency: transitive
- description:
- name: recase
- sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213
- url: "https://pub.dev"
- source: hosted
- version: "4.1.0"
- rxdart:
- dependency: transitive
- description:
- name: rxdart
- sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
- url: "https://pub.dev"
- source: hosted
- version: "0.27.7"
- shared_preferences:
- dependency: transitive
- description:
- name: shared_preferences
- sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac
- url: "https://pub.dev"
- source: hosted
- version: "2.2.1"
- shared_preferences_android:
- dependency: transitive
- description:
- name: shared_preferences_android
- sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
- url: "https://pub.dev"
- source: hosted
- version: "2.2.1"
- shared_preferences_foundation:
- dependency: transitive
- description:
- name: shared_preferences_foundation
- sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7"
- url: "https://pub.dev"
- source: hosted
- version: "2.3.4"
- shared_preferences_linux:
- dependency: transitive
- description:
- name: shared_preferences_linux
- sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a
- url: "https://pub.dev"
- source: hosted
- version: "2.3.1"
- shared_preferences_platform_interface:
- dependency: transitive
- description:
- name: shared_preferences_platform_interface
- sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a
- url: "https://pub.dev"
- source: hosted
- version: "2.3.1"
- shared_preferences_web:
- dependency: transitive
- description:
- name: shared_preferences_web
- sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
- url: "https://pub.dev"
- source: hosted
- version: "2.2.1"
- shared_preferences_windows:
- dependency: transitive
- description:
- name: shared_preferences_windows
- sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f
- url: "https://pub.dev"
- source: hosted
- version: "2.3.1"
- skeletonizer:
- dependency: transitive
- description:
- name: skeletonizer
- sha256: "50c3fdf3d1bf6182129c03b53bc7ff6dca10ca0b8e71ccdee148b9322caabdba"
- url: "https://pub.dev"
- source: hosted
- version: "1.1.2+1"
sky_engine:
dependency: transitive
description: flutter
@@ -513,22 +324,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.1"
- theme_provider:
- dependency: transitive
- description:
- name: theme_provider
- sha256: "6a2839ee1bd539ceb789f25ea9696fe90f9dfad28e3228f209b8ff9255c58099"
- url: "https://pub.dev"
- source: hosted
- version: "0.6.0"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
- url: "https://pub.dev"
- source: hosted
- version: "1.3.2"
url_launcher:
dependency: transitive
description:
@@ -593,14 +388,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
- validated:
- dependency: transitive
- description:
- name: validated
- sha256: f4da18b50fa2aeda8d2f6e55bdf73759593abe3f9dd4aeece4e98bf3438e6a9f
- url: "https://pub.dev"
- source: hosted
- version: "2.0.0"
vector_math:
dependency: transitive
description:
diff --git a/lib/error_stack.dart b/lib/error_stack.dart
index 221684e..40a53d5 100644
--- a/lib/error_stack.dart
+++ b/lib/error_stack.dart
@@ -1,8 +1,7 @@
library error_stack;
+import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import '/widgets/error_stack_release_widget.dart';
-import 'package:nylo_support/helpers/backpack.dart';
-import 'package:nylo_support/nylo.dart';
import '/widgets/error_stack_debug_widget.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@@ -14,23 +13,35 @@ enum ErrorStackLogLevel {
}
class ErrorStack {
+ /// Storage key
static const String storageKey = 'error_stack_theme_mode';
+ /// Storage instance
+ final FlutterSecureStorage storage =
+ const FlutterSecureStorage(aOptions: AndroidOptions());
+
+ /// The initial route to navigate to when an error occurs
+ String initialRoute = "/";
+
+ /// The theme mode to use
+ String themeMode = "light";
+
+ /// singleton instance
+ ErrorStack._privateConstructor();
+
+ static final ErrorStack instance = ErrorStack._privateConstructor();
+
/// Initialize the ErrorStack package
/// You can set the [level] to [ErrorStackLogLevel.verbose] to see more details
/// You can set the [initialRoute] to the route you want to navigate to when an error occurs
- /// You can set [isNyloApp] to true if you are using the Nylo framework
- static init(
- {ErrorStackLogLevel level = ErrorStackLogLevel.minimal,
- String initialRoute = "/",
- bool isNyloApp = false}) {
- if (isNyloApp == false) {
- Nylo _nylo = Nylo();
- Backpack.instance.set('nylo', _nylo);
-
- /// Initialize the Nylo framework
- }
- Backpack.instance.set("${storageKey}_initial_route", initialRoute);
+ static init({
+ ErrorStackLogLevel level = ErrorStackLogLevel.minimal,
+ String initialRoute = "/",
+ }) async {
+ ErrorStack.instance.initialRoute = initialRoute;
+ ErrorStack.instance.themeMode = await ErrorStack.instance.storage
+ .read(key: '${ErrorStack.storageKey}_theme_mode') ??
+ 'light';
ErrorWidget.builder = (FlutterErrorDetails errorDetails) {
if (kReleaseMode) {
return ErrorStackReleaseWidget(errorDetails: errorDetails);
diff --git a/lib/widgets/error_stack_debug_widget.dart b/lib/widgets/error_stack_debug_widget.dart
index 0d825c9..b20d60e 100644
--- a/lib/widgets/error_stack_debug_widget.dart
+++ b/lib/widgets/error_stack_debug_widget.dart
@@ -1,40 +1,49 @@
-import 'package:nylo_support/helpers/backpack.dart';
import '/error_stack.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-import 'package:nylo_support/helpers/extensions.dart';
-import 'package:nylo_support/helpers/helper.dart';
-import 'package:nylo_support/widgets/ny_state.dart';
-import 'package:nylo_support/widgets/ny_stateful_widget.dart';
import 'package:url_launcher/url_launcher.dart';
import 'dart:io' show Platform;
-class ErrorStackDebugWidget extends NyStatefulWidget {
+/// ErrorStackDebugWidget
+/// This widget is displayed when an error occurs in debug mode
+/// It displays the error message, the class name, and the stack trace
+/// It also allows the user to search for the error on Google
+/// and restart the app
+class ErrorStackDebugWidget extends StatefulWidget {
static const path = '/error-stack-debug';
final FlutterErrorDetails errorDetails;
- ErrorStackDebugWidget({super.key, required this.errorDetails}) : super(path);
+ const ErrorStackDebugWidget({super.key, required this.errorDetails});
@override
createState() => _ErrorStackDebugWidget();
}
-class _ErrorStackDebugWidget extends NyState {
+class _ErrorStackDebugWidget extends State {
+
+ /// The theme mode
String? _themeMode;
+
+ /// The class name
String? _className;
@override
- init() async {
- String? themeMode = await NyStorage.read(ErrorStack.storageKey);
- _themeMode = themeMode == 'dark' ? 'dark' : 'light';
- _className = className();
+ initState() {
+ super.initState();
+ _init();
+ }
+
+ /// Initialize the widget
+ _init() {
+ _themeMode = ErrorStack.instance.themeMode == 'dark' ? 'dark' : 'light';
+ setState(() {});
}
/// Get the class name
String className() {
String stack = widget.errorDetails.stack.toString();
- RegExp regExp = RegExp(r'(\(package:([A-z\/.:0-9]+)\))');
+ RegExp regExp = RegExp(r'(\(package:([A-z/.:0-9]+)\))');
Iterable regMatches = regExp.allMatches(stack);
@@ -45,7 +54,7 @@ class _ErrorStackDebugWidget extends NyState {
if (_className == null) return "";
String inputString = _className!;
- RegExp pattern = RegExp(r'^\(.*?\/');
+ RegExp pattern = RegExp(r'^\(.*?/');
String result = inputString
.replaceAll(pattern, "/")
.replaceAll("(", "")
@@ -58,7 +67,7 @@ class _ErrorStackDebugWidget extends NyState {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor:
- _themeMode == "light" ? Colors.white : "#282c34".toHexColor(),
+ _themeMode == "light" ? Colors.white : _hexColor("#282c34"),
body: SafeArea(
child: Stack(
children: [
@@ -91,7 +100,7 @@ class _ErrorStackDebugWidget extends NyState {
borderRadius: BorderRadius.circular(8.0),
color: _themeMode == "light"
? Colors.grey.shade100
- : "#13151a".toHexColor(),
+ : _hexColor("#13151a"),
),
child: Column(
children: [
@@ -106,29 +115,24 @@ class _ErrorStackDebugWidget extends NyState {
MainAxisAlignment.spaceBetween,
children: [
Expanded(
- child: afterNotNull(_className, child: () {
- return Container(
- width: double.infinity,
- padding:
- const EdgeInsets.only(bottom: 8),
- decoration: BoxDecoration(
- borderRadius:
- BorderRadius.circular(8.0),
- ),
- child: Text(
- className(),
- textAlign: TextAlign.left,
- maxLines: 1,
- style: TextStyle(
- fontSize: 12.0,
- color: Colors.grey.shade600,
- fontWeight: FontWeight.bold,
- ),
- ));
- },
- loading: const SizedBox(
- height: 15,
- )),
+ child: Container(
+ width: double.infinity,
+ padding: const EdgeInsets.only(bottom: 8),
+ decoration: BoxDecoration(
+ borderRadius:
+ BorderRadius.circular(8.0),
+ ),
+ child: Text(
+ className(),
+ textAlign: TextAlign.left,
+ maxLines: 1,
+ style: TextStyle(
+ fontSize: 12.0,
+ color: Colors.grey.shade600,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
),
IconButton(
padding: EdgeInsets.zero,
@@ -162,69 +166,76 @@ class _ErrorStackDebugWidget extends NyState {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
color: _themeMode == 'light'
- ? "#282c34".toHexColor()
+ ? _hexColor("#282c34")
: Colors.white.withOpacity(0.2),
),
- child: Text(
- widget.errorDetails.exceptionAsString(),
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16.0,
- color: "#d8b576".toHexColor(),
- fontWeight: FontWeight.bold,
+ child: Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 16),
+ child: Text(
+ widget.errorDetails.exceptionAsString(),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 16.0,
+ color: _hexColor("#d8b576"),
+ fontWeight: FontWeight.bold,
+ ),
),
- ).paddingSymmetric(horizontal: 16),
+ ),
),
],
)),
const SizedBox(height: 20.0),
- Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text(
- "Operating System Version",
- style: TextStyle(
- color: _themeMode == "light"
- ? Colors.black54
- : Colors.grey,
- fontSize: 14,
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ "Operating System Version",
+ style: TextStyle(
+ color: _themeMode == "light"
+ ? Colors.black54
+ : Colors.grey,
+ fontSize: 14,
+ ),
+ textAlign: TextAlign.center,
),
- textAlign: TextAlign.center,
- ),
- Text(
- Platform.operatingSystemVersion,
- style: TextStyle(
- color: _themeMode == "light"
- ? Colors.black
- : Colors.white,
- fontSize: 14,
+ Text(
+ Platform.operatingSystemVersion,
+ style: TextStyle(
+ color: _themeMode == "light"
+ ? Colors.black
+ : Colors.white,
+ fontSize: 14,
+ ),
+ textAlign: TextAlign.center,
),
- textAlign: TextAlign.center,
- ),
- const SizedBox(height: 10.0),
- Text(
- "Operating System",
- style: TextStyle(
- color: _themeMode == "light"
- ? Colors.black54
- : Colors.grey,
- fontSize: 14,
+ const SizedBox(height: 10.0),
+ Text(
+ "Operating System",
+ style: TextStyle(
+ color: _themeMode == "light"
+ ? Colors.black54
+ : Colors.grey,
+ fontSize: 14,
+ ),
+ textAlign: TextAlign.center,
),
- textAlign: TextAlign.center,
- ),
- Text(
- Platform.operatingSystem,
- style: TextStyle(
- color: _themeMode == "light"
- ? Colors.black
- : Colors.white,
- fontSize: 14,
+ Text(
+ Platform.operatingSystem,
+ style: TextStyle(
+ color: _themeMode == "light"
+ ? Colors.black
+ : Colors.white,
+ fontSize: 14,
+ ),
+ textAlign: TextAlign.center,
),
- textAlign: TextAlign.center,
- ),
- ],
- ).paddingSymmetric(horizontal: 16),
+ ],
+ ),
+ ),
const SizedBox(height: 20.0),
Container(
decoration: BoxDecoration(
@@ -253,7 +264,7 @@ class _ErrorStackDebugWidget extends NyState {
style: TextStyle(
fontWeight: FontWeight.w600,
color: _themeMode == "light"
- ? "#0045a0".toHexColor()
+ ? _hexColor("#0045a0")
: Colors.white,
),
),
@@ -263,8 +274,7 @@ class _ErrorStackDebugWidget extends NyState {
),
TextButton(
onPressed: () {
- String initialRoute = Backpack.instance
- .read("${ErrorStack.storageKey}_initial_route");
+ String initialRoute = ErrorStack.instance.initialRoute;
Navigator.pushNamedAndRemoveUntil(
context, initialRoute, (_) => false);
},
@@ -293,12 +303,13 @@ class _ErrorStackDebugWidget extends NyState {
color: _themeMode == "light" ? Colors.black : Colors.white,
),
onPressed: () async {
- if (_themeMode == 'light') {
- _themeMode = 'dark';
- } else {
- _themeMode = 'light';
- }
- await NyStorage.store(ErrorStack.storageKey, _themeMode);
+ _themeMode == 'light'
+ ? _themeMode = 'dark'
+ : _themeMode = 'light';
+ await ErrorStack.instance.storage.write(
+ key: '${ErrorStack.storageKey}_theme_mode',
+ value: _themeMode!);
+ ErrorStack.instance.themeMode = _themeMode!;
setState(() {});
}),
),
@@ -321,4 +332,14 @@ class _ErrorStackDebugWidget extends NyState {
),
);
}
+
+ /// Get the color from a hex string
+ /// [hexColor] the hex color string
+ Color _hexColor(String hexColor) {
+ hexColor = hexColor.toUpperCase().replaceAll("#", "");
+ if (hexColor.length == 6) {
+ hexColor = "FF$hexColor";
+ }
+ return Color(int.parse(hexColor, radix: 16));
+ }
}
diff --git a/lib/widgets/error_stack_release_widget.dart b/lib/widgets/error_stack_release_widget.dart
index a1a4887..bace3eb 100644
--- a/lib/widgets/error_stack_release_widget.dart
+++ b/lib/widgets/error_stack_release_widget.dart
@@ -1,19 +1,18 @@
import 'package:flutter/material.dart';
-import 'package:nylo_support/widgets/ny_state.dart';
-import 'package:nylo_support/widgets/ny_stateful_widget.dart';
-class ErrorStackReleaseWidget extends NyStatefulWidget {
- static const path = '/error-stack-release';
+/// Widget to display a release error stack.
+/// This widget is displayed when the app is in release mode.
+/// It displays a simple error message.
+class ErrorStackReleaseWidget extends StatefulWidget {
final FlutterErrorDetails errorDetails;
- ErrorStackReleaseWidget({super.key, required this.errorDetails})
- : super(path);
+ const ErrorStackReleaseWidget({super.key, required this.errorDetails});
@override
createState() => _ErrorStackReleaseWidget();
}
-class _ErrorStackReleaseWidget extends NyState {
+class _ErrorStackReleaseWidget extends State {
@override
Widget build(BuildContext context) {
return const Scaffold(
diff --git a/pubspec.yaml b/pubspec.yaml
index 28ee0c0..2aa1776 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: error_stack
-description: "Easy error handling for Flutter applications! Modern UI for errors, updated logging to keep you productive."
-version: 1.0.0
+description: "ErrorStack helps you swifty deal with errors in your Flutter applications! Custom error handling UI and logging to keep you productive."
+version: 1.1.0
homepage: https://nylo.dev
repository: https://github.com/nylo-core/error-stack/tree/1.x
issue_tracker: https://github.com/nylo-core/error-stack/issues
@@ -18,10 +18,10 @@ environment:
flutter: ">=1.17.0"
dependencies:
- nylo_support: ^5.67.1
+ flutter_secure_storage: ^9.0.0
+ url_launcher: ^6.2.6
flutter:
sdk: flutter
- url_launcher: ^6.2.6
dev_dependencies:
flutter_test: