diff --git a/lib/features/family/features/profiles/screens/profile_selection_screen.dart b/lib/features/family/features/profiles/screens/profile_selection_screen.dart index c63927e05..88a576c15 100644 --- a/lib/features/family/features/profiles/screens/profile_selection_screen.dart +++ b/lib/features/family/features/profiles/screens/profile_selection_screen.dart @@ -128,7 +128,7 @@ class _ProfileSelectionScreenState extends State { ), body: state is ProfilesLoadingState ? const CustomCircularProgressIndicator() - : state.children.isEmpty && state.parents.isEmpty + : state.children.isEmpty ? ProfilesEmptyStateWidget( onRetry: () => context .read() diff --git a/lib/features/family/features/profiles/widgets/profiles_empty_state_widget.dart b/lib/features/family/features/profiles/widgets/profiles_empty_state_widget.dart index 40999849b..2af2dd090 100644 --- a/lib/features/family/features/profiles/widgets/profiles_empty_state_widget.dart +++ b/lib/features/family/features/profiles/widgets/profiles_empty_state_widget.dart @@ -1,5 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:givt_app/app/routes/pages.dart'; +import 'package:givt_app/core/enums/amplitude_events.dart'; +import 'package:givt_app/features/auth/cubit/auth_cubit.dart'; +import 'package:givt_app/features/family/features/auth/helpers/logout_helper.dart'; +import 'package:givt_app/features/family/shared/widgets/givt_elevated_button.dart'; +import 'package:givt_app/features/family/shared/widgets/givt_elevated_secondary_button.dart'; import 'package:givt_app/utils/utils.dart'; +import 'package:go_router/go_router.dart'; class ProfilesEmptyStateWidget extends StatelessWidget { const ProfilesEmptyStateWidget({ @@ -13,26 +22,41 @@ class ProfilesEmptyStateWidget extends StatelessWidget { Widget build(BuildContext context) { return Center( child: Padding( - padding: const EdgeInsets.all(50), + padding: const EdgeInsets.all(24), child: Column( mainAxisSize: MainAxisSize.min, children: [ - const Text( + Text( 'There are no profiles attached to the current user.', textAlign: TextAlign.center, - style: TextStyle( - color: AppTheme.givt4KidsBlue, - fontSize: 25, - fontWeight: FontWeight.bold, - ), + style: Theme.of(context).textTheme.bodyMedium, ), const SizedBox( - height: 25, + height: 24, ), - ElevatedButton.icon( - onPressed: onRetry, - icon: const Icon(Icons.refresh_rounded), - label: const Text("Retry"), + Row( + children: [ + Expanded( + child: GivtElevatedSecondaryButton( + onTap: () => logout(context, fromLogoutBtn: true), + text: 'Logout', + leftIcon: SvgPicture.asset( + 'assets/family/images/logout.svg', + width: 36, + ), + ), + ), + const SizedBox( + width: 16, + ), + Expanded( + child: GivtElevatedButton( + onTap: onRetry, + text: 'Retry', + leftIcon: Icons.refresh_rounded, + ), + ), + ], ), ], ),