32 lines
971 B
Dart
32 lines
971 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:tunas/domains/account/account_bloc.dart';
|
|
import 'package:tunas/pages/common/titled_container.dart';
|
|
|
|
class AccountSettings extends StatelessWidget {
|
|
const AccountSettings({super.key});
|
|
|
|
List<Widget> _computeCategoryList(List<String> subAccounts) {
|
|
return subAccounts.map((subAccount) => Row(
|
|
children: [
|
|
Text(subAccount),
|
|
],
|
|
)).toList();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<AccountBloc, AccountState>(
|
|
builder: (context, state) => TitledContainer(
|
|
title: "Accounts",
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.vertical,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: _computeCategoryList(state.accounts.map((account) => account.label).toList()),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |