Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/components/checkbox/gf_checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class GFCheckbox extends StatefulWidget {
this.size = GFSize.MEDIUM,
this.type = GFCheckboxType.basic,
this.checkColor = GFColors.WHITE,
this.activebgColor = GFColors.PRIMARY,
this.inactivebgColor = GFColors.WHITE,
this.activeBgColor = GFColors.PRIMARY,
this.inactiveBgColor = GFColors.WHITE,
this.activeBorderColor = GFColors.WHITE,
this.inactiveBorderColor = GFColors.DARK,
this.onChanged,
Expand All @@ -20,7 +20,7 @@ class GFCheckbox extends StatefulWidget {
color: GFColors.WHITE,
),
this.inactiveIcon,
this.custombgColor = GFColors.SUCCESS,
this.customBgColor = GFColors.SUCCESS,
this.autofocus = false,
this.focusNode})
: assert(autofocus != null),
Expand All @@ -32,14 +32,14 @@ class GFCheckbox extends StatefulWidget {
/// type of [double] which is GFSize ie, small, medium and large and can use any double value
final double size;

/// type of [Color] used to change the checkcolor when the checkbox is active
/// type of [Color] used to change the checkColor when the checkbox is active
final Color checkColor;

/// type of [Color] used to change the backgroundColor of the active checkbox
final Color activebgColor;
final Color activeBgColor;

/// type of [Color] used to change the backgroundColor of the inactive checkbox
final Color inactivebgColor;
final Color inactiveBgColor;

/// type of [Color] used to change the border color of the active checkbox
final Color activeBorderColor;
Expand All @@ -60,7 +60,7 @@ class GFCheckbox extends StatefulWidget {
final Widget inactiveIcon;

/// type of [Color] used to change the background color of the custom active checkbox only
final Color custombgColor;
final Color customBgColor;

/// on true state this widget will be selected as the initial focus
/// when no other node in its scope is currently focused
Expand Down Expand Up @@ -101,8 +101,8 @@ class _GFCheckboxState extends State<GFCheckbox> {
? widget.value
? widget.type == GFCheckboxType.custom
? Colors.white
: widget.activebgColor
: widget.inactivebgColor
: widget.activeBgColor
: widget.inactiveBgColor
: Colors.grey,
borderRadius: widget.type == GFCheckboxType.basic
? BorderRadius.circular(3)
Expand All @@ -129,7 +129,7 @@ class _GFCheckboxState extends State<GFCheckbox> {
height: widget.size * 0.8,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: widget.custombgColor),
color: widget.customBgColor),
)
],
)
Expand Down
35 changes: 19 additions & 16 deletions lib/components/checkbox_list_tile/gf_checkbox_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class GFCheckboxListTile extends StatelessWidget {
/// [GFCheckboxListTile] is a tile with small box at right (as in a checklist) in which to place a check mark to make a selection with various customization options.
/// [GFCheckboxListTile] is a tile with small box at right (as in a checklist)
/// in which to place a check mark to make a selection with various customization options.
const GFCheckboxListTile({
Key key,
@required this.value,
Expand All @@ -12,16 +13,16 @@ class GFCheckboxListTile extends StatelessWidget {
this.color,
this.avatar,
this.title,
this.subTitle,
this.subtitle,
this.icon,
this.description,
this.padding = const EdgeInsets.all(8),
this.margin = const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
this.size = GFSize.MEDIUM,
this.type = GFCheckboxType.basic,
this.checkColor = GFColors.WHITE,
this.activebgColor = GFColors.PRIMARY,
this.inactivebgColor = GFColors.WHITE,
this.activeBgColor = GFColors.PRIMARY,
this.inactiveBgColor = GFColors.WHITE,
this.activeBorderColor = GFColors.WHITE,
this.inactiveBorderColor = GFColors.DARK,
this.activeIcon = const Icon(
Expand All @@ -30,7 +31,7 @@ class GFCheckboxListTile extends StatelessWidget {
color: GFColors.WHITE,
),
this.inactiveIcon,
this.custombgColor = GFColors.SUCCESS,
this.customBgColor = GFColors.SUCCESS,
this.position = GFPosition.end,
this.selected = false,
this.autofocus = false,
Expand All @@ -48,14 +49,15 @@ class GFCheckboxListTile extends StatelessWidget {
/// The GFListTile's background color. Can be given [Color] or [GFColors]
final Color color;

/// If position is start Checkbox will come instead of avatar, type of [Widget] or [GFAvatar] used to create rounded user profile
/// If position is start Checkbox will come instead of avatar,
/// type of [Widget] or [GFAvatar] used to create rounded user profile
final Widget avatar;

/// The title to display inside the [GFListTile]. see [Text]
final Widget title;

/// The subTitle to display inside the [GFListTile]. see [Text]
final Widget subTitle;
/// The subtitle to display inside the [GFListTile]. see [Text]
final Widget subtitle;

/// The description to display inside the [GFListTile]. see [Text]
final Widget description;
Expand All @@ -76,10 +78,10 @@ class GFCheckboxListTile extends StatelessWidget {
final Color checkColor;

/// type of [Color] used to change the backgroundColor of the active checkbox
final Color activebgColor;
final Color activeBgColor;

/// type of [Color] used to change the backgroundColor of the inactive checkbox
final Color inactivebgColor;
final Color inactiveBgColor;

/// type of [Color] used to change the border color of the active checkbox
final Color activeBorderColor;
Expand All @@ -103,13 +105,14 @@ class GFCheckboxListTile extends StatelessWidget {
final Widget inactiveIcon;

/// type of [Color] used to change the background color of the custom active checkbox only
final Color custombgColor;
final Color customBgColor;

/// To have the list tile appear selected when the checkbox is checked, pass the same value to both.
/// Normally, this property is left to its default value, false.
final bool selected;

/// {@macro flutter.widgets.Focus.autofocus}
/// On true state it should focus itself if nothing else is already focused.
/// Defaults to false
final bool autofocus;

/// If position is end Checkbox will come instead of icon, The icon to display inside the [GFListTile]. see [Icon]
Expand All @@ -122,13 +125,13 @@ class GFCheckboxListTile extends StatelessWidget {
onChanged: onChanged,
value: value,
size: size,
activebgColor: activebgColor,
activeBgColor: activeBgColor,
inactiveIcon: inactiveIcon,
activeBorderColor: activeBorderColor,
inactivebgColor: inactivebgColor,
inactiveBgColor: inactiveBgColor,
activeIcon: activeIcon,
inactiveBorderColor: inactiveBorderColor,
custombgColor: custombgColor,
customBgColor: customBgColor,
checkColor: checkColor,
type: type);
return MergeSemantics(
Expand All @@ -143,7 +146,7 @@ class GFCheckboxListTile extends StatelessWidget {
selected: selected,
avatar: position == GFPosition.start ? checkbox : avatar,
titleText: titleText,
subTitle: subTitle,
subtitle: subtitle,
subtitleText: subtitleText,
description: description,
color: color,
Expand Down
3 changes: 2 additions & 1 deletion lib/components/dropdown/gf_dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class GFDropdown<T> extends StatefulWidget {
///
/// GF Dropdown let user to select from the number of items and display selected
/// item in the button. It displays list of items in the overlay dropdown fashion.
const GFDropdown(
{Key key,
@required this.items,
Expand Down
61 changes: 31 additions & 30 deletions lib/components/dropdown/gf_multiselect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class GFMultiSelect<T> extends StatefulWidget {
///
/// GF Multiselect let user to select multiple items from the number of
/// Checkbox ListTile items and display selected items in the TitleTile box.
/// It displays list of items in the overlay dropdown fashion.
const GFMultiSelect({
@required this.items,
@required this.onSelect,
this.dropDownTitleTileText = 'Select : ',
this.dropDownTitleTileTextStyle =
this.dropdownTitleTileText = 'Select : ',
this.dropdownTitleTileTextStyle =
const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
this.color,
this.avatar,
Expand All @@ -16,8 +18,8 @@ class GFMultiSelect<T> extends StatefulWidget {
this.size = GFSize.SMALL,
this.type = GFCheckboxType.basic,
this.checkColor = GFColors.WHITE,
this.activebgColor = GFColors.WHITE,
this.inactivebgColor = GFColors.WHITE,
this.activeBgColor = GFColors.WHITE,
this.inactiveBgColor = GFColors.WHITE,
this.activeBorderColor = GFColors.WHITE,
this.inactiveBorderColor = GFColors.WHITE,
this.submitButton,
Expand All @@ -31,14 +33,14 @@ class GFMultiSelect<T> extends StatefulWidget {
color: Colors.black87,
size: 30,
),
this.dropdownbgColor = Colors.white,
this.dropdownBgColor = Colors.white,
this.activeIcon = const Icon(
Icons.check,
size: 20,
color: GFColors.DARK,
),
this.inactiveIcon,
this.custombgColor = GFColors.SUCCESS,
this.customBgColor = GFColors.SUCCESS,
this.selected = false,
this.dropdownTitleTileBorder,
this.dropdownTitleTileBorderRadius =
Expand All @@ -49,8 +51,8 @@ class GFMultiSelect<T> extends StatefulWidget {
const BorderSide(color: Colors.black12, width: 1),
this.dropdownTitleTileMargin = const EdgeInsets.all(16),
this.dropdownTitleTilePadding = const EdgeInsets.all(12),
this.dropDownTitleTileHintText,
this.dropDownTitleTileHintTextStyle =
this.dropdownTitleTileHintText,
this.dropdownTitleTileHintTextStyle =
const TextStyle(fontSize: 12, fontWeight: FontWeight.w400),
Key key,
}) : assert(selected != null),
Expand All @@ -64,16 +66,16 @@ class GFMultiSelect<T> extends StatefulWidget {
final ValueChanged<List<dynamic>> onSelect;

/// type of [String] to define the dropdownTitleTile title
final String dropDownTitleTileText;
final String dropdownTitleTileText;

/// type of [TextStyle] to define the textStyle of [dropDownTitleTileText]
final TextStyle dropDownTitleTileTextStyle;
/// type of [TextStyle] to define the textStyle of [dropdownTitleTileText]
final TextStyle dropdownTitleTileTextStyle;

/// type of [String] to define the dropdownTitleTile hint text
final String dropDownTitleTileHintText;
final String dropdownTitleTileHintText;

/// type of [TextStyle] to define the textStyle of [dropDownTitleTileHintTextStyle]
final TextStyle dropDownTitleTileHintTextStyle;
/// type of [TextStyle] to define the textStyle of [dropdownTitleTileHintTextStyle]
final TextStyle dropdownTitleTileHintTextStyle;

/// defines the border radius of the dropdownTitleTile
final BorderRadius dropdownTitleTileBorderRadius;
Expand Down Expand Up @@ -132,11 +134,11 @@ class GFMultiSelect<T> extends StatefulWidget {

/// defines dropdown ListTile's checkbox background color when its active
/// type of [Color] used to change the backgroundColor of the active checkbox
final Color activebgColor;
final Color activeBgColor;

/// defines dropdown ListTile's checkbox background color when its inactive
/// type of [Color] used to change the backgroundColor of the inactive checkbox
final Color inactivebgColor;
final Color inactiveBgColor;

/// defines dropdown ListTile's checkbox border color when its active
/// type of [Color] used to change the border color of the active checkbox
Expand All @@ -155,15 +157,14 @@ class GFMultiSelect<T> extends StatefulWidget {
final Widget inactiveIcon;

/// type of [Color] used to change the background color of the custom active checkbox only
final Color custombgColor;
final Color customBgColor;

/// To have the list tile appear selected when the checkbox is checked, pass the same value to both.
/// Normally, this property is left to its default value, false.
final bool selected;

/// defines the background color of the dropdown. Can be given [Color] or [GFColors]
final Color dropdownbgColor;

final Color dropdownBgColor;

@override
_GFMultiSelectState createState() => _GFMultiSelectState();
Expand Down Expand Up @@ -205,11 +206,11 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
children: <Widget>[
_selectedTitles.isEmpty
? Expanded(
child: Text(widget.dropDownTitleTileText,
style: widget.dropDownTitleTileTextStyle))
child: Text(widget.dropdownTitleTileText,
style: widget.dropdownTitleTileTextStyle))
: Expanded(
child: Text(_selectedTitles.join(', ').toString(),
style: widget.dropDownTitleTileTextStyle)),
style: widget.dropdownTitleTileTextStyle)),
!showDropdown ? widget.expandedIcon : widget.collapsedIcon,
],
);
Expand All @@ -235,14 +236,14 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
? const Border(bottom: BorderSide(color: Colors.white))
: Border(bottom: widget.dropdownUnderlineBorder),
),
child: widget.dropDownTitleTileHintText == null
child: widget.dropdownTitleTileHintText == null
? dropdownTile()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${widget.dropDownTitleTileHintText}',
style: widget.dropDownTitleTileHintTextStyle,
'${widget.dropdownTitleTileHintText}',
style: widget.dropdownTitleTileHintTextStyle,
),
dropdownTile(),
const SizedBox(
Expand All @@ -255,7 +256,7 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
? Container(
padding: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(
color: widget.dropdownbgColor,
color: widget.dropdownBgColor,
boxShadow: const [
BoxShadow(
color: Colors.black12,
Expand Down Expand Up @@ -288,14 +289,14 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
padding: widget.padding,
margin: widget.margin,
size: widget.size,
activebgColor: widget.activebgColor,
activeBgColor: widget.activeBgColor,
inactiveIcon: widget.inactiveIcon,
activeBorderColor: widget.activeBorderColor,
inactivebgColor: widget.inactivebgColor,
inactiveBgColor: widget.inactiveBgColor,
activeIcon: widget.activeIcon,
inactiveBorderColor:
widget.inactiveBorderColor,
custombgColor: widget.custombgColor,
customBgColor: widget.customBgColor,
checkColor: widget.checkColor,
type: widget.type,
))),
Expand Down
Loading