Skip to content

Commit 8c9bea2

Browse files
authored
Changes on prefixes and suffixes on ThemedTextInput (#95)
2 parents 8bc5e23 + 18d2d96 commit 8c9bea2

3 files changed

Lines changed: 37 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 7.3.1
4+
5+
- Fixed behavior of `ThemedTextInput` multiple prefixes or suffixes, now will display correctly.
6+
37
## 7.3.0
48

59
- Stable release

lib/src/inputs/src/general/text_input.dart

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -278,26 +278,24 @@ class _ThemedTextInputState extends State<ThemedTextInput> with TickerProviderSt
278278

279279
if (widget.prefixWidget != null) {
280280
prefixes.add(
281-
InkWell(
282-
onTap: widget.onPrefixTap,
283-
child: widget.prefixWidget,
281+
Padding(
282+
padding: const EdgeInsets.only(left: 10),
283+
child: InkWell(
284+
onTap: widget.onPrefixTap,
285+
child: widget.prefixWidget,
286+
),
284287
),
285288
);
286289
}
287290
if (widget.prefixIcon != null) {
288291
prefixes.add(
289-
InkWell(
290-
borderRadius: BorderRadius.circular(20),
291-
onTap: widget.onPrefixTap,
292-
child: Icon(widget.prefixIcon, size: 18),
293-
),
294-
);
295-
}
296-
if (widget.prefixText != null) {
297-
prefixes.add(
298-
Text(
299-
widget.prefixText!,
300-
style: Theme.of(context).textTheme.bodySmall,
292+
Padding(
293+
padding: const EdgeInsets.only(left: 10),
294+
child: InkWell(
295+
borderRadius: BorderRadius.circular(20),
296+
onTap: widget.onPrefixTap,
297+
child: Icon(widget.prefixIcon, size: 18),
298+
),
301299
),
302300
);
303301
}
@@ -316,31 +314,41 @@ class _ThemedTextInputState extends State<ThemedTextInput> with TickerProviderSt
316314

317315
if (widget.suffixWidget != null) {
318316
suffixes.add(
319-
InkWell(
320-
onTap: widget.onSuffixTap,
321-
child: widget.suffixWidget,
317+
Padding(
318+
padding: const EdgeInsets.only(right: 10),
319+
child: InkWell(
320+
onTap: widget.onSuffixTap,
321+
child: widget.suffixWidget,
322+
),
322323
),
323324
);
324325
}
325326

326327
if (widget.suffixIcon != null) {
327328
suffixes.add(
328-
InkWell(
329-
borderRadius: BorderRadius.circular(20),
330-
onTap: widget.onSuffixTap,
331-
child: Icon(widget.suffixIcon, size: 18),
329+
Padding(
330+
padding: const EdgeInsets.only(right: 10),
331+
child: InkWell(
332+
borderRadius: BorderRadius.circular(20),
333+
onTap: widget.onSuffixTap,
334+
child: Icon(widget.suffixIcon, size: 18),
335+
),
332336
),
333337
);
334338
}
335339

336340
if (widget.disabled) {
337-
suffixes.add(Icon(LayrzIcons.solarOutlineLockKeyhole, size: 18));
341+
suffixes.add(
342+
Padding(
343+
padding: const EdgeInsets.only(right: 10),
344+
child: Icon(LayrzIcons.solarOutlineLockKeyhole, size: 18),
345+
),
346+
);
338347
}
339348

340349
Widget? suffix;
341350
if (suffixes.isNotEmpty) {
342351
suffix = Row(
343-
spacing: 5,
344352
mainAxisSize: MainAxisSize.min,
345353
mainAxisAlignment: MainAxisAlignment.center,
346354
crossAxisAlignment: CrossAxisAlignment.center,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: layrz_theme
22
description: Layrz standard styling library for Flutter.
3-
version: "7.3.0"
3+
version: "7.3.1"
44
homepage: https://theme.layrz.com
55
repository: https://github.com/goldenm-software/layrz_theme
66

0 commit comments

Comments
 (0)