claude refactor
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
const String kTimeRegionCenterIcon = 'centerIcon';
|
||||
const String kTimeRegionHolidayPrefix = 'holiday:';
|
||||
|
||||
class TimeRegionTile extends StatelessWidget {
|
||||
final TimeRegionDetails details;
|
||||
|
||||
const TimeRegionTile({super.key, required this.details});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final text = details.region.text ?? '';
|
||||
final color = details.region.color;
|
||||
|
||||
if (text == kTimeRegionCenterIcon) {
|
||||
return Container(
|
||||
color: color,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(details.region.iconData, size: 17, color: Theme.of(context).primaryColor),
|
||||
);
|
||||
}
|
||||
|
||||
if (text.startsWith(kTimeRegionHolidayPrefix)) {
|
||||
return Container(
|
||||
color: color,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 15),
|
||||
const Icon(Icons.cake),
|
||||
const Text('FREI'),
|
||||
const SizedBox(height: 10),
|
||||
RotatedBox(
|
||||
quarterTurns: 1,
|
||||
child: Text(
|
||||
text.substring(kTimeRegionHolidayPrefix.length),
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
decorationStyle: TextDecorationStyle.dashed,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user