Skip to content

Customizable Footer #1968

@manandharsudhir

Description

@manandharsudhir

Use case

Currently, we can only set cancel and okay buttons and customize the text of these buttons. Additionally, we can use the theme to set the decoration of the buttons. However, it would be great if we could use any widget as the footer.

Furthermore, it would be beneficial if we could change the decoration of each button separately, as the cancel and okay buttons often require distinct designs.

Proposed Features:

  • Allow any widget to be used as the footer.
  • Enable separate decoration customizations for the cancel and okay buttons.

Benefits:

  • Enhanced flexibility for developers to customize the footer according to their application needs.
  • Improved design capabilities by allowing distinct styles for different buttons.

Proposal

image

SfDateRangePicker(
               
               cancelTextStyle: textTheme.bodyMedium
                   ?.copyWith(color: const Color(0xff19181A)),
              
 		okTextStyle: textTheme.bodyMedium?.copyWith(
                 color: Colors.white,
               ),
               cancelStyle: ButtonStyle(
                 backgroundColor: WidgetStateProperty.all<Color>(
                   AppColors.bodyTextDark,
                 ),
                 padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
                     const EdgeInsets.symmetric(
                         vertical: 16.0, horizontal: 16.0)),
                 shape: WidgetStateProperty.all<OutlinedBorder>(
                   RoundedRectangleBorder(
                     borderRadius: BorderRadius.circular(4.0),
                   ),
                 ),
               ),

               okStyle: ButtonStyle(
                 backgroundColor:
                     WidgetStateProperty.all<Color>(AppColors.primaryGreen700),
                 padding: WidgetStateProperty.all<EdgeInsetsGeometry>(
                     const EdgeInsets.symmetric(
                         vertical: 16.0, horizontal: 16.0)),
                 shape: WidgetStateProperty.all<OutlinedBorder>(
                   RoundedRectangleBorder(
                     borderRadius: BorderRadius.circular(4.0),
                   ),
                 ),
               ),
               showCancelAndOkButtonOnly: true,
              
             )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions