Skip to content

Commit

Permalink
feat(equipped_card): πŸ’„ remove overflow gradient (#46)
Browse files Browse the repository at this point in the history
* feat(equipped_card): πŸ’„ remove overflow gradient

* fix(autocomplete_entries_list_view): πŸ› remove flickering padding top

* fix(search_bar_results): πŸ› trim value before triggering change notifier
  • Loading branch information
albertms10 authored Feb 2, 2024
1 parent 81517bb commit f5e217d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 39 deletions.
2 changes: 1 addition & 1 deletion lib/src/widgets/autocomplete_entries_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AutocompleteEntriesListView extends StatelessWidget {

case ConnectionState.waiting:
return ListView(
padding: const EdgeInsets.symmetric(vertical: 30),
padding: const EdgeInsets.only(bottom: 60),
itemExtent: autocompleteEntryCardHeight,
children: const [
EquippedCard(
Expand Down
48 changes: 11 additions & 37 deletions lib/src/widgets/equipped_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,43 +55,17 @@ class _EquippedCardBody extends StatelessWidget {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

return InkWell(
onTap: onTap,
child: Card(
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
height: height,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Wrap(
clipBehavior: Clip.antiAlias,
children: children,
),
),
ClipRRect(
borderRadius: const BorderRadiusDirectional.only(
bottomStart: Radius.circular(12),
bottomEnd: Radius.circular(12),
),
child: Container(
height: 32,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
theme.cardColor.withOpacity(0),
theme.cardColor,
],
stops: const [0, 0.75],
),
),
),
),
],
return Card(
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(12)),
onTap: onTap,
child: Container(
height: height,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Wrap(
clipBehavior: Clip.antiAlias,
children: children,
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/search_bar_results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class _SearchBarResultsState extends State<SearchBarResults> {
void _onChanged(String value) {
if (_debounce?.isActive ?? false) _debounce!.cancel();
_debounce = Timer(const Duration(milliseconds: 500), () {
_query.value = value;
_query.value = value.trim();
});
}

Expand Down

0 comments on commit f5e217d

Please sign in to comment.