feat: add staff certificates feature with pubspec configuration

- Created pubspec.yaml for the staff_certificates feature with dependencies including flutter_bloc, equatable, get_it, and flutter_modular.
- Established paths for KROW dependencies: design_system, core_localization, krow_domain, krow_core, and krow_data_connect.
- Added firebase_auth and firebase_data_connect as dependencies.
- Generated pubspec.lock file to lock dependency versions.
This commit is contained in:
Achintha Isuru
2026-01-25 10:28:43 -05:00
parent b3e156ebbe
commit 9dae80e66e
24 changed files with 2383 additions and 15 deletions

View File

@@ -20,6 +20,70 @@ class BankAccountRepositoryImpl implements BankAccountRepository {
final auth.User? user = firebaseAuth.currentUser;
if (user == null) throw Exception('User not authenticated');
// return some mock data for now
return [
BankAccount(
id: '1',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****1234',
accountName: 'My Checking Account',
type: BankAccountType.checking,
last4: '1234',
isPrimary: true,
),
BankAccount(
id: '2',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****5678',
accountName: 'My Savings Account',
type: BankAccountType.savings,
last4: '5678',
isPrimary: false,
),
BankAccount(
id: '3',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****1234',
accountName: 'My Checking Account',
type: BankAccountType.checking,
last4: '1234',
isPrimary: true,
),
BankAccount(
id: '4',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****5678',
accountName: 'My Savings Account',
type: BankAccountType.savings,
last4: '5678',
isPrimary: false,
),
BankAccount(
id: '5',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****1234',
accountName: 'My Checking Account',
type: BankAccountType.checking,
last4: '1234',
isPrimary: true,
),
BankAccount(
id: '6',
userId: user.uid,
bankName: 'Mock Bank',
accountNumber: '****5678',
accountName: 'My Savings Account',
type: BankAccountType.savings,
last4: '5678',
isPrimary: false,
),
];
final QueryResult<GetAccountsByOwnerIdData, GetAccountsByOwnerIdVariables> result = await dataConnect.getAccountsByOwnerId(ownerId: user.uid).execute();
return result.data.accounts.map((GetAccountsByOwnerIdAccounts account) {

View File

@@ -82,6 +82,9 @@ class BankAccountPage extends StatelessWidget {
accountNumber: account,
type: type);
},
onCancel: () {
cubit.toggleForm(false);
}
),
],
// Add extra padding at bottom

View File

@@ -6,8 +6,9 @@ import '../blocs/bank_account_cubit.dart';
class AddAccountForm extends StatefulWidget {
final dynamic strings;
final Function(String routing, String account, String type) onSubmit;
final VoidCallback onCancel;
const AddAccountForm({super.key, required this.strings, required this.onSubmit});
const AddAccountForm({super.key, required this.strings, required this.onSubmit, required this.onCancel});
@override
State<AddAccountForm> createState() => _AddAccountFormState();
@@ -79,9 +80,7 @@ class _AddAccountFormState extends State<AddAccountForm> {
Expanded(
child: UiButton.text(
text: widget.strings.cancel,
onPressed: () {
Modular.get<BankAccountCubit>().toggleForm(false);
},
onPressed: () => widget.onCancel(),
),
),
const SizedBox(width: UiConstants.space2),