Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

groovin widgets

a flutter package containing widgets created by groovinchip.

this package currently contains the following widgets:

  • modaldrawerhandle
  • outlinedropdownbutton
  • outlinedropdownbuttonformfield
  • groovinexpansiontile
  • splitcolorbackground

modaldrawerhandle

modaldrawerhandle allows you to add a highly customizable drawer handle widget to your modalbottomsheets.

sample image:

groovin

dawfrbg

wep5amq

every aspect of the drawer handle can be customized:

  • color
  • height
  • width
  • the mainaxisalignment of the row it sits in
  • the borderradius of all four corners

the recommended use of this widget is within the showmodalbottomsheet builder (or the showroundedmodalbottomsheet builder, if you prefer the package by gildaswise like i do).

the ideal use in this case is to return a container that returns a column, and the modaldrawerhandle widget should be the first widget in the column. i personally wrap the modaldrawerhandle with a padding that has a const edgeinsets.all(8.0). below is an example of this:

showroundedmodalbottomsheet(
  context: context,
  builder: (builder) {
    return container(
	  child: column(
	    mainaxissize: mainaxissize.min,
	    children: <widget>[
		  padding(
		    padding: const edgeinsets.all(8.0),
		    child: modaldrawerhandle(),
		  ),
	    ],
	  ),
    );
  },
);

by default, the modaldrawerhandle is initialized with the following properties:

  modaldrawerhandle({
    this.handlerowalignment = mainaxisalignment.center,
    this.handleheight = 5.0,
    this.handlewidth = 25.0,
    color handlecolor,
    this.handleborderradius = const borderradius.all(radius.circular(10.0))
  }):
     this.handlecolor = handlecolor ?? colors.grey[300];

as such, developers can pass in any or all of their own custom values to the constructor as they choose.

outlinedropdownbutton

outlinedropdownbutton is a standard dropdownbutton with one additional feature: the ability to wrap it in a border.
every property that you’d expect to customize about a dropdownbutton is available to the developer, and the inputdecoration
that the outlinedropdownbutton uses is also fully customizable.

by default, outlinedropdownbutton is initialized with the following properties:

  outlinedropdownbutton({
    this.inputdecoration = const inputdecoration(
      border: outlineinputborder(),
      contentpadding: edgeinsets.all(8.0),
    ),
    this.disabledhint,
    this.elevation = 8, // the default value per the source
    this.hint,
    this.iconsize = 24.0, // the default value per the source
    this.isdense = false, // the default value per the source
    this.isexpanded = true, // here i deviate from the source because this property is great
    this.items,
    this.onchanged,
    this.style,
    this.value,
  });

a default outlinedropdownbutton will look as follows:

alt text

outlinedropdownbuttonformfield

outlinedropdownbuttonformfield is similar to outlinedropdownbutton but is optimized for
forms. the additional properties are:

final list<dropdownmenuitem<t>> items;
final valuechanged<t> onchanged;
final formfieldvalidator<t> validator;
final formfieldsetter<t> onsaved;

this widget builds the inputdecoration explicitly in the widget rather than the constructor due to
form validation limitations. however, the decoration is open for customization.

groovinexpansiontile

this widget is a modified expansion tile that allows for more customization over its appearance.
you can customize the boxdecoration of the expansiontile so you can remove the lines that appear
above and below it when expanded, and so on.

expansiontile builds a listtile for the user to tap on; groovinexpansiontile builds a custom
listtile so that you can add a subtitle and adjust the border radius of the inkwell the tile is
contained in.

as of version 1.2.1 of this library, this widget’s default trailing icon will have a set color of
colors.grey. this icon color is open to customization via the parameter defaulttrailingiconcolor.

example images:

  • wrapped in material with 2.0 elevation, not expanded:
    alt text
  • wrapped material with 2.0 elevation, expanded:
    alt text
  • wrapped material with 2.0 elevation, expanded, showing inkwell with topright and topleft radius:
    alt text

splitcolorbackground

this widget enables the replication of designs seen on dribbble, uplabs, and other
design websites that show a header section with one background color, a body section with
a different background color, and rounded corners on the top of the body section.

an example of what this looks like is as follows, taken from the example project included
in this repository:

alt text

this widget operates as a scaffold who’s body is a column with two flexible widgets to represent
the header and the body. various scaffold properties are exposed to the developer. if you would like
more of the scaffold properties opened up to customization, please file an issue on github and
send me an additional email or tweet.

the widget contains the following properties:

/// represents the flex property of the flexible containing the header widget. defaults to 1.
final int headerflex;
/// represents the widget that will be used as the header
final widget header;
/// represents the color for the header widget
final color headercolor;
/// represents the flex property of the flexible containing the body widget. defaults to 4.
final int bodyflex;
/// represents the widget that will be used as the body
final widget body;
/// represents the corner radius for the top left corner of the body
final double topleftcornerradius;
/// represents the corner radius for the top right corner of the body
final double toprightcornerradius;
/// represents the color for the body widget
final color bodycolor;
/// the scaffold appbar is available for optional use.
final appbar appbar;
/// the scaffold floatingactionbutton is available for optional use.
final floatingactionbutton floatingactionbutton;
/// the scaffold floatingactionbuttonlocation is available for optional use.
final floatingactionbuttonlocation floatingactionbuttonlocation;
/// the scaffold bottomnavigationbar is available for optional use.
final bottomnavigationbar bottomnavigationbar;

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.