Refactor codebase resolving warnings and remove self-package imports
This commit is contained in:
58
lib/view/pages/timetable/timeRegionComponent.dart
Normal file
58
lib/view/pages/timetable/timeRegionComponent.dart
Normal file
@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
class TimeRegionComponent extends StatefulWidget {
|
||||
final TimeRegionDetails details;
|
||||
const TimeRegionComponent({Key? key, required this.details}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<TimeRegionComponent> createState() => _TimeRegionComponentState();
|
||||
}
|
||||
|
||||
class _TimeRegionComponentState extends State<TimeRegionComponent> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String text = widget.details.region.text!;
|
||||
Color? color = widget.details.region.color;
|
||||
|
||||
if (text == 'centerIcon') {
|
||||
return Container(
|
||||
color: color,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
widget.details.region.iconData,
|
||||
size: 17,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
);
|
||||
} else if(text.startsWith('holiday')) {
|
||||
return Container(
|
||||
color: color,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 5),
|
||||
const Icon(Icons.cake),
|
||||
const Text("FREI"),
|
||||
const SizedBox(height: 5),
|
||||
RotatedBox(
|
||||
quarterTurns: 1,
|
||||
child: Text(
|
||||
text.split(":").last,
|
||||
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