57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class TitledContainer extends StatelessWidget {
|
|
final String title;
|
|
final Widget child;
|
|
|
|
const TitledContainer({super.key, required this.title, required this.child});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.primaryContainer,
|
|
borderRadius: BorderRadius.circular(15),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Theme.of(context).colorScheme.shadow,
|
|
blurRadius: 10,
|
|
offset: const Offset(2, 2),
|
|
spreadRadius: 0.1,
|
|
blurStyle: BlurStyle.normal,
|
|
)
|
|
]
|
|
),
|
|
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.secondaryContainer,
|
|
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,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
child: child,
|
|
),
|
|
],
|
|
)
|
|
);
|
|
}
|
|
} |