6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 405c0259
Changed files
.../android/app/src/main/AndroidManifest.xml | 2 +- .../lib/components/comwell_app_bar.dart | 27 ++---------- .../lib/components/round_icon_button.dart | 24 +++++++++++ .../lib/key/repository/key_repository.dart | 1 - comwell_key_app/lib/profile/profile_page.dart | 49 ++++++++++++++++++++++ comwell_key_app/lib/routing/app_router.dart | 10 +++++ comwell_key_app/lib/routing/app_routes.dart | 2 +- comwell_key_app/lib/services/api.dart | 12 ++++++ comwell_key_app/lib/services/http_client.dart | 2 +- comwell_key_app/macos/Podfile.lock | 13 ++++++ 10 files changed, 115 insertions(+), 27 deletions(-)
Diff
diff --git a/comwell_key_app/android/app/src/main/AndroidManifest.xml b/comwell_key_app/android/app/src/main/AndroidManifest.xml
index 74cadfbf..a9de579b 100644
--- a/comwell_key_app/android/app/src/main/AndroidManifest.xml
+++ b/comwell_key_app/android/app/src/main/AndroidManifest.xml
@@ -33,7 +33,7 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
- <data android:scheme="https" android:host="com.comwell.app" />
+ <data android:scheme="msauth" android:host="msal40304e05-f354-49b2-9934-1b42f311751a" android:path="/auth" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
diff --git a/comwell_key_app/lib/components/comwell_app_bar.dart b/comwell_key_app/lib/components/comwell_app_bar.dart
index 7191a840..1206f883 100644
--- a/comwell_key_app/lib/components/comwell_app_bar.dart
+++ b/comwell_key_app/lib/components/comwell_app_bar.dart
@@ -1,5 +1,8 @@
+import 'package:comwell_key_app/components/round_icon_button.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
class ComwellAppBar extends StatelessWidget implements PreferredSizeWidget {
final bool shouldShowAppBar;
@@ -30,6 +33,7 @@ class ComwellAppBar extends StatelessWidget implements PreferredSizeWidget {
Navigator.of(context).pop();
}),
RoundIconButton(icon: Icons.person_2_outlined, onPressed: () {
+ context.goNamed(AppRoutes.profile.name);
//profile
}),
],
@@ -40,26 +44,3 @@ class ComwellAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
Size get preferredSize => const Size.fromHeight(112);
}
-
-class RoundIconButton extends StatelessWidget {
- final IconData icon;
- final Function onPressed;
- const RoundIconButton({
- required this.icon,
- required this.onPressed,
- super.key,
- });
-
- @override
- Widget build(BuildContext context) {
- return ElevatedButton(
- onPressed: () {onPressed();},
- style: ElevatedButton.styleFrom(
- elevation: 0,
- backgroundColor: Colors.white,
- shape: const CircleBorder(side: BorderSide(style: BorderStyle.none)),
- ),
- child: Icon(icon, color: Colors.black),
- );
- }
-}
diff --git a/comwell_key_app/lib/components/round_icon_button.dart b/comwell_key_app/lib/components/round_icon_button.dart
new file mode 100644
index 00000000..1af88101
--- /dev/null
+++ b/comwell_key_app/lib/components/round_icon_button.dart
@@ -0,0 +1,24 @@
+import 'package:flutter/material.dart';
+
+class RoundIconButton extends StatelessWidget {
+ final IconData icon;
+ final Function onPressed;
+ const RoundIconButton({
+ required this.icon,
+ required this.onPressed,
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return ElevatedButton(
+ onPressed: () {onPressed();},
+ style: ElevatedButton.styleFrom(
+ elevation: 0,
+ backgroundColor: Colors.white,
+ shape: const CircleBorder(side: BorderSide(style: BorderStyle.none)),
+ ),
+ child: Icon(icon, color: Colors.black),
+ );
+ }
+}
diff --git a/comwell_key_app/lib/key/repository/key_repository.dart b/comwell_key_app/lib/key/repository/key_repository.dart
index 9e3e6e29..5adbe7aa 100644
--- a/comwell_key_app/lib/key/repository/key_repository.dart
+++ b/comwell_key_app/lib/key/repository/key_repository.dart
@@ -85,7 +85,6 @@ class KeyRepository {
try {
await seosMobileKeysPlugin.openClosestReader();
} catch (e) {
- print(e.toString());
//throw Exception('Failed to open closest reader - ${e.toString()}');
}
}
diff --git a/comwell_key_app/lib/profile/profile_page.dart b/comwell_key_app/lib/profile/profile_page.dart
new file mode 100644
index 00000000..67825d58
--- /dev/null
+++ b/comwell_key_app/lib/profile/profile_page.dart
@@ -0,0 +1,49 @@
+import 'package:comwell_key_app/components/round_icon_button.dart';
+import 'package:comwell_key_app/themes/light_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
+
+class ProfilePage extends StatelessWidget {
+
+ const ProfilePage({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: sandColor[40],
+ body: Stack(
+ children: [
+ const Center(
+ child: Text('Profile Information'),
+ ),
+ Positioned(
+ bottom: 20,
+ left: 0,
+ right: 0,
+ child: Center(
+ child: ElevatedButton(
+ onPressed: () {
+
+ },
+ child: const Text('Logout'),
+ ),
+ ),
+ ),
+ Positioned(
+ top: 60,
+ right: 10,
+ child: RoundIconButton(icon: Icons.close, onPressed: () {
+ context.pop();
+ }),),
+ ],
+ ),
+
+ );
+ }
+}
+
+void main() {
+ runApp(const MaterialApp(
+ home: ProfilePage(),
+ ));
+}
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index 9e991fb1..477b06df 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -1,5 +1,7 @@
import 'package:comwell_key_app/home/home_page.dart';
+import 'package:comwell_key_app/key/key_page.dart';
import 'package:comwell_key_app/login/login_page.dart';
+import 'package:comwell_key_app/profile/profile_page.dart';
import 'package:comwell_key_app/redeem_debug/redeem_page.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/welcome/welcome_page.dart';
@@ -32,7 +34,15 @@ GoRouter goRouter() {
return const KeyPage(); //mobileKey: key);
},
),
+ GoRoute(
+ path: "profile",
+ name: AppRoutes.profile.name,
+ builder: (context, state) {
+ return const ProfilePage(); //mobileKey: key);
+ },
+ )
]),
+ GoRoute(
path: "/login",
name: AppRoutes.login.name,
builder: (context, state) => const LoginPage(),
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index 81ee4f0e..4b934089 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -13,5 +13,5 @@ enum AppRoutes {
key,
keys,
settings,
- login, sheet,
+ login, sheet, profile,
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index be1bbc05..fd80feb0 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -14,4 +14,16 @@ class Api {
}
}
+
+Future<bool> logout () async {
+ try {
+ Response<dynamic> response = await dio.post('/logout');
+ if (response.statusCode == 200) {
+ return true;
+ }
+ return false;
+ } catch (e) {
+ throw Exception('Failed to logout - ${e.toString()}');
+ }
+ }
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/services/http_client.dart b/comwell_key_app/lib/services/http_client.dart
index f0bf1a30..df6de195 100644
--- a/comwell_key_app/lib/services/http_client.dart
+++ b/comwell_key_app/lib/services/http_client.dart
@@ -13,7 +13,7 @@ class HttpClient {
static Dio _createDio() {
var dio = Dio(
BaseOptions(
- baseUrl: "https://apidev.eldicare.vn/api/",
+ baseUrl: "https://",
receiveTimeout: const Duration(milliseconds: 5000),
connectTimeout: const Duration(milliseconds: 5000),
sendTimeout: const Duration(milliseconds: 5000),
diff --git a/comwell_key_app/macos/Podfile.lock b/comwell_key_app/macos/Podfile.lock
index 19686394..d606a6c2 100644
--- a/comwell_key_app/macos/Podfile.lock
+++ b/comwell_key_app/macos/Podfile.lock
@@ -1,4 +1,6 @@
PODS:
+ - device_info_plus (0.0.1):
+ - FlutterMacOS
- flutter_secure_storage_macos (6.1.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
@@ -8,14 +10,21 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
+ - webview_flutter_wkwebview (0.0.1):
+ - Flutter
+ - FlutterMacOS
DEPENDENCIES:
+ - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
- flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
+ - webview_flutter_wkwebview (from `Flutter/ephemeral/.symlinks/plugins/webview_flutter_wkwebview/darwin`)
EXTERNAL SOURCES:
+ device_info_plus:
+ :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
flutter_secure_storage_macos:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos
FlutterMacOS:
@@ -24,12 +33,16 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
+ webview_flutter_wkwebview:
+ :path: Flutter/ephemeral/.symlinks/plugins/webview_flutter_wkwebview/darwin
SPEC CHECKSUMS:
+ device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720
flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
+ webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367