@@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
22import 'package:getwidget/getwidget.dart' ;
33
44class GFMultiSelect <T > extends StatefulWidget {
5- ///
5+ /// GF Multiselect let user to select multiple items from the number of
6+ /// Checkbox ListTile items and display selected items in the TitleTile box.
7+ /// It displays list of items in the overlay dropdown fashion.
68 const GFMultiSelect ({
79 @required this .items,
810 @required this .onSelect,
9- this .dropDownTitleTileText = 'Select : ' ,
10- this .dropDownTitleTileTextStyle =
11+ this .dropdownTitleTileText = 'Select : ' ,
12+ this .dropdownTitleTileTextStyle =
1113 const TextStyle (fontSize: 16 , fontWeight: FontWeight .w500),
1214 this .color,
1315 this .avatar,
@@ -16,8 +18,8 @@ class GFMultiSelect<T> extends StatefulWidget {
1618 this .size = GFSize .SMALL ,
1719 this .type = GFCheckboxType .basic,
1820 this .checkColor = GFColors .WHITE ,
19- this .activebgColor = GFColors .WHITE ,
20- this .inactivebgColor = GFColors .WHITE ,
21+ this .activeBgColor = GFColors .WHITE ,
22+ this .inactiveBgColor = GFColors .WHITE ,
2123 this .activeBorderColor = GFColors .WHITE ,
2224 this .inactiveBorderColor = GFColors .WHITE ,
2325 this .submitButton,
@@ -31,14 +33,14 @@ class GFMultiSelect<T> extends StatefulWidget {
3133 color: Colors .black87,
3234 size: 30 ,
3335 ),
34- this .dropdownbgColor = Colors .white,
36+ this .dropdownBgColor = Colors .white,
3537 this .activeIcon = const Icon (
3638 Icons .check,
3739 size: 20 ,
3840 color: GFColors .DARK ,
3941 ),
4042 this .inactiveIcon,
41- this .custombgColor = GFColors .SUCCESS ,
43+ this .customBgColor = GFColors .SUCCESS ,
4244 this .selected = false ,
4345 this .dropdownTitleTileBorder,
4446 this .dropdownTitleTileBorderRadius =
@@ -49,8 +51,8 @@ class GFMultiSelect<T> extends StatefulWidget {
4951 const BorderSide (color: Colors .black12, width: 1 ),
5052 this .dropdownTitleTileMargin = const EdgeInsets .all (16 ),
5153 this .dropdownTitleTilePadding = const EdgeInsets .all (12 ),
52- this .dropDownTitleTileHintText ,
53- this .dropDownTitleTileHintTextStyle =
54+ this .dropdownTitleTileHintText ,
55+ this .dropdownTitleTileHintTextStyle =
5456 const TextStyle (fontSize: 12 , fontWeight: FontWeight .w400),
5557 Key key,
5658 }) : assert (selected != null ),
@@ -64,16 +66,16 @@ class GFMultiSelect<T> extends StatefulWidget {
6466 final ValueChanged <List <dynamic >> onSelect;
6567
6668 /// type of [String] to define the dropdownTitleTile title
67- final String dropDownTitleTileText ;
69+ final String dropdownTitleTileText ;
6870
69- /// type of [TextStyle] to define the textStyle of [dropDownTitleTileText ]
70- final TextStyle dropDownTitleTileTextStyle ;
71+ /// type of [TextStyle] to define the textStyle of [dropdownTitleTileText ]
72+ final TextStyle dropdownTitleTileTextStyle ;
7173
7274 /// type of [String] to define the dropdownTitleTile hint text
73- final String dropDownTitleTileHintText ;
75+ final String dropdownTitleTileHintText ;
7476
75- /// type of [TextStyle] to define the textStyle of [dropDownTitleTileHintTextStyle ]
76- final TextStyle dropDownTitleTileHintTextStyle ;
77+ /// type of [TextStyle] to define the textStyle of [dropdownTitleTileHintTextStyle ]
78+ final TextStyle dropdownTitleTileHintTextStyle ;
7779
7880 /// defines the border radius of the dropdownTitleTile
7981 final BorderRadius dropdownTitleTileBorderRadius;
@@ -132,11 +134,11 @@ class GFMultiSelect<T> extends StatefulWidget {
132134
133135 /// defines dropdown ListTile's checkbox background color when its active
134136 /// type of [Color] used to change the backgroundColor of the active checkbox
135- final Color activebgColor ;
137+ final Color activeBgColor ;
136138
137139 /// defines dropdown ListTile's checkbox background color when its inactive
138140 /// type of [Color] used to change the backgroundColor of the inactive checkbox
139- final Color inactivebgColor ;
141+ final Color inactiveBgColor ;
140142
141143 /// defines dropdown ListTile's checkbox border color when its active
142144 /// type of [Color] used to change the border color of the active checkbox
@@ -155,15 +157,14 @@ class GFMultiSelect<T> extends StatefulWidget {
155157 final Widget inactiveIcon;
156158
157159 /// type of [Color] used to change the background color of the custom active checkbox only
158- final Color custombgColor ;
160+ final Color customBgColor ;
159161
160162 /// To have the list tile appear selected when the checkbox is checked, pass the same value to both.
161163 /// Normally, this property is left to its default value, false.
162164 final bool selected;
163165
164166 /// defines the background color of the dropdown. Can be given [Color] or [GFColors]
165- final Color dropdownbgColor;
166-
167+ final Color dropdownBgColor;
167168
168169 @override
169170 _GFMultiSelectState createState () => _GFMultiSelectState ();
@@ -205,11 +206,11 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
205206 children: < Widget > [
206207 _selectedTitles.isEmpty
207208 ? Expanded (
208- child: Text (widget.dropDownTitleTileText ,
209- style: widget.dropDownTitleTileTextStyle ))
209+ child: Text (widget.dropdownTitleTileText ,
210+ style: widget.dropdownTitleTileTextStyle ))
210211 : Expanded (
211212 child: Text (_selectedTitles.join (', ' ).toString (),
212- style: widget.dropDownTitleTileTextStyle )),
213+ style: widget.dropdownTitleTileTextStyle )),
213214 ! showDropdown ? widget.expandedIcon : widget.collapsedIcon,
214215 ],
215216 );
@@ -235,14 +236,14 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
235236 ? const Border (bottom: BorderSide (color: Colors .white))
236237 : Border (bottom: widget.dropdownUnderlineBorder),
237238 ),
238- child: widget.dropDownTitleTileHintText == null
239+ child: widget.dropdownTitleTileHintText == null
239240 ? dropdownTile ()
240241 : Column (
241242 crossAxisAlignment: CrossAxisAlignment .start,
242243 children: [
243244 Text (
244- '${widget .dropDownTitleTileHintText }' ,
245- style: widget.dropDownTitleTileHintTextStyle ,
245+ '${widget .dropdownTitleTileHintText }' ,
246+ style: widget.dropdownTitleTileHintTextStyle ,
246247 ),
247248 dropdownTile (),
248249 const SizedBox (
@@ -255,7 +256,7 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
255256 ? Container (
256257 padding: const EdgeInsets .symmetric (vertical: 6 ),
257258 decoration: BoxDecoration (
258- color: widget.dropdownbgColor ,
259+ color: widget.dropdownBgColor ,
259260 boxShadow: const [
260261 BoxShadow (
261262 color: Colors .black12,
@@ -288,14 +289,14 @@ class _GFMultiSelectState<T> extends State<GFMultiSelect<T>> {
288289 padding: widget.padding,
289290 margin: widget.margin,
290291 size: widget.size,
291- activebgColor : widget.activebgColor ,
292+ activeBgColor : widget.activeBgColor ,
292293 inactiveIcon: widget.inactiveIcon,
293294 activeBorderColor: widget.activeBorderColor,
294- inactivebgColor : widget.inactivebgColor ,
295+ inactiveBgColor : widget.inactiveBgColor ,
295296 activeIcon: widget.activeIcon,
296297 inactiveBorderColor:
297298 widget.inactiveBorderColor,
298- custombgColor : widget.custombgColor ,
299+ customBgColor : widget.customBgColor ,
299300 checkColor: widget.checkColor,
300301 type: widget.type,
301302 ))),
0 commit comments