feat(header_style): add default header style requirement

This commit is contained in:
markkiepe 2024-04-04 09:32:20 +02:00
parent 8a6adbbee3
commit 6ddabf3ed7
2 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ class MyApp extends StatelessWidget {
2: theme.textTheme.titleLarge?.copyWith(color: Colors.blue), 2: theme.textTheme.titleLarge?.copyWith(color: Colors.blue),
}, },
defaultStyle: defaultStyle:
theme.textTheme.titleLarge?.copyWith(color: Colors.green), theme.textTheme.titleLarge!.copyWith(color: Colors.green),
), ),
content: [ content: [
Category( Category(

View file

@ -4,15 +4,15 @@ import "package:flutter/widgets.dart";
/// The headers are the names of the categories. /// The headers are the names of the categories.
class CategoryHeaderStyling { class CategoryHeaderStyling {
const CategoryHeaderStyling({ const CategoryHeaderStyling({
/// The styles for the headers. The key is the depth of the category.
/// The value is the text style for the header.
required this.headerStyles,
/// The default style for the headers. This will be used if the depth /// The default style for the headers. This will be used if the depth
/// is not found in the [headerStyles]. /// is not found in the [headerStyles].
this.defaultStyle, required this.defaultStyle,
/// The styles for the headers. The key is the depth of the category.
/// The value is the text style for the header.
this.headerStyles = const {},
}); });
final Map<int, TextStyle?> headerStyles; final Map<int, TextStyle?> headerStyles;
final TextStyle? defaultStyle; final TextStyle defaultStyle;
} }