Skip to content

Latest commit

 

History

History
150 lines (114 loc) · 7.71 KB

File metadata and controls

150 lines (114 loc) · 7.71 KB
layout post
title Headers in Flutter Date Range Picker | Syncfusion
description Step-by-step guide to customize the header and view header in Syncfusion Flutter Date Range Picker—headerStyle, headerHeight, viewHeaderStyle, and dayFormat.
platform flutter
control SfDateRangePicker
documentation ug

Flutter Date Range Picker Headers Guide (SfDateRangePicker)

You can customize the header of the date range picker using the headerStyle and headerHeight properties in date range picker.

Customize the header height

You can customize the height of the header of SfDateRangePicker by using the headerHeight property.

{% tabs %} {% highlight dart hl_lines="6" %}

@override Widget build(BuildContext context) { return Scaffold( body: SfDateRangePicker( view: DateRangePickerView.month, headerHeight: 100, ), ); }

{% endhighlight %} {% endtabs %}

Header height Date Range Picker

Header appearance

You can customize the header style of the SfDateRangePicker by using the backgroundColor, textStyle, and textAlign properties of DateRangePickerHeaderStyle.

{% tabs %} {% highlight dart hl_lines="6 7 8 9 10 11 12 13 14" %}

@override Widget build(BuildContext context) { return Scaffold( body: SfDateRangePicker( view: DateRangePickerView.month, headerStyle: DateRangePickerHeaderStyle( backgroundColor: Color(0xFF7fcd91), textAlign: TextAlign.center, textStyle: TextStyle( fontStyle: FontStyle.normal, fontSize: 25, letterSpacing: 5, color: Color(0xFFffeaea), ), ), ), ); }

{% endhighlight %} {% endtabs %}

Header appearance Date Range Picker

View header

You can customize the view header of the SfDateRangePicker using the viewHeaderHeight and viewHeaderStyle properties of DateRangePickerMonthViewSettings.

Customize view header height

You can customize the view header height of SfDateRangePicker using the viewHeaderHeight property of DateRangePickerMonthViewSettings.

{% tabs %} {% highlight dart hl_lines="6 7" %}

@override Widget build(BuildContext context) { return Scaffold( body: SfDateRangePicker( view: DateRangePickerView.month, monthViewSettings: DateRangePickerMonthViewSettings( viewHeaderHeight: 100, ), ), ); }

{% endhighlight %} {% endtabs %}

View Header height Date Range Picker

View header appearance

You can customize the view header style of SfDateRangePicker by using the backgroundColor, textStyle properties of DateRangePickerViewHeaderStyle.

{% tabs %} {% highlight dart hl_lines="7 8 9" %}

@override Widget build(BuildContext context) { return Scaffold( body: SfDateRangePicker( view: DateRangePickerView.month, monthViewSettings: DateRangePickerMonthViewSettings( viewHeaderStyle: DateRangePickerViewHeaderStyle( backgroundColor: Color(0xFF7fcd91), textStyle: TextStyle(fontSize: 20, letterSpacing: 5), ), ), ), ); }

{% endhighlight %} {% endtabs %}

View Header appearance Date Range Picker

View header day format

You can customize the view header of SfDateRangePicker by using the dayFormat property of DateRangePickerMonthViewSettings.

{% tabs %} {% highlight dart hl_lines="6" %}

@override Widget build(BuildContext context) { return Scaffold( body: SfDateRangePicker( view: DateRangePickerView.month, monthViewSettings: DateRangePickerMonthViewSettings(dayFormat: 'EEE'), ), ); }

{% endhighlight %} {% endtabs %}

View Header format Date Range Picker

See also