Skip to content

Commit

Permalink
Merge pull request #229 from takenet/feature/552509-improve-templates…
Browse files Browse the repository at this point in the history
…-loading

Added enabled param
  • Loading branch information
githubdoandre authored Nov 16, 2023
2 parents e4f39fd + de852f5 commit 41cfa56
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lib/src/widgets/fields/ds_search_input.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class DSSearchInput extends StatelessWidget {
this.hintText,
this.iconBackgroundColor = DSColors.disabledBg,
this.iconForegroundColor = DSColors.primaryNight,
this.enabled,
});

final void Function(String term) onSearch;
Expand All @@ -25,13 +26,15 @@ class DSSearchInput extends StatelessWidget {
final String? hintText;
final Color iconBackgroundColor;
final Color iconForegroundColor;
final bool? enabled;

// TODO: check if can use DSTextField or DSInputContainer
@override
Widget build(BuildContext context) {
return SizedBox(
height: 44.0,
child: TextField(
enabled: enabled ?? true,
focusNode: focusNode,
controller: controller,
onChanged: onSearch,
Expand Down Expand Up @@ -81,13 +84,8 @@ class DSSearchInput extends StatelessWidget {
width: 1.0,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(
color: DSColors.neutralMediumWave,
width: 1.0,
),
),
disabledBorder: _getBorder(),
enabledBorder: _getBorder(),
filled: true,
hintText: hintText,
hintStyle: const DSBodyTextStyle(
Expand All @@ -97,4 +95,12 @@ class DSSearchInput extends StatelessWidget {
),
);
}

OutlineInputBorder _getBorder() => OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(
color: DSColors.neutralMediumWave,
width: 1.0,
),
);
}

0 comments on commit 41cfa56

Please sign in to comment.