From 6ddabf3ed7e837f15b050f02e62110f5134f78ad Mon Sep 17 00:00:00 2001 From: markkiepe Date: Thu, 4 Apr 2024 09:32:20 +0200 Subject: [PATCH] feat(header_style): add default header style requirement --- example/lib/main.dart | 2 +- lib/src/category_header_styling.dart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 98e6a64..a75dd97 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -28,7 +28,7 @@ class MyApp extends StatelessWidget { 2: theme.textTheme.titleLarge?.copyWith(color: Colors.blue), }, defaultStyle: - theme.textTheme.titleLarge?.copyWith(color: Colors.green), + theme.textTheme.titleLarge!.copyWith(color: Colors.green), ), content: [ Category( diff --git a/lib/src/category_header_styling.dart b/lib/src/category_header_styling.dart index 61bf568..e46db5e 100644 --- a/lib/src/category_header_styling.dart +++ b/lib/src/category_header_styling.dart @@ -4,15 +4,15 @@ import "package:flutter/widgets.dart"; /// The headers are the names of the categories. class 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 /// 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 headerStyles; - final TextStyle? defaultStyle; + final TextStyle defaultStyle; }