Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.19.5 - 30/05/2026

- **Feature**
- Add `initiallyExpanded` parameter to control the initial expansion state of the expansion tiles [PR#161](https://github.com/koukibadr/Searchable-Listview/pull/161)

- **Bug Fix**
- Fix initial list update and rendering [PR#173](https://github.com/koukibadr/Searchable-Listview/pull/173)
- Stores the asyncListCallback result and transmit it as an argument of asyncListFilter [PR#180](https://github.com/koukibadr/Searchable-Listview/pull/180)

## 2.19.4 - 02/12/2025

- **Bug Fix**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add the package to your `pubspec.yaml`:

```yaml
dependencies:
searchable_listview: ^2.19.4
searchable_listview: ^2.19.5
```

Then run:
Expand Down
24 changes: 12 additions & 12 deletions example/lib/data/actors_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ final List<Actor> actors = [
Actor(age: 49, name: 'Ben', lastName: 'Affleck'),
];

final Map<String, List<Actor>> mapOfActors = {
'test 1': [
Actor(age: 47, name: 'Leonardo', lastName: 'DiCaprio'),
Actor(age: 66, name: 'Denzel', lastName: 'Washington'),
Actor(age: 49, name: 'Ben', lastName: 'Affleck'),
],
'test 2': [
Actor(age: 58, name: 'Johnny', lastName: 'Depp'),
Actor(age: 78, name: 'Robert', lastName: 'De Niro'),
Actor(age: 44, name: 'Tom', lastName: 'Hardy'),
]
};
final Map<String, List<Actor>> mapOfActors = {
'test 1': [
Actor(age: 47, name: 'Leonardo', lastName: 'DiCaprio'),
Actor(age: 66, name: 'Denzel', lastName: 'Washington'),
Actor(age: 49, name: 'Ben', lastName: 'Affleck'),
],
'test 2': [
Actor(age: 58, name: 'Johnny', lastName: 'Depp'),
Actor(age: 78, name: 'Robert', lastName: 'De Niro'),
Actor(age: 44, name: 'Tom', lastName: 'Hardy'),
]
};
3 changes: 2 additions & 1 deletion example/lib/widgets/basic_searchable_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class BasicSearchableListview extends StatefulWidget {
const BasicSearchableListview({Key? key}) : super(key: key);

@override
State<BasicSearchableListview> createState() => _BasicSearchableListviewState();
State<BasicSearchableListview> createState() =>
_BasicSearchableListviewState();
}

class _BasicSearchableListviewState extends State<BasicSearchableListview> {
Expand Down
32 changes: 16 additions & 16 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
dependency: "direct main"
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
url: "https://pub.dev"
source: hosted
version: "2.13.0"
version: "2.13.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -103,26 +103,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.20"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: df0c643f44ad098eb37988027a8e2b2b5a031fd3977f06bbfd3a76637e8df739
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.18.2"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -180,18 +180,18 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.12"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
sha256: "47a1b32ee755c3fcffa33db52a7258c137f97bdb2209a1075be847809fac4ccf"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.0"
vm_service:
dependency: transitive
description:
Expand All @@ -201,5 +201,5 @@ packages:
source: hosted
version: "15.0.0"
sdks:
dart: ">=3.8.0 <4.0.0"
dart: ">=3.10.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: searchable_listview
description: A new easy way to filter listview with simple implementation with
possibilty to customize search field and empty widget
version: 2.19.4
homepage: 'https://github.com/koukibadr/Searchable-Listview'
version: 2.19.5
homepage: "https://github.com/koukibadr/Searchable-Listview"
environment:
sdk: '>=2.12.0 <4.0.0'
flutter: '>=1.17.0'
sdk: ">=2.12.0 <4.0.0"
flutter: ">=1.17.0"
dependencies:
async: ^2.13.1
flutter:
Expand Down
47 changes: 32 additions & 15 deletions test/basic_searchable_listview_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ void main() {
var basicSearchableList = SearchableList<int>(
initialList: intList,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -51,7 +52,8 @@ void main() {
border: OutlineInputBorder(),
),
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand All @@ -69,7 +71,8 @@ void main() {
expect(find.text('Search Items'), findsOneWidget);
final searchField = find.byType(TextField);
expect(
test.widget<TextField>(searchField).decoration!.border is OutlineInputBorder,
test.widget<TextField>(searchField).decoration!.border
is OutlineInputBorder,
isTrue,
);
});
Expand All @@ -83,7 +86,8 @@ void main() {
initialList: <int>[],
emptyWidget: const Text('No items found'),
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -112,7 +116,8 @@ void main() {
var basicSearchableList = SearchableList<int>(
initialList: intList,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -154,7 +159,8 @@ void main() {
var basicSearchableList = SearchableList<int>(
initialList: intList,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -185,7 +191,8 @@ void main() {
var basicSearchableList = SearchableList<int>(
initialList: <int>[],
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -216,7 +223,9 @@ void main() {
var basicSearchableList = SearchableList<String>(
initialList: stringList,
itemBuilder: (item) => Text(item),
filter: (query) => stringList.where((item) => item.toString().contains(query)).toList(),
filter: (query) => stringList
.where((item) => item.toString().contains(query))
.toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -261,7 +270,8 @@ void main() {
initialList: intList,
displayClearIcon: true,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand All @@ -288,7 +298,8 @@ void main() {
initialList: intList,
displayClearIcon: true,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
);

await test.pumpWidget(
Expand Down Expand Up @@ -324,7 +335,8 @@ void main() {
initialList: intList,
displayClearIcon: true,
itemBuilder: (item) => DummyListItem(index: item),
filter: (query) => intList.where((item) => item.toString().contains(query)).toList(),
filter: (query) =>
intList.where((item) => item.toString().contains(query)).toList(),
fieldValidator: (value) {
if (value == null || value.isEmpty) {
return 'Search field cannot be empty';
Expand All @@ -345,9 +357,12 @@ void main() {
if (formKey.currentState!.validate()) {
// If the form is valid, the valid elements will show automatically.
} else {
ScaffoldMessenger.of(tester.element(find.byType(ElevatedButton))).showSnackBar(
ScaffoldMessenger.of(
tester.element(find.byType(ElevatedButton)))
.showSnackBar(
const SnackBar(
content: Text('Please fix the errors in the search field'),
content: Text(
'Please fix the errors in the search field'),
duration: Duration(seconds: 1),
),
);
Expand All @@ -371,7 +386,8 @@ void main() {
await tester.pumpAndSettle();

// Check for validation error message
expect(find.text('Please fix the errors in the search field'), findsOneWidget);
expect(find.text('Please fix the errors in the search field'),
findsOneWidget);

await tester.pumpAndSettle(const Duration(seconds: 2));
// Enter valid search query
Expand All @@ -380,7 +396,8 @@ void main() {
await tester.pumpAndSettle();

// Check that validation error message is gone and results are shown
expect(find.text('Please fix the errors in the search field'), findsNothing);
expect(find.text('Please fix the errors in the search field'),
findsNothing);
expect(find.text('Item 1'), findsOneWidget);
});
},
Expand Down
Loading