From 5da657a73c062b315b09a1002e9a6f3e2ac4f142 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 17 Mar 2024 20:22:46 +0800 Subject: [PATCH] :recycle: Refactored and joined the Solar Network --- README.md | 17 +- android/app/build.gradle | 6 +- android/app/google-services.json | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- .../smartsheep/goatagent/MainActivity.kt | 2 +- android/google-services.json | 2 +- ios/GoogleService-Info.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 20 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Runner/GoogleService-Info.plist | 2 +- ios/Runner/Info.plist | 4 +- lib/auth.dart | 30 ++- lib/firebase_options.dart | 4 +- lib/layouts/navigation.dart | 114 ---------- lib/main.dart | 50 +++-- lib/preferences.dart | 5 + lib/router.dart | 21 ++ lib/screens/about.dart | 6 +- lib/screens/account.dart | 83 ++++---- lib/screens/auth.dart | 6 +- lib/screens/dashboard.dart | 4 +- lib/screens/notifications.dart | 16 +- lib/widgets/name_card.dart | 10 +- lib/widgets/navigation.dart | 38 ++++ linux/CMakeLists.txt | 4 +- linux/my_application.cc | 4 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + macos/Runner.xcodeproj/project.pbxproj | 18 +- .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- macos/Runner/Configs/AppInfo.xcconfig | 6 +- macos/Runner/GoogleService-Info.plist | 2 +- pubspec.lock | 198 +++++++++++++----- pubspec.yaml | 7 +- test/widget_test.dart | 4 +- web/index.html | 6 +- web/manifest.json | 6 +- windows/CMakeLists.txt | 4 +- windows/runner/Runner.rc | 12 +- windows/runner/main.cpp | 2 +- 39 files changed, 386 insertions(+), 345 deletions(-) delete mode 100644 lib/layouts/navigation.dart create mode 100644 lib/preferences.dart create mode 100644 lib/router.dart create mode 100644 lib/widgets/navigation.dart diff --git a/README.md b/README.md index 00f3ec5..1600271 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,3 @@ -# goatagent +# SolarAgent -The official Application of Goatworks Global Hydrogen Network - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +The official Solar Network moblie application. \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 089b185..0705144 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -23,7 +23,7 @@ if (flutterVersionName == null) { } android { - namespace "studio.smartsheep.goatagent" + namespace "dev.solsynth.solaragent" compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion @@ -41,7 +41,7 @@ android { } defaultConfig { - applicationId "studio.smartsheep.goatagent" + applicationId "dev.solsynth.solaragent" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion @@ -50,7 +50,7 @@ android { versionName flutterVersionName manifestPlaceholders = [ applicationName : 'android.app.Application', - appAuthRedirectScheme: 'goatagent' + appAuthRedirectScheme: 'solaragent' ] } diff --git a/android/app/google-services.json b/android/app/google-services.json index c39bfb1..14e8c7b 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -9,7 +9,7 @@ "client_info": { "mobilesdk_app_id": "1:659822066072:android:39e699282c97a7cfc013ed", "android_client_info": { - "package_name": "studio.smartsheep.goatagent" + "package_name": "dev.solsynth.solaragent" } }, "oauth_client": [ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 007acae..813bfbb 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ PLIST_VERSION 1 BUNDLE_ID - studio.smartsheep.goatagent + dev.solsynth.solaragent PROJECT_ID smartsheep-hydrogen STORAGE_BUCKET diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 3fe0306..643db12 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -221,7 +221,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -505,14 +505,14 @@ DEVELOPMENT_TEAM = W7HPZ53V6B; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = GoatAgent; + INFOPLIST_KEY_CFBundleDisplayName = SolarAgent; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -529,7 +529,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -547,7 +547,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -563,7 +563,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -694,14 +694,14 @@ DEVELOPMENT_TEAM = W7HPZ53V6B; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = GoatAgent; + INFOPLIST_KEY_CFBundleDisplayName = SolarAgent; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -721,14 +721,14 @@ DEVELOPMENT_TEAM = W7HPZ53V6B; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = GoatAgent; + INFOPLIST_KEY_CFBundleDisplayName = SolarAgent; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a0..8e3ca5d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ PLIST_VERSION 1 BUNDLE_ID - studio.smartsheep.goatagent + dev.solsynth.solaragent PROJECT_ID smartsheep-hydrogen STORAGE_BUCKET diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 606c466..fce7f55 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -7,7 +7,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - GoatAgent + SolarAgent CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +15,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - GoatAgent + SolarAgent CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/auth.dart b/lib/auth.dart index 572f421..cbebc15 100644 --- a/lib/auth.dart +++ b/lib/auth.dart @@ -3,34 +3,33 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:goatagent/firebase.dart'; -import 'package:goatagent/screens/auth.dart'; +import 'package:solaragent/firebase.dart'; +import 'package:solaragent/preferences.dart'; +import 'package:solaragent/screens/auth.dart'; import 'package:oauth2/oauth2.dart' as oauth2; +final authClient = AuthGuard(); + class AuthGuard { - static final AuthGuard _singleton = AuthGuard._internal(); + AuthGuard(); final deviceEndpoint = - Uri.parse('https://id.smartsheep.studio/api/notifications/subscribe'); + Uri.parse('https://id.solsynth.dev/api/notifications/subscribe'); final authorizationEndpoint = - Uri.parse('https://id.smartsheep.studio/auth/o/connect'); + Uri.parse('https://id.solsynth.dev/auth/o/connect'); final tokenEndpoint = - Uri.parse('https://id.smartsheep.studio/api/auth/token'); + Uri.parse('https://id.solsynth.dev/api/auth/token'); final userinfoEndpoint = - Uri.parse('https://id.smartsheep.studio/api/users/me'); - final redirectUrl = Uri.parse('goatagent://auth'); + Uri.parse('https://id.solsynth.dev/api/users/me'); + final redirectUrl = Uri.parse('solaragent://auth'); - static const clientId = "goatagent"; + static const clientId = "solaragent"; static const clientSecret = "_F4%q2Eea3"; static const storage = FlutterSecureStorage(); static const storageKey = "identity"; static const profileKey = "profiles"; - factory AuthGuard() { - return _singleton; - } - oauth2.Client? client; Future pickClient() async { @@ -68,11 +67,6 @@ class AuthGuard { var authorizationUrl = grant.getAuthorizationUrl(redirectUrl); if (Platform.isAndroid || Platform.isIOS) { - // Let Goatpass know it is embed in an app - authorizationUrl = authorizationUrl.replace( - queryParameters: {"embedded": "yes"} - ..addAll(authorizationUrl.queryParameters)); - // Use WebView to get authorization url var responseUrl = await Navigator.of(context, rootNavigator: true).push( MaterialPageRoute( diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index 3b7f5d9..91ce758 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -67,7 +67,7 @@ class DefaultFirebaseOptions { messagingSenderId: '659822066072', projectId: 'smartsheep-hydrogen', storageBucket: 'smartsheep-hydrogen.appspot.com', - iosBundleId: 'studio.smartsheep.goatagent', + iosBundleId: 'dev.solsynth.solaragent', ); static const FirebaseOptions macos = FirebaseOptions( @@ -76,6 +76,6 @@ class DefaultFirebaseOptions { messagingSenderId: '659822066072', projectId: 'smartsheep-hydrogen', storageBucket: 'smartsheep-hydrogen.appspot.com', - iosBundleId: 'studio.smartsheep.goatagent.RunnerTests', + iosBundleId: 'dev.solsynth.solaragent.RunnerTests', ); } diff --git a/lib/layouts/navigation.dart b/lib/layouts/navigation.dart deleted file mode 100644 index c894a36..0000000 --- a/lib/layouts/navigation.dart +++ /dev/null @@ -1,114 +0,0 @@ -import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; -import 'package:goatagent/screens/account.dart'; -import 'package:goatagent/screens/dashboard.dart'; -import 'package:goatagent/screens/notifications.dart'; - -class AgentNavigation extends StatefulWidget { - AgentNavigation({super.key}); - - static const items = [ - {'label': 'Dashboard', 'icon': Icon(Icons.home)}, - {'label': 'Notifications', 'icon': Icon(Icons.notifications)}, - {'label': 'Account', 'icon': Icon(Icons.account_circle)}, - ]; - - final bottomDestinations = items - .map((element) => BottomNavigationBarItem( - icon: element["icon"] as Widget, - label: element["label"] as String, - )) - .toList(); - final railDestinations = items - .map((element) => NavigationRailDestination( - icon: element["icon"] as Widget, - label: Text(element["label"] as String), - )) - .toList(); - - @override - State createState() => _AgentNavigationState(); -} - -class _AgentNavigationState extends State { - int _view = 0; - - Future initMessage(BuildContext context) async { - void navigate() { - setState(() { - _view = 1; - }); - } - - RemoteMessage? initialMessage = - await FirebaseMessaging.instance.getInitialMessage(); - - if (initialMessage != null) { - navigate(); - } - - FirebaseMessaging.onMessageOpenedApp.listen((event) { - navigate(); - }); - } - - @override - void initState() { - super.initState(); - initMessage(context); - } - - @override - Widget build(BuildContext context) { - final isLargeScreen = MediaQuery.of(context).size.width > 640; - - final content = Stack( - children: [ - Offstage( - offstage: _view != 0, - child: const DashboardScreen(), - ), - Offstage( - offstage: _view != 1, - child: const NotificationScreen(), - ), - Offstage( - offstage: _view != 2, - child: const AccountScreen(), - ) - ], - ); - - if (isLargeScreen) { - return Row(children: [ - NavigationRail( - selectedIndex: _view, - groupAlignment: 0, - onDestinationSelected: (int index) { - setState(() { - _view = index; - }); - }, - labelType: NavigationRailLabelType.all, - destinations: widget.railDestinations, - ), - const VerticalDivider(thickness: 1, width: 1), - Expanded(child: content), - ]); - } else { - return Scaffold( - body: content, - bottomNavigationBar: BottomNavigationBar( - currentIndex: _view, - showUnselectedLabels: false, - items: widget.bottomDestinations, - onTap: (index) { - setState(() { - _view = index; - }); - }, - ), - ); - } - } -} diff --git a/lib/main.dart b/lib/main.dart index 36ba29d..8d084c5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:goatagent/auth.dart'; -import 'package:goatagent/firebase.dart'; - -import 'layouts/navigation.dart'; +import 'package:solaragent/auth.dart'; +import 'package:solaragent/firebase.dart'; +import 'package:solaragent/router.dart'; +import 'package:solaragent/widgets/navigation.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -13,39 +13,51 @@ void main() async { print(e); } - await AuthGuard().pickClient(); + await authClient.pickClient(); - runApp(const GoatAgent()); + runApp(const SolarAgent()); } -class GoatAgent extends StatelessWidget { - const GoatAgent({super.key}); +class SolarAgent extends StatelessWidget { + const SolarAgent({super.key}); @override Widget build(BuildContext context) { - return MaterialApp( - title: 'GoatAgent', + return MaterialApp.router( + title: 'SolarAgent', theme: ThemeData( brightness: Brightness.light, colorScheme: ColorScheme.fromSwatch( - primarySwatch: Colors.indigo, - accentColor: Colors.indigoAccent, - backgroundColor: Colors.white, - brightness: Brightness.light, + primarySwatch: Colors.indigo, + accentColor: Colors.indigoAccent, + backgroundColor: Colors.white, + brightness: Brightness.light, ), useMaterial3: true, ), darkTheme: ThemeData( brightness: Brightness.dark, colorScheme: ColorScheme.fromSwatch( - primarySwatch: Colors.indigo, - accentColor: Colors.indigoAccent, - backgroundColor: Colors.black, - brightness: Brightness.dark, + primarySwatch: Colors.indigo, + accentColor: Colors.indigoAccent, + backgroundColor: Colors.black, + brightness: Brightness.dark, ), useMaterial3: true, ), - home: AgentNavigation(), + routerConfig: router, + builder: (context, child) => Overlay( + initialEntries: [ + OverlayEntry( + builder: (context) => SafeArea( + child: Scaffold( + body: child, + bottomNavigationBar: const AgentNavigation(), + ), + ), + ) + ], + ), ); } } diff --git a/lib/preferences.dart b/lib/preferences.dart new file mode 100644 index 0000000..46ed279 --- /dev/null +++ b/lib/preferences.dart @@ -0,0 +1,5 @@ +import 'package:shared_preferences/shared_preferences.dart'; + +getPreferences() async { + return await SharedPreferences.getInstance(); +} diff --git a/lib/router.dart b/lib/router.dart new file mode 100644 index 0000000..736ab5f --- /dev/null +++ b/lib/router.dart @@ -0,0 +1,21 @@ +import 'package:go_router/go_router.dart'; +import 'package:solaragent/screens/account.dart'; +import 'package:solaragent/screens/dashboard.dart'; +import 'package:solaragent/screens/notifications.dart'; + +final router = GoRouter( + routes: [ + GoRoute( + path: '/', + builder: (context, state) => const DashboardScreen(), + ), + GoRoute( + path: '/notifications', + builder: (context, state) => const NotificationScreen(), + ), + GoRoute( + path: '/account', + builder: (context, state) => const AccountScreen(), + ) + ], +); \ No newline at end of file diff --git a/lib/screens/about.dart b/lib/screens/about.dart index f9f18c2..949851b 100644 --- a/lib/screens/about.dart +++ b/lib/screens/about.dart @@ -16,9 +16,9 @@ class AboutScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('GoatAgent', + Text('SolarAgent', style: Theme.of(context).textTheme.headlineMedium), - Text('Goatworks Official Mobile Helper', + Text('Solarworks Official Mobile Helper', style: Theme.of(context).textTheme.bodyLarge), const SizedBox(height: 20), FutureBuilder( @@ -37,7 +37,7 @@ class AboutScreen extends StatelessWidget { const SizedBox(height: 10), MaterialButton( onPressed: () async { - await launchUrl(Uri.parse('https://smartsheep.studio')); + await launchUrl(Uri.parse('https://solsynth.dev')); }, child: const Text('Official Website'), ), diff --git a/lib/screens/account.dart b/lib/screens/account.dart index 7855340..3c26026 100644 --- a/lib/screens/account.dart +++ b/lib/screens/account.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:goatagent/auth.dart'; -import 'package:goatagent/screens/about.dart'; -import 'package:goatagent/widgets/name_card.dart'; +import 'package:solaragent/auth.dart'; +import 'package:solaragent/screens/about.dart'; +import 'package:solaragent/widgets/name_card.dart'; class AccountScreen extends StatefulWidget { const AccountScreen({super.key}); @@ -17,7 +17,7 @@ class _AccountScreenState extends State { @override void initState() { super.initState(); - AuthGuard().isAuthorized().then((value) { + authClient.isAuthorized().then((value) { setState(() { isAuthorized = value; }); @@ -35,8 +35,8 @@ class _AccountScreenState extends State { padding: const EdgeInsets.only(top: 20), child: NameCard( onLogin: () async { - await AuthGuard().login(context); - var authorized = await AuthGuard().isAuthorized(); + await authClient.login(context); + var authorized = await authClient.isAuthorized(); setState(() { isAuthorized = authorized; }); @@ -49,44 +49,43 @@ class _AccountScreenState extends State { spacing: 5, children: [ FutureBuilder( - future: AuthGuard().isAuthorized(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData && snapshot.data == true) { - return Card( - elevation: 0, - child: InkWell( - splashColor: Colors.indigo.withAlpha(30), - onTap: () async { - AuthGuard().logout(); - var authorized = await AuthGuard().isAuthorized(); - setState(() { - isAuthorized = authorized; - }); - }, - child: const ListTile( - leading: Icon(Icons.logout), - title: Text('Logout'), - ), - ), - ); - } else { - return Container(); - } + future: authClient.isAuthorized(), + builder: + (BuildContext context, AsyncSnapshot snapshot) { + return (snapshot.hasData && snapshot.data == true) + ? InkWell( + borderRadius: + const BorderRadius.all(Radius.circular(40)), + splashColor: Colors.indigo.withAlpha(30), + onTap: () async { + authClient.logout(); + var authorized = + await authClient.isAuthorized(); + setState(() { + isAuthorized = authorized; + }); + }, + child: const ListTile( + leading: Icon(Icons.logout), + title: Text('Logout'), + ), + ) + : Container(); }, ), - Card( - elevation: 0, - child: InkWell( - splashColor: Colors.indigo.withAlpha(30), - onTap: () { - Navigator.push(context, MaterialPageRoute( - builder: (context) => const AboutScreen(), - )); - }, - child: const ListTile( - leading: Icon(Icons.info_outline), - title: Text('About'), - ), + InkWell( + borderRadius: const BorderRadius.all(Radius.circular(40)), + splashColor: Colors.indigo.withAlpha(30), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const AboutScreen(), + )); + }, + child: const ListTile( + leading: Icon(Icons.info_outline), + title: Text('About'), ), ), ], diff --git a/lib/screens/auth.dart b/lib/screens/auth.dart index d764b8a..53b0c77 100644 --- a/lib/screens/auth.dart +++ b/lib/screens/auth.dart @@ -11,7 +11,7 @@ class AuthorizationScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Connect with Goatpass'), + title: const Text('Sign in'), ), body: Stack(children: [ WebViewWidget( @@ -20,10 +20,10 @@ class AuthorizationScreen extends StatelessWidget { ..setBackgroundColor(Colors.white) ..setNavigationDelegate(NavigationDelegate( onNavigationRequest: (NavigationRequest request) { - if (request.url.startsWith('goatagent://auth')) { + if (request.url.startsWith('solaragent://auth')) { Navigator.of(context).pop(request.url); return NavigationDecision.prevent; - } else if (request.url.startsWith("https://id.smartsheep.studio/auth/register")) { + } else if (request.url.startsWith("https://solsynth.dev/auth/sign-up")) { launchUrl(Uri.parse(request.url)); return NavigationDecision.prevent; } diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index ee89c90..ec88a89 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:goatagent/screens/application.dart'; +import 'package:solaragent/screens/application.dart'; import 'package:http/http.dart' as http; class DashboardScreen extends StatefulWidget { @@ -14,7 +14,7 @@ class DashboardScreen extends StatefulWidget { class _DashboardScreenState extends State { final client = http.Client(); final directoryEndpoint = - Uri.parse('https://id.smartsheep.studio/.well-known'); + Uri.parse('https://id.solsynth.dev/.well-known'); List directory = List.empty(); diff --git a/lib/screens/notifications.dart b/lib/screens/notifications.dart index b6c63fe..c797665 100644 --- a/lib/screens/notifications.dart +++ b/lib/screens/notifications.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:goatagent/auth.dart'; +import 'package:solaragent/auth.dart'; class NotificationScreen extends StatefulWidget { const NotificationScreen({super.key}); @@ -12,7 +12,7 @@ class NotificationScreen extends StatefulWidget { class _NotificationScreenState extends State { final notificationEndpoint = Uri.parse( - 'https://id.smartsheep.studio/api/notifications?skip=0&take=20'); + 'https://id.solsynth.dev/api/notifications?skip=0&take=25'); List notifications = List.empty(); @@ -23,9 +23,9 @@ class _NotificationScreenState extends State { } Future _pullNotifications() async { - if (await AuthGuard().isAuthorized()) { - await AuthGuard().pullProfiles(); - var profiles = await AuthGuard().readProfiles(); + if (await authClient.isAuthorized()) { + await authClient.pullProfiles(); + var profiles = await authClient.readProfiles(); setState(() { notifications = profiles['notifications']; }); @@ -33,11 +33,11 @@ class _NotificationScreenState extends State { } Future _markAsRead(element) async { - if (AuthGuard().client != null) { + if (authClient.client != null) { var id = element['id']; var uri = - Uri.parse('https://id.smartsheep.studio/api/notifications/$id/read'); - await AuthGuard().client!.put(uri); + Uri.parse('https://id.solsynth.dev/api/notifications/$id/read'); + await authClient.client!.put(uri); } } diff --git a/lib/widgets/name_card.dart b/lib/widgets/name_card.dart index 0b93d2a..f6dfab5 100644 --- a/lib/widgets/name_card.dart +++ b/lib/widgets/name_card.dart @@ -12,8 +12,8 @@ class NameCard extends StatelessWidget { final void Function()? onCheck; Future _getAvatar() async { - if (await AuthGuard().isAuthorized()) { - final profiles = await AuthGuard().readProfiles(); + if (await authClient.isAuthorized()) { + final profiles = await authClient.readProfiles(); return CircleAvatar(backgroundImage: NetworkImage(profiles["picture"])); } else { return const CircleAvatar(child: Icon(Icons.account_circle)); @@ -21,8 +21,8 @@ class NameCard extends StatelessWidget { } Future _getDescribe() async { - if (await AuthGuard().isAuthorized()) { - final profiles = await AuthGuard().readProfiles(); + if (await authClient.isAuthorized()) { + final profiles = await authClient.readProfiles(); return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -59,7 +59,7 @@ class NameCard extends StatelessWidget { child: InkWell( splashColor: Colors.indigo.withAlpha(30), onTap: () async { - if (await AuthGuard().isAuthorized() && onCheck != null) { + if (await authClient.isAuthorized() && onCheck != null) { onCheck!(); } else if (onLogin != null) { onLogin!(); diff --git a/lib/widgets/navigation.dart b/lib/widgets/navigation.dart new file mode 100644 index 0000000..0761012 --- /dev/null +++ b/lib/widgets/navigation.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:solaragent/router.dart'; + +class AgentNavigation extends StatefulWidget { + const AgentNavigation({super.key}); + + static const List<(String, NavigationDestination)> destinations = [ + ('/', NavigationDestination(icon: Icon(Icons.home), label: 'Home')), + ('/notifications', NavigationDestination(icon: Icon(Icons.notifications), label: 'Notifications')), + ('/account', NavigationDestination(icon: Icon(Icons.account_circle), label: 'Account')), + ]; + + @override + State createState() => _AgentNavigationState(); +} + +class _AgentNavigationState extends State { + int currentPage = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return NavigationBar( + selectedIndex: currentPage, + destinations: AgentNavigation.destinations + .map(((String, NavigationDestination) e) => e.$2) + .toList(), + onDestinationSelected: (index) { + router.go(AgentNavigation.destinations[index].$1); + setState(() => currentPage = index); + }, + ); + } +} diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index e53242f..74639d1 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "goatagent") +set(BINARY_NAME "solaragent") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "studio.smartsheep.goatagent") +set(APPLICATION_ID "dev.solsynth.solaragent") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/linux/my_application.cc b/linux/my_application.cc index 4ceef2f..292e468 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "goatagent"); + gtk_header_bar_set_title(header_bar, "solaragent"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "goatagent"); + gtk_window_set_title(window, "solaragent"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 2bb1105..0259140 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import flutter_appauth import flutter_secure_storage_macos import package_info_plus import path_provider_foundation +import shared_preferences_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { @@ -22,5 +23,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 3402aeb..9db748b 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -65,7 +65,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* goatagent.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = goatagent.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* solaragent.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = solaragent.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -134,7 +134,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* goatagent.app */, + 33CC10ED2044A3C60003C045 /* solaragent.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -220,7 +220,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* goatagent.app */; + productReference = 33CC10ED2044A3C60003C045 /* solaragent.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -388,10 +388,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/goatagent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/goatagent"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/solaragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/solaragent"; }; name = Debug; }; @@ -402,10 +402,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/goatagent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/goatagent"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/solaragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/solaragent"; }; name = Release; }; @@ -416,10 +416,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/goatagent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/goatagent"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/solaragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/solaragent"; }; name = Profile; }; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index d455be2..7b8585e 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -65,7 +65,7 @@ @@ -82,7 +82,7 @@ diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index b2138b0..a738004 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = goatagent +PRODUCT_NAME = solaragent // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = studio.smartsheep.goatagent +PRODUCT_BUNDLE_IDENTIFIER = dev.solsynth.solaragent // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 studio.smartsheep. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2024 dev.solsynth. All rights reserved. diff --git a/macos/Runner/GoogleService-Info.plist b/macos/Runner/GoogleService-Info.plist index 7cc83ae..8310743 100644 --- a/macos/Runner/GoogleService-Info.plist +++ b/macos/Runner/GoogleService-Info.plist @@ -9,7 +9,7 @@ PLIST_VERSION 1 BUNDLE_ID - studio.smartsheep.goatagent.RunnerTests + dev.solsynth.solaragent.RunnerTests PROJECT_ID smartsheep-hydrogen STORAGE_BUCKET diff --git a/pubspec.lock b/pubspec.lock index fc3d90c..dd2b69b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "1a52f1afae8ab7ac4741425114713bdbba802f1ce1e0648e167ffcc6e05e96cf" + sha256: "4eec93681221723a686ad580c2e7d960e1017cf1a4e0a263c2573c2c6b0bf5cd" url: "https://pub.dev" source: hosted - version: "1.3.21" + version: "1.3.25" archive: dependency: transitive description: @@ -117,18 +117,26 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "7e049e32a9d347616edb39542cf92cd53fdb4a99fb6af0a0bff327c14cd76445" + sha256: "53316975310c8af75a96e365f9fccb67d1c544ef0acdbf0d88bbe30eedd1c4f9" url: "https://pub.dev" source: hosted - version: "2.25.4" + version: "2.27.0" firebase_core_platform_interface: dependency: transitive description: @@ -141,50 +149,50 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "57e61d6010e253b36d38191cefd6199d7849152cdcd234b61ca290cdb278a0ba" + sha256: c8e1d59385eee98de63c92f961d2a7062c5d9a65e7f45bdc7f1b0b205aab2492 url: "https://pub.dev" source: hosted - version: "2.11.4" + version: "2.11.5" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - sha256: efd096e4c3d2c568e128505b6e4ce5f5d5a1629f700a4d6fee6bd25b85937dde + sha256: c4f1b723d417bc9c4774810e774ff91df8fb0032d33fb2888b2c887e865581b8 url: "https://pub.dev" source: hosted - version: "3.4.14" + version: "3.4.18" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "225a54d834a118be262c1f1096d407515e35b99d9b474c987abdcff7663f2b81" + sha256: c5a11fca3df76a98e3fa68fde8b10a08aacb9a7639f619fbfd4dad6c67a08643 url: "https://pub.dev" source: hosted - version: "3.6.21" + version: "3.6.25" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: "9c97b20c012542252a8853f11334efd833ddae83551fe37d27f87d885c655038" + sha256: e41586e0fd04fe9a40424f8b0053d0832e6d04f49e020cdaf9919209a28497e9 url: "https://pub.dev" source: hosted - version: "14.7.15" + version: "14.7.19" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: d464b255e922c7915dc4b0ebc305ebad4e1f130519bee3d6e568ef2ea1613a4b + sha256: f7a9d74ff7fc588a924f6b2eaeaa148b0db521b13a9db55f6ad45864fa98c06e url: "https://pub.dev" source: hosted - version: "4.5.23" + version: "4.5.27" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: f3f71aeec719ec1fe2c99f75cd74d00d33f1c240cf1e402cc9d43883e84f935a + sha256: fc21e771166860c55b103701c5ac7cdb2eec28897b97c42e6e5703cbedf9e02e url: "https://pub.dev" source: hosted - version: "3.6.4" + version: "3.6.8" flutter: dependency: "direct main" description: flutter @@ -194,10 +202,10 @@ packages: dependency: "direct main" description: name: flutter_appauth - sha256: "4ad7d446888b1486642226db6aa04ffb4651d76388715aba6e6e572ebeb915c3" + sha256: "6aca161b2a1758478a13f758897fc98688277951dafb4b7e62729c1dfbcefdaa" url: "https://pub.dev" source: hosted - version: "6.0.4" + version: "6.0.5" flutter_appauth_platform_interface: dependency: transitive description: @@ -284,10 +292,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "07ee2436909f749d606f53521dc1725dd738dc5196e5ff815bc254253c594075" + sha256: "7ecb2f391edbca5473db591b48555a8912dde60edd0fb3013bd6743033b2d3f8" url: "https://pub.dev" source: hosted - version: "13.1.0" + version: "13.2.1" http: dependency: "direct main" description: @@ -308,10 +316,10 @@ packages: dependency: transitive description: name: image - sha256: "49a0d4b0c12402853d3f227fe7c315601b238d126aa4caa5dbb2dcf99421aa4a" + sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e" url: "https://pub.dev" source: hosted - version: "4.1.6" + version: "4.1.7" js: dependency: transitive description: @@ -328,6 +336,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: @@ -348,26 +380,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" oauth2: dependency: "direct main" description: @@ -396,10 +428,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: @@ -480,6 +512,62 @@ packages: url: "https://pub.dev" source: hosted version: "3.7.4" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + 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: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" + url: "https://pub.dev" + source: hosted + version: "2.3.5" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" + source: hosted + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -545,26 +633,26 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c + sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" url: "https://pub.dev" source: hosted - version: "6.2.4" + version: "6.2.5" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" + sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03" + sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5" url: "https://pub.dev" source: hosted - version: "6.2.4" + version: "6.2.5" url_launcher_linux: dependency: transitive description: @@ -585,10 +673,10 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: @@ -613,30 +701,38 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" web: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.4.2" webview_flutter: dependency: "direct main" description: name: webview_flutter - sha256: d81b68e88cc353e546afb93fb38958e3717282c5ac6e5d3be4a4aef9fc3c1413 + sha256: "25e1b6e839e8cbfbd708abc6f85ed09d1727e24e08e08c6b8590d7c65c9a8932" url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.7.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "4ea3c4e1b8ed590162b15b8a61b41b1ef3ff179a314627c16ce40c086d94b8af" + sha256: f038ee2fae73b509dde1bc9d2c5a50ca92054282de17631a9a3d515883740934 url: "https://pub.dev" source: hosted - version: "3.14.0" + version: "3.16.0" webview_flutter_platform_interface: dependency: transitive description: @@ -649,18 +745,18 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: b99ca8d8bae9c6b43d568218691aa537fb0aeae1d7d34eadf112a6aa36d26506 + sha256: f12f8d8a99784b863e8b85e4a9a5e3cf1839d6803d2c0c3e0533a8f3c5a992a7 url: "https://pub.dev" source: hosted - version: "3.11.0" + version: "3.13.0" win32: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480" url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.3.0" xdg_directories: dependency: transitive description: @@ -686,5 +782,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.6 <4.0.0" + dart: ">=3.3.0 <4.0.0" flutter: ">=3.16.6" diff --git a/pubspec.yaml b/pubspec.yaml index bc43f95..e68c0f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ -name: goatagent -description: "The official Application of Goatworks Global Hydrogen Network" +name: solaragent +description: "The official Application of Solarworks Global Hydrogen Network" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -43,9 +43,10 @@ dependencies: oauth2: ^2.0.2 http: ^1.2.0 webview_flutter: ^4.5.0 - go_router: ^13.1.0 + go_router: ^13.2.1 package_info_plus: ^5.0.1 url_launcher: ^6.2.4 + shared_preferences: ^2.2.2 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart index e1f7dac..0577e02 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,12 +8,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:goatagent/main.dart'; +import 'package:solaragent/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const GoatAgent()); + await tester.pumpWidget(const SolarAgent()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); diff --git a/web/index.html b/web/index.html index f711b59..04f929e 100644 --- a/web/index.html +++ b/web/index.html @@ -18,18 +18,18 @@ - + - + - goatagent + solaragent