budget mockup, account settings & transactions filter
This commit is contained in:
@@ -3,12 +3,35 @@ import 'package:flutter/material.dart';
|
||||
class TitledContainer extends StatelessWidget {
|
||||
final String title;
|
||||
final Widget child;
|
||||
final Widget? action;
|
||||
final double? height;
|
||||
final double? width;
|
||||
|
||||
const TitledContainer({super.key, required this.title, required this.child});
|
||||
const TitledContainer({super.key, required this.title, required this.child, this.action, this.height, this.width});
|
||||
|
||||
Widget _computeTitleRow() {
|
||||
List<Widget> children = [];
|
||||
children.add(Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 20,
|
||||
),
|
||||
));
|
||||
Widget? actionWidget = action;
|
||||
if (actionWidget != null) {
|
||||
children.add(actionWidget);
|
||||
}
|
||||
return Row(
|
||||
children: children
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: height,
|
||||
width: width,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
@@ -36,13 +59,7 @@ class TitledContainer extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(15), topRight: Radius.circular(15)),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 15),
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
child: _computeTitleRow()
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user