6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 47dc358b
Changed files
.../lib/profile/cubit/profile_cubit.dart | 5 +- comwell_key_app/lib/profile/profile_page.dart | 61 +--------------------- 2 files changed, 3 insertions(+), 63 deletions(-)
Diff
diff --git a/comwell_key_app/lib/profile/cubit/profile_cubit.dart b/comwell_key_app/lib/profile/cubit/profile_cubit.dart
index 94f6cded..348cd0d5 100644
--- a/comwell_key_app/lib/profile/cubit/profile_cubit.dart
+++ b/comwell_key_app/lib/profile/cubit/profile_cubit.dart
@@ -26,7 +26,8 @@ class ProfileCubit extends Cubit<ProfileState> {
}
void deleteAllInfoOnLogOut() async {
- emit(ProfileLogOut());
+ emit(const ProfileState(isLoading: false, user: null, error: null, isToSAccepted: false, isNewsletterAccepted: false));
+ }
void init() async {
emit(const ProfileState(isLoading: true, user: null, error: null));
@@ -63,6 +64,4 @@ class ProfileCubit extends Cubit<ProfileState> {
Future<dynamic> onComwellClubSignupClick(User user) async {
return await profileRepository.signupForComwellClub(user);
}
-
- void deleteAllInfoOnLogOut() async {}
}
diff --git a/comwell_key_app/lib/profile/profile_page.dart b/comwell_key_app/lib/profile/profile_page.dart
index 4da53c72..bdb836d9 100644
--- a/comwell_key_app/lib/profile/profile_page.dart
+++ b/comwell_key_app/lib/profile/profile_page.dart
@@ -12,27 +12,18 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
-
import 'package:package_info_plus/package_info_plus.dart';
-
import 'package:url_launcher/url_launcher.dart';
-
class ProfilePage extends StatelessWidget {
final SecureStorage secureStorage = SecureStorage();
-
- @override
- Widget build(BuildContext context) {
- context.read<ProfileCubit>().sendPageViewEvent();
-
ProfilePage({super.key});
@override
Widget build(BuildContext context) {
final cubit = context.read<ProfileCubit>();
cubit.sendPageViewEvent();
-
return Scaffold(
backgroundColor: sandColor[20],
@@ -105,8 +96,7 @@ class ProfilePage extends StatelessWidget {
children: [
GestureDetector(
onTap: () async {
- await
- showModalBottomSheet<void>(
+ await showModalBottomSheet<void>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.white,
@@ -220,7 +210,6 @@ class ProfilePage extends StatelessWidget {
),
),
),
-
const SizedBox(height: 16),
FutureBuilder<String>(
future: context.read<ProfileCubit>().getVersion(),
@@ -264,54 +253,6 @@ class ProfilePage extends StatelessWidget {
fontSize: 18,
fontWeight: FontWeight.w600,
),
- Text("logout_dialog_title".tr(),
- textAlign: TextAlign.center,
- style: const TextStyle(
- color: Colors.black,
- fontSize: 18,
- fontWeight: FontWeight.w600)),
- const SizedBox(height: 20),
- Expanded(
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: sandColor,
- minimumSize: const Size(280, 52),
- maximumSize: const Size(280, 52),
- ),
- onPressed: () {
- context
- .read<AuthenticationBloc>()
- .add(AuthenticationLogoutPressed());
- },
- child: Text("logout_profile_menu".tr(),
- style: const TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Colors.white)),
- ),
- ),
- const SizedBox(
- height: 5,
- ),
- Expanded(
- child: OutlinedButton(
- style: OutlinedButton.styleFrom(
- side: const BorderSide(color: colorDivider),
- minimumSize: const Size(280, 52),
- maximumSize: const Size(280, 52),
- ),
- onPressed: () {
- context.pop();
- },
- child: Text("cancel".tr(),
- style: const TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Colors.black)),
- ),
- ),
- const SizedBox(
- height: 10,
),
const SizedBox(height: 24),
SizedBox(