Commit b0bd7f6a by Rizal Hermawan

add new parameters

parent 6ead27a4
...@@ -39,6 +39,8 @@ class AnimSearchBar extends StatefulWidget { ...@@ -39,6 +39,8 @@ class AnimSearchBar extends StatefulWidget {
final List<TextInputFormatter>? inputFormatters; final List<TextInputFormatter>? inputFormatters;
final bool boxShadow; final bool boxShadow;
final Function(String) onSubmitted; final Function(String) onSubmitted;
final TextStyle? helpTextStyle;
final double helpTextContentPadding;
const AnimSearchBar({ const AnimSearchBar({
Key? key, Key? key,
...@@ -88,6 +90,12 @@ class AnimSearchBar extends StatefulWidget { ...@@ -88,6 +90,12 @@ class AnimSearchBar extends StatefulWidget {
/// can add list of inputformatters to control the input /// can add list of inputformatters to control the input
this.inputFormatters, this.inputFormatters,
this.helpTextStyle = const TextStyle(
color: Color(0xff5B5B5B),
fontSize: 17.0,
fontWeight: FontWeight.w500,
),
this.helpTextContentPadding = 5.0,
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -274,15 +282,11 @@ class _AnimSearchBarState extends State<AnimSearchBar> ...@@ -274,15 +282,11 @@ class _AnimSearchBarState extends State<AnimSearchBar>
: TextStyle(color: Colors.black), : TextStyle(color: Colors.black),
cursorColor: Colors.black, cursorColor: Colors.black,
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: const EdgeInsets.only(bottom: 5), contentPadding: EdgeInsets.only(bottom: widget.helpTextContentPadding),
isDense: true, isDense: true,
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
labelText: widget.helpText, labelText: widget.helpText,
labelStyle: TextStyle( labelStyle: widget.helpTextStyle,
color: Color(0xff5B5B5B),
fontSize: 17.0,
fontWeight: FontWeight.w500,
),
alignLabelWithHint: true, alignLabelWithHint: true,
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment