Abschnitt 5
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChartBar extends StatelessWidget {
|
||||
const ChartBar({
|
||||
super.key,
|
||||
required this.fill,
|
||||
});
|
||||
|
||||
final double fill;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDarkMode =
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark;
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: FractionallySizedBox(
|
||||
heightFactor: fill,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius:
|
||||
const BorderRadius.vertical(top: Radius.circular(8)),
|
||||
color: isDarkMode
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Theme.of(context).colorScheme.primary.withOpacity(0.65),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user