feat: Add UiEmptyState widget and integrate it into BankAccountPage and WorkerHomePage for improved empty state handling
This commit is contained in:
@@ -28,10 +28,7 @@ class BankAccountPage extends StatelessWidget {
|
||||
final dynamic strings = t.staff.profile.bank_account_page;
|
||||
|
||||
return Scaffold(
|
||||
appBar: UiAppBar(
|
||||
title: strings.title,
|
||||
showBackButton: true,
|
||||
),
|
||||
appBar: UiAppBar(title: strings.title, showBackButton: true),
|
||||
body: BlocConsumer<BankAccountCubit, BankAccountState>(
|
||||
bloc: cubit,
|
||||
listener: (BuildContext context, BankAccountState state) {
|
||||
@@ -81,34 +78,13 @@ class BankAccountPage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SecurityNotice(strings: strings),
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
const SizedBox(height: UiConstants.space32),
|
||||
if (state.accounts.isEmpty)
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: UiConstants.space10,
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
UiIcons.building,
|
||||
size: 48,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
Text(
|
||||
'No accounts yet',
|
||||
style: UiTypography.headline4m,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
'Add your first bank account to get started',
|
||||
style: UiTypography.body2m.textSecondary,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const UiEmptyState(
|
||||
icon: UiIcons.building,
|
||||
title: 'No accounts yet',
|
||||
description:
|
||||
'Add your first bank account to get started',
|
||||
)
|
||||
else ...<Widget>[
|
||||
Text(
|
||||
@@ -119,10 +95,8 @@ class BankAccountPage extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: UiConstants.space3),
|
||||
...state.accounts.map<Widget>(
|
||||
(StaffBankAccount account) => AccountCard(
|
||||
account: account,
|
||||
strings: strings,
|
||||
),
|
||||
(StaffBankAccount account) =>
|
||||
AccountCard(account: account, strings: strings),
|
||||
),
|
||||
],
|
||||
// Add extra padding at bottom
|
||||
|
||||
Reference in New Issue
Block a user