Skip to content

Commit

Permalink
Merge pull request #837 from givtnl/feature/kids-1117-logout-button-w…
Browse files Browse the repository at this point in the history
…hen-no-profiles-available
  • Loading branch information
MaikelStuivenberg authored Jun 25, 2024
2 parents 763c4e2 + 234ab0b commit 9c33b67
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class _ProfileSelectionScreenState extends State<ProfileSelectionScreen> {
),
body: state is ProfilesLoadingState
? const CustomCircularProgressIndicator()
: state.children.isEmpty && state.parents.isEmpty
: state.children.isEmpty
? ProfilesEmptyStateWidget(
onRetry: () => context
.read<ProfilesCubit>()
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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,
),
),
],
),
],
),
Expand Down

0 comments on commit 9c33b67

Please sign in to comment.