50 lines
1.5 KiB
Dart
50 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:tunas/domains/account/account_bloc.dart';
|
|
|
|
class AccountSettings extends StatelessWidget {
|
|
const AccountSettings({super.key});
|
|
|
|
List<Widget> _computeCategoryList(Set<String> subAccounts) {
|
|
return subAccounts.map((subAccount) => Row(
|
|
children: [
|
|
Text(subAccount),
|
|
],
|
|
)).toList();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<AccountBloc, AccountState>(
|
|
builder: (context, state) => Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.blue,
|
|
borderRadius: BorderRadius.circular(5),
|
|
),
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
margin: const EdgeInsets.all(5),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Text(
|
|
"Accounts",
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w900,
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
SingleChildScrollView(
|
|
scrollDirection: Axis.vertical,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: _computeCategoryList(state.subAccounts),
|
|
),
|
|
),
|
|
],
|
|
)
|
|
),
|
|
);
|
|
}
|
|
} |