diff --git a/Makefile b/Makefile index c1602dc..127e37b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ json: dart run build_runner build +json_watch: + dart run build_runner watch --delete-conflicting-outputs + l10n: flutter gen-l10n diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c3cc8dc..40e0ab3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,16 @@ - + + + + android:icon="@mipmap/ic_launcher" + android:enableOnBackInvokedCallback="true" + tools:targetApi="36"> UIApplicationSupportsIndirectInputEvents + NFCReaderUsageDescription + Interacting with the liteauth device diff --git a/lib/dialogs/esptouchdialog.dart b/lib/dialogs/esptouchdialog.dart index 1bb009f..e92c2c3 100644 --- a/lib/dialogs/esptouchdialog.dart +++ b/lib/dialogs/esptouchdialog.dart @@ -2,7 +2,7 @@ import 'package:esptouch_flutter/esptouch_flutter.dart'; import 'package:flutter/material.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; -import '../appconfig.dart'; +import '../models/appconfig.dart'; class ESPTouchDialog extends StatefulWidget { final String name; @@ -81,7 +81,7 @@ class _ESPTouchDialog extends State { Widget build(BuildContext context) { final appLocal = AppLocalizations.of(context)!; - return AlertDialog( + return AlertDialog.adaptive( title: Text(appLocal.networkInitHeadline), content: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index a13e52e..cdd504d 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -3,6 +3,11 @@ "noDevices": "It seems that you have no devices! You can register one with the big plus button.", "setupNewDevice": "Setup new device", "addExistingDevice": "Add existing device", + "nfcDisabled": "NFC is disabled on your device!", + "nfcRequired": "This app requires NFC as part of the core functionality.", + "nfcUnsupported": "Your device does not support NFC", + "nfcReady": "NFC is ready!", + "nfcReadyDescription": "You can tap the device with the NFC scanner now.", "registerDevice": "Register Device", "deviceName": "Name", @@ -24,6 +29,9 @@ "deletion": "Deletion", "deviceDeleteConfirm": "Are you sure you want to delete this device forever?", "reconfigureNetwork": "Reconfigure Network", + "factoryReset": "Factory Reset", + "resetConfirm": "Are you sure you want to proceed with the factory reset? Your data will be lost and unrecoverable, and you must setup the device again.", + "reset": "Reset", "status": "Status: ", "online": "Online", "offline": "Offline", @@ -45,5 +53,6 @@ "example": "ABC_WiFi" } } - } + }, + "activityLogs": "Activity Logs" } \ No newline at end of file diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 95d99a6..a30a73c 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -122,6 +122,36 @@ abstract class AppLocalizations { /// **'Add existing device'** String get addExistingDevice; + /// No description provided for @nfcDisabled. + /// + /// In en, this message translates to: + /// **'NFC is disabled on your device!'** + String get nfcDisabled; + + /// No description provided for @nfcRequired. + /// + /// In en, this message translates to: + /// **'This app requires NFC as part of the core functionality.'** + String get nfcRequired; + + /// No description provided for @nfcUnsupported. + /// + /// In en, this message translates to: + /// **'Your device does not support NFC'** + String get nfcUnsupported; + + /// No description provided for @nfcReady. + /// + /// In en, this message translates to: + /// **'NFC is ready!'** + String get nfcReady; + + /// No description provided for @nfcReadyDescription. + /// + /// In en, this message translates to: + /// **'You can tap the device with the NFC scanner now.'** + String get nfcReadyDescription; + /// No description provided for @registerDevice. /// /// In en, this message translates to: @@ -230,6 +260,24 @@ abstract class AppLocalizations { /// **'Reconfigure Network'** String get reconfigureNetwork; + /// No description provided for @factoryReset. + /// + /// In en, this message translates to: + /// **'Factory Reset'** + String get factoryReset; + + /// No description provided for @resetConfirm. + /// + /// In en, this message translates to: + /// **'Are you sure you want to proceed with the factory reset? Your data will be lost and unrecoverable, and you must setup the device again.'** + String get resetConfirm; + + /// No description provided for @reset. + /// + /// In en, this message translates to: + /// **'Reset'** + String get reset; + /// No description provided for @status. /// /// In en, this message translates to: @@ -265,6 +313,12 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'Router SSID: {ssid}'** String routerSsid(String ssid); + + /// No description provided for @activityLogs. + /// + /// In en, this message translates to: + /// **'Activity Logs'** + String get activityLogs; } class _AppLocalizationsDelegate diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index f1cf969..a498c6e 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -21,6 +21,23 @@ class AppLocalizationsEn extends AppLocalizations { @override String get addExistingDevice => 'Add existing device'; + @override + String get nfcDisabled => 'NFC is disabled on your device!'; + + @override + String get nfcRequired => + 'This app requires NFC as part of the core functionality.'; + + @override + String get nfcUnsupported => 'Your device does not support NFC'; + + @override + String get nfcReady => 'NFC is ready!'; + + @override + String get nfcReadyDescription => + 'You can tap the device with the NFC scanner now.'; + @override String get registerDevice => 'Register Device'; @@ -79,6 +96,16 @@ class AppLocalizationsEn extends AppLocalizations { @override String get reconfigureNetwork => 'Reconfigure Network'; + @override + String get factoryReset => 'Factory Reset'; + + @override + String get resetConfirm => + 'Are you sure you want to proceed with the factory reset? Your data will be lost and unrecoverable, and you must setup the device again.'; + + @override + String get reset => 'Reset'; + @override String get status => 'Status: '; @@ -100,4 +127,7 @@ class AppLocalizationsEn extends AppLocalizations { String routerSsid(String ssid) { return 'Router SSID: $ssid'; } + + @override + String get activityLogs => 'Activity Logs'; } diff --git a/lib/l10n/app_localizations_th.dart b/lib/l10n/app_localizations_th.dart index 9b0c9c6..874d059 100644 --- a/lib/l10n/app_localizations_th.dart +++ b/lib/l10n/app_localizations_th.dart @@ -21,6 +21,23 @@ class AppLocalizationsTh extends AppLocalizations { @override String get addExistingDevice => 'เพิ่มอุปกรณ์ที่ตั้งค่าแล้ว'; + @override + String get nfcDisabled => 'NFC ถูกปิดอยู่บนอุปกรณ์ของคุณ'; + + @override + String get nfcRequired => + 'ส่วนหนึ่งของฟังก์ชันหลักในแอพลิเคชันจำเป็นต้องใช้ NFC'; + + @override + String get nfcUnsupported => 'อุปกรณ์ของคุณไม่รองรับ NFC'; + + @override + String get nfcReady => 'NFC พร้อมแล้ว'; + + @override + String get nfcReadyDescription => + 'คุณสามารถแตะโทรศัพท์กับเซนเซอร์ NFC ได้เลย'; + @override String get registerDevice => 'ลงทะเบียนอุปกรณ์'; @@ -78,6 +95,16 @@ class AppLocalizationsTh extends AppLocalizations { @override String get reconfigureNetwork => 'ตั้งค่าเครือข่ายใหม่'; + @override + String get factoryReset => 'คืนค่าโรงงาน'; + + @override + String get resetConfirm => + 'คุณแน่ใจหรือไม่ว่าต้องการคืนค่าจากโรงงาน ข้อมูลของคุณจะหายไปและไม่สามารถกู้คืนได้ และคุณจำเป็นต้องตั้งค่าอุปกรณ์ใหม่'; + + @override + String get reset => 'คืนค่า'; + @override String get status => 'สถานะ: '; @@ -99,4 +126,7 @@ class AppLocalizationsTh extends AppLocalizations { String routerSsid(String ssid) { return 'SSID เราเตอร์: $ssid'; } + + @override + String get activityLogs => 'รายการกิจกรรม'; } diff --git a/lib/l10n/app_th.arb b/lib/l10n/app_th.arb index 68358be..71a9c00 100644 --- a/lib/l10n/app_th.arb +++ b/lib/l10n/app_th.arb @@ -3,6 +3,11 @@ "noDevices": "ดูเหมือนว่าคุณจะไม่มีอุปกรณ์ที่ลงทะเบียนไว้นะ! คุณสามารถลงทะเบียนอุปกรณ์ใหม่ได้ที่ปุ่มบวกด้านล่าง", "setupNewDevice": "ตั้งค่าอุปกรณ์ใหม่", "addExistingDevice": "เพิ่มอุปกรณ์ที่ตั้งค่าแล้ว", + "nfcDisabled": "NFC ถูกปิดอยู่บนอุปกรณ์ของคุณ", + "nfcRequired": "ส่วนหนึ่งของฟังก์ชันหลักในแอพลิเคชันจำเป็นต้องใช้ NFC", + "nfcUnsupported": "อุปกรณ์ของคุณไม่รองรับ NFC", + "nfcReady": "NFC พร้อมแล้ว", + "nfcReadyDescription": "คุณสามารถแตะโทรศัพท์กับเซนเซอร์ NFC ได้เลย", "registerDevice": "ลงทะเบียนอุปกรณ์", "deviceName": "ชื่อ", @@ -24,10 +29,14 @@ "deletion": "การลบ", "deviceDeleteConfirm": "คุณแน่ใจหรือไม่ที่จะลบอุปกรณ์นี้อย่างถาวร", "reconfigureNetwork": "ตั้งค่าเครือข่ายใหม่", + "factoryReset": "คืนค่าโรงงาน", + "resetConfirm": "คุณแน่ใจหรือไม่ว่าต้องการคืนค่าจากโรงงาน ข้อมูลของคุณจะหายไปและไม่สามารถกู้คืนได้ และคุณจำเป็นต้องตั้งค่าอุปกรณ์ใหม่", + "reset": "คืนค่า", "status": "สถานะ: ", "online": "ออนไลน์", "offline": "ออฟไลน์", "refresh": "รีเฟรช", "lastKnownIP": "ที่อยู่ IP ที่ทราบล่าสุด: {ip}", - "routerSsid": "SSID เราเตอร์: {ssid}" + "routerSsid": "SSID เราเตอร์: {ssid}", + "activityLogs": "รายการกิจกรรม" } \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 7523896..070651c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,7 +2,8 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:liteauthconfig/appconfig.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:liteauthconfig/models/appconfig.dart'; import 'package:liteauthconfig/pages/devicelist.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; import 'package:path_provider/path_provider.dart'; @@ -15,6 +16,10 @@ void main() async { SystemTheme.fallbackColor = const Color(0xFF4C1D95); await SystemTheme.accentColor.load(); + final secureStorage = FlutterSecureStorage( + aOptions: AndroidOptions.biometric() + ); + final appDocsDir = await getApplicationDocumentsDirectory(); var configFile = File(p.join(appDocsDir.path, "app.json")); diff --git a/lib/appconfig.dart b/lib/models/appconfig.dart similarity index 100% rename from lib/appconfig.dart rename to lib/models/appconfig.dart diff --git a/lib/appconfig.g.dart b/lib/models/appconfig.g.dart similarity index 100% rename from lib/appconfig.g.dart rename to lib/models/appconfig.g.dart diff --git a/lib/models/device_status.dart b/lib/models/device_status.dart new file mode 100644 index 0000000..41d50e9 --- /dev/null +++ b/lib/models/device_status.dart @@ -0,0 +1,16 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'device_status.g.dart'; + +@JsonSerializable() +class DeviceStatus { + bool entryNfc = false; + bool exitNfc = false; + + DeviceStatus({this.entryNfc = false, this.exitNfc = false}); + + factory DeviceStatus.fromJson(Map json) => + _$DeviceStatusFromJson(json); + + Map toJson() => _$DeviceStatusToJson(this); +} diff --git a/lib/pages/deviceinfo.dart b/lib/pages/deviceinfo.dart index a97e0c6..e10d05b 100644 --- a/lib/pages/deviceinfo.dart +++ b/lib/pages/deviceinfo.dart @@ -1,6 +1,10 @@ +import 'dart:async'; +import 'dart:convert'; + import 'package:flutter/material.dart'; -import 'package:liteauthconfig/appconfig.dart'; +import 'package:liteauthconfig/models/appconfig.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; +import 'package:liteauthconfig/models/device_status.dart'; import 'package:liteauthconfig/pages/reconfigure_network.dart'; import 'package:liteauthconfig/utils/network.dart'; @@ -15,9 +19,11 @@ class DeviceInfoPage extends StatefulWidget { class _DeviceInfoPageState extends State { late Device device; + DeviceStatus? deviceStatus; String statusMessage = ""; bool online = false; bool loading = false; + Timer? refreshTimer; @override void initState() { @@ -31,24 +37,67 @@ class _DeviceInfoPageState extends State { device = AppConfig().devices[widget.deviceIndex]; } - void checkStatus() async { + Future checkStatus() async { + statusMessage = ""; + setState(() { loading = true; }); var client = await createEspHttpClient(); try { - var resp = await client.get(Uri.parse("https://liteauth.local")); - setState(() { - online = resp.statusCode >= 200 && resp.statusCode < 300; - }); + var resp = await client.get( + Uri.parse("https://liteauth.local/api/status"), + ); + deviceStatus = DeviceStatus.fromJson(jsonDecode(resp.body)); + online = resp.statusCode >= 200 && resp.statusCode < 300; } catch (e) { statusMessage = e.toString(); + online = false; + refreshTimer ??= Timer.periodic(const Duration(seconds: 5), ( + timer, + ) async { + await checkStatus(); + if (online) { + timer.cancel(); + refreshTimer = null; + } + }); } - setState(() { - loading = false; - }); + if (mounted) { + setState(() { + loading = false; + }); + } + } + + void factoryReset() async { + var appLocal = AppLocalizations.of(context)!; + + var reset = await showDialog(context: context, builder: (ctx) => AlertDialog.adaptive( + title: Text(appLocal.factoryReset), + content: Text(appLocal.resetConfirm), + actions: [ + TextButton(onPressed: () { + Navigator.of(ctx).pop(false); + }, child: Text(appLocal.cancel)), + TextButton(onPressed: () { + Navigator.of(ctx).pop(true); + }, child: Text(appLocal.reset)), + ], + )) ?? false; + + if (!reset) return; + + var client = await createEspHttpClient(); + client.get(Uri.parse("https://liteauth.local/api/factoryReset")); + } + + @override + void dispose() { + refreshTimer?.cancel(); + super.dispose(); } @override @@ -76,17 +125,45 @@ class _DeviceInfoPageState extends State { controller.open(); } }, - icon: const Icon(Icons.more_vert), + icon: Icon(Icons.adaptive.more), ); }, menuChildren: [ + MenuItemButton( + leadingIcon: const Icon(Icons.refresh), + onPressed: checkStatus, + child: Text(appLocal.refresh), + ), + MenuItemButton( + leadingIcon: const Icon(Icons.network_wifi), + child: Text(appLocal.reconfigureNetwork), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + ReconfigureNetworkPage(widget.deviceIndex), + ), + ).then((result) { + if (result) { + refreshDevice(); + checkStatus(); + } + }); + }, + ), + MenuItemButton( + leadingIcon: const Icon(Icons.history), + child: Text(appLocal.factoryReset), + onPressed: factoryReset, + ), MenuItemButton( leadingIcon: const Icon(Icons.delete), child: Text(appLocal.delete), onPressed: () { showDialog( context: context, - builder: (context) => AlertDialog( + builder: (context) => AlertDialog.adaptive( title: Text(appLocal.deletion), content: Text(appLocal.deviceDeleteConfirm), actions: [ @@ -111,24 +188,6 @@ class _DeviceInfoPageState extends State { ); }, ), - MenuItemButton( - leadingIcon: const Icon(Icons.network_wifi), - child: Text(appLocal.reconfigureNetwork), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - ReconfigureNetworkPage(widget.deviceIndex), - ), - ).then((_) => refreshDevice()); - }, - ), - MenuItemButton( - leadingIcon: const Icon(Icons.refresh), - onPressed: checkStatus, - child: Text(appLocal.refresh), - ), ], ), ], @@ -144,18 +203,20 @@ class _DeviceInfoPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(device.name, style: appTheme.textTheme.headlineLarge), - Row(children: [ - Text( - appLocal.status, - style: appTheme.textTheme.bodyLarge, - ), - Text( - online ? appLocal.online : appLocal.offline, - style: appTheme.textTheme.bodyLarge?.copyWith( - color: online ? Colors.green : Colors.red, + Row( + children: [ + Text( + appLocal.status, + style: appTheme.textTheme.bodyLarge, ), - ), - ],), + Text( + online ? appLocal.online : appLocal.offline, + style: appTheme.textTheme.bodyLarge?.copyWith( + color: online ? Colors.green : Colors.red, + ), + ), + ], + ), ], ), if (statusMessage.isNotEmpty) Text(statusMessage), @@ -178,6 +239,20 @@ class _DeviceInfoPageState extends State { Text(appLocal.routerSsid(device.routerSsid)), ], ), + Column( + children: [ + Row( + spacing: 8, + children: [ + Icon(Icons.list), + Text( + appLocal.activityLogs, + style: appTheme.textTheme.headlineMedium, + ), + ], + ), + ], + ), ], ), ), diff --git a/lib/pages/devicelist.dart b/lib/pages/devicelist.dart index 76a4bba..a17d76c 100644 --- a/lib/pages/devicelist.dart +++ b/lib/pages/devicelist.dart @@ -1,9 +1,13 @@ +import 'dart:io' show Platform; + import 'package:flutter/material.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; -import 'package:liteauthconfig/appconfig.dart'; +import 'package:liteauthconfig/models/appconfig.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; import 'package:liteauthconfig/pages/deviceinfo.dart'; import 'package:liteauthconfig/pages/registerpage.dart'; +import 'package:nfc_manager/nfc_manager.dart'; +import 'package:nfc_manager_ndef/nfc_manager_ndef.dart'; class DeviceListPage extends StatefulWidget { const DeviceListPage({super.key}); @@ -14,11 +18,35 @@ class DeviceListPage extends StatefulWidget { class _DeviceListPageState extends State { List devices = []; + NfcAvailability? availability; @override void initState() { super.initState(); refreshList(); + checkNfc(); + } + + Future checkNfc() async { + if (!(Platform.isAndroid || Platform.isIOS)) return; + + availability = await NfcManager.instance.checkAvailability(); + + if (availability != NfcAvailability.enabled) return; + + NfcManager.instance.startSession( + pollingOptions: {NfcPollingOption.iso14443}, + onDiscovered: (NfcTag tag) async { + final Ndef? ndef = Ndef.from(tag); + + if (ndef == null) { + print("This tag is not compatible with NDEF."); + return; + } + + print(ndef); + }, + ); } void refreshList() { @@ -34,34 +62,65 @@ class _DeviceListPageState extends State { return Scaffold( appBar: AppBar(title: Text(appLocal.deviceList)), - body: Visibility( - visible: devices.isEmpty, - replacement: ListView.builder( - itemBuilder: (context, index) { - final dev = devices[index]; - - return ListTile( - title: Text(dev.name), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => DeviceInfoPage(deviceIndex: index), + body: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsetsGeometry.all(8), + child: switch (availability) { + null => SizedBox(), + NfcAvailability.enabled => Card( + child: ListTile( + title: Text(appLocal.nfcReady), + subtitle: Text(appLocal.nfcReadyDescription), ), - ).then((_) => refreshList()); + ), + NfcAvailability.disabled => Card( + child: ListTile( + title: Text(appLocal.nfcDisabled), + subtitle: Text(appLocal.nfcRequired), + ), + ), + NfcAvailability.unsupported => Card( + child: ListTile( + title: Text(appLocal.nfcUnsupported), + subtitle: Text(appLocal.nfcRequired), + ), + ), }, - ); - }, - itemCount: devices.length, - shrinkWrap: true, - ), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Text( - appLocal.noDevices, - textAlign: TextAlign.center, - style: appTheme.textTheme.bodyLarge, - ), + ), + Visibility( + visible: devices.isEmpty, + replacement: ListView.builder( + itemBuilder: (context, index) { + final dev = devices[index]; + + return ListTile( + title: Text(dev.name), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + DeviceInfoPage(deviceIndex: index), + ), + ).then((_) => refreshList()); + }, + ); + }, + itemCount: devices.length, + shrinkWrap: true, + ), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + appLocal.noDevices, + textAlign: TextAlign.center, + style: appTheme.textTheme.bodyLarge, + ), + ), + ), + ], ), ), floatingActionButton: SpeedDial( @@ -77,7 +136,9 @@ class _DeviceListPageState extends State { ), onTap: () { Navigator.of(context) - .push(MaterialPageRoute(builder: (context) => RegisterPage(true))) + .push( + MaterialPageRoute(builder: (context) => RegisterPage(true)), + ) .then((_) => refreshList()); }, ), @@ -90,9 +151,13 @@ class _DeviceListPageState extends State { ), onTap: () { Navigator.of(context) - .push(MaterialPageRoute(builder: (context) => RegisterPage(false))) + .push( + MaterialPageRoute( + builder: (context) => RegisterPage(false), + ), + ) .then((_) => refreshList()); - } + }, ), ], child: const Icon(Icons.add), diff --git a/lib/pages/reconfigure_network.dart b/lib/pages/reconfigure_network.dart index ebd8a7a..6191aaa 100644 --- a/lib/pages/reconfigure_network.dart +++ b/lib/pages/reconfigure_network.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:liteauthconfig/appconfig.dart'; +import 'package:liteauthconfig/models/appconfig.dart'; import 'package:liteauthconfig/dialogs/esptouchdialog.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; import 'package:network_info_plus/network_info_plus.dart'; @@ -115,7 +115,7 @@ class _ReconfigureNetworkPageState extends State { ); if (context.mounted) { - Navigator.pop(context); + Navigator.pop(context, true); } } diff --git a/lib/pages/registerpage.dart b/lib/pages/registerpage.dart index 5735a35..df835a2 100644 --- a/lib/pages/registerpage.dart +++ b/lib/pages/registerpage.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:liteauthconfig/appconfig.dart'; +import 'package:liteauthconfig/models/appconfig.dart'; import 'package:liteauthconfig/dialogs/esptouchdialog.dart'; import 'package:liteauthconfig/l10n/app_localizations.dart'; import 'package:multicast_dns/multicast_dns.dart'; diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index fdc0a6b..1112ba9 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,14 +5,12 @@ import FlutterMacOS import Foundation -import flutter_secure_storage_macos +import flutter_secure_storage_darwin import network_info_plus -import path_provider_foundation import system_theme func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) + FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SystemThemePlugin.register(with: registry.registrar(forPlugin: "SystemThemePlugin")) } diff --git a/pubspec.lock b/pubspec.lock index d2d1edb..9401ed7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d + sha256: "8d7ff3948166b8ec5da0fbb5962000926b8e02f2ed9b3e51d1738905fbd4c98d" url: "https://pub.dev" source: hosted - version: "91.0.0" + version: "93.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 + sha256: de7148ed2fcec579b19f122c1800933dfa028f6d9fd38a152b04b1516cec120b url: "https://pub.dev" source: hosted - version: "8.4.1" + version: "10.0.1" args: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: build - sha256: dfb67ccc9a78c642193e0c2d94cb9e48c2c818b3178a86097d644acdcde6a8d9 + sha256: "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.4" build_config: dependency: transitive description: @@ -61,18 +61,18 @@ packages: dependency: transitive description: name: build_daemon - sha256: "409002f1adeea601018715d613115cfaf0e31f512cb80ae4534c79867ae2363d" + sha256: bf05f6e12cfea92d3c09308d7bcdab1906cd8a179b023269eed00c071004b957 url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.1.1" build_runner: dependency: "direct dev" description: name: build_runner - sha256: a9461b8e586bf018dd4afd2e13b49b08c6a844a4b226c8d1d10f3a723cdd78c3 + sha256: b4d854962a32fd9f8efc0b76f98214790b833af8b2e9b2df6bfc927c0415a072 url: "https://pub.dev" source: hosted - version: "2.10.1" + version: "2.10.5" built_collection: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: built_value - sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d + sha256: "7931c90b84bc573fef103548e354258ae4c9d28d140e41961df6843c5d60d4d8" url: "https://pub.dev" source: hosted - version: "8.12.0" + version: "8.12.3" characters: dependency: transitive description: @@ -113,14 +113,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" code_builder: dependency: transitive description: name: code_builder - sha256: "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243" + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" url: "https://pub.dev" source: hosted - version: "4.11.0" + version: "4.11.1" collection: dependency: transitive description: @@ -157,10 +165,10 @@ packages: dependency: transitive description: name: dart_style - sha256: c87dfe3d56f183ffe9106a18aebc6db431fc7c98c31a54b952a77f3d54a85697 + sha256: "15a7db352c8fc6a4d2bc475ba901c25b39fe7157541da4c16eacce6f8be83e49" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.5" dbus: dependency: transitive description: @@ -190,10 +198,10 @@ packages: dependency: transitive description: name: ffi - sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" file: dependency: transitive description: @@ -232,50 +240,50 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40 url: "https://pub.dev" source: hosted - version: "9.2.4" + version: "10.0.0" + flutter_secure_storage_darwin: + dependency: transitive + description: + name: flutter_secure_storage_darwin + sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3" + url: "https://pub.dev" + source: hosted + version: "0.2.0" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda" url: "https://pub.dev" source: hosted - version: "1.2.3" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" - url: "https://pub.dev" - source: hosted - version: "3.1.3" + version: "3.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.1.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.1.0" flutter_speed_dial: dependency: "direct main" description: @@ -306,10 +314,10 @@ packages: dependency: "direct main" description: name: google_fonts - sha256: "517b20870220c48752eafa0ba1a797a092fb22df0d89535fd9991e86ee2cdd9c" + sha256: bf1fe61d4a53420a94cbbd4326e07702d247757926f6955af9667765a8324413 url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "8.0.0" graphs: dependency: transitive description: @@ -318,14 +326,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" http: dependency: "direct main" description: name: http - sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.6.0" http_multi_server: dependency: transitive description: @@ -358,30 +374,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" json_annotation: dependency: "direct main" description: name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + sha256: "805fa86df56383000f640384b282ce0cb8431f1a7a2396de92fb66186d8c57df" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.10.0" + json_schema: + dependency: transitive + description: + name: json_schema + sha256: f37d9c3fdfe8c9aae55fdfd5af815d24ce63c3a0f6a2c1f0982c30f43643fa1a + url: "https://pub.dev" + source: hosted + version: "5.2.2" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe" + sha256: "93fba3ad139dab2b1ce59ecc6fdce6da46a42cdb6c4399ecda30f1e7e725760d" url: "https://pub.dev" source: hosted - version: "6.11.1" + version: "6.12.0" leak_tracker: dependency: transitive description: @@ -462,6 +478,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.3" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + ndef_record: + dependency: transitive + description: + name: ndef_record + sha256: c4821a7015944c2e98958b1c5e77845aa63aa27f95998309c5c424b1c6ce8a4a + url: "https://pub.dev" + source: hosted + version: "1.4.1" network_info_plus: dependency: "direct main" description: @@ -478,6 +510,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" + nfc_manager: + dependency: "direct main" + description: + name: nfc_manager + sha256: "24c78b0e5702da53e7f8794d073624c0bee7cd99924f257cbd11f5d1c5866879" + url: "https://pub.dev" + source: hosted + version: "4.1.1" + nfc_manager_ndef: + dependency: "direct main" + description: + name: nfc_manager_ndef + sha256: "8aacee776120b4d09e3049b26cf4a7397fee3abafc207c0640342ada05c5df7d" + url: "https://pub.dev" + source: hosted + version: "1.1.0" nm: dependency: transitive description: @@ -486,6 +534,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "983c7fa1501f6dcc0cb7af4e42072e9993cb28d73604d25ebf4dab08165d997e" + url: "https://pub.dev" + source: hosted + version: "9.2.5" package_config: dependency: transitive description: @@ -514,18 +570,18 @@ packages: dependency: transitive description: name: path_provider_android - sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16 + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e url: "https://pub.dev" source: hosted - version: "2.2.20" + version: "2.2.22" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738 + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -646,6 +702,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.0" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + rfc_6901: + dependency: transitive + description: + name: rfc_6901 + sha256: "6a43b1858dca2febaf93e15639aa6b0c49ccdfd7647775f15a499f872b018154" + url: "https://pub.dev" + source: hosted + version: "0.2.1" shelf: dependency: transitive description: @@ -671,18 +743,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "9098ab86015c4f1d8af6486b547b11100e73b193e1899015033cb3e14ad20243" + sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.2.0" source_helper: dependency: transitive description: name: source_helper - sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" + sha256: "4a85e90b50694e652075cbe4575665539d253e6ec10e46e76b45368ab5e3caae" url: "https://pub.dev" source: hosted - version: "1.3.8" + version: "1.3.10" source_span: dependency: transitive description: @@ -736,10 +808,10 @@ packages: dependency: transitive description: name: system_theme_web - sha256: "900c92c5c050ce58048f241ef9a17e5cd8629808325a05b473dc62a6e99bae77" + sha256: a354b25ff0788ed802b48b632187d344a841b2034f16e4f6cdaa295e4a41a8aa url: "https://pub.dev" source: hosted - version: "0.0.3" + version: "0.0.4" term_glyph: dependency: transitive description: @@ -764,6 +836,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + uri: + dependency: transitive + description: + name: uri + sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a" + url: "https://pub.dev" + source: hosted + version: "1.0.0" vector_math: dependency: transitive description: @@ -784,10 +864,10 @@ packages: dependency: transitive description: name: watcher - sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" url: "https://pub.dev" source: hosted - version: "1.1.4" + version: "1.2.1" web: dependency: transitive description: @@ -845,5 +925,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.9.2 <4.0.0" - flutter: ">=3.35.0" + dart: ">=3.10.3 <4.0.0" + flutter: ">=3.38.4" diff --git a/pubspec.yaml b/pubspec.yaml index 603da58..281d2c6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,21 +38,23 @@ dependencies: git: url: https://github.com/lines-of-codes/system_theme.git path: ./system_theme/ - flutter_secure_storage: ^9.2.4 + flutter_secure_storage: ^10.0.0 esptouch_flutter: git: https://github.com/smaho-engineering/esptouch_flutter.git network_info_plus: ^7.0.0 flutter_localizations: sdk: flutter - intl: any + intl: ^0.20.2 permission_handler: ^12.0.1 - google_fonts: ^6.3.2 + google_fonts: ^8.0.0 path_provider: ^2.1.5 path: ^1.9.1 - json_annotation: ^4.9.0 + json_annotation: ^4.10.0 flutter_speed_dial: ^7.0.0 multicast_dns: ^0.3.3 - http: ^1.5.0 + http: ^1.6.0 + nfc_manager: ^4.1.1 + nfc_manager_ndef: ^1.1.0 dev_dependencies: flutter_test: @@ -64,8 +66,8 @@ dev_dependencies: # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^6.0.0 - json_serializable: ^6.11.1 - build_runner: ^2.10.1 + json_serializable: ^6.12.0 + build_runner: ^2.10.5 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec