2024-05-18 09:37:50 +08:00

63 lines
1.5 KiB
Dart
Executable File

part of 'widget.dart';
class Header extends StatelessWidget {
const Header({
Key? key,
required this.monthDate,
this.margin = const EdgeInsets.only(
left: 16.0,
right: 8.0,
top: 4.0,
bottom: 4.0,
),
this.onPressed,
this.dateStyle,
this.todayStyle,
}) : super(key: key);
static final _dateFormatter = DateFormat.yM('zh_CN');
final DateTime monthDate;
final EdgeInsetsGeometry margin;
final VoidCallback? onPressed;
final TextStyle? dateStyle;
final TextStyle? todayStyle;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
// initializeDateFormatting('zh_CN', null);
return Container(
margin: margin,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Text(
// _dateFormatter.format(monthDate),
// style: dateStyle ?? theme.textTheme.titleMedium,
// ),
InkWell(
onTap: onPressed,
borderRadius: const BorderRadius.all(
Radius.circular(4.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0,
vertical: 4.0,
),
child: Text(
'今天',
style: TextStyle(
color: Colors.black,
fontSize: 24.sp,
fontWeight: FontWeight.w600),
),
),
),
],
),
);
}
}