Set search test result by api

This commit is contained in:
hanie.khodkari
2025-05-10 18:27:37 +03:30
parent 12758968c9
commit b43d5c90fd
3 changed files with 54 additions and 25 deletions
@@ -17,12 +17,13 @@ class TestResultSearchBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
var textVal;
return TextField(
onEditingComplete: () {
FocusScope.of(context).unfocus();
},
onChanged: (value) {
Provider.of<TestResultsProvider>(context, listen: false).search(value);
onChanged: (value) async {
textVal = value;
},
controller: searchCTRL,
decoration: InputDecoration(
@@ -37,6 +38,26 @@ class TestResultSearchBox extends StatelessWidget {
labelText: 'Search by test name',
isDense: true,
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
suffixIcon: InkWell(
onTap: () async {
var testResults =
await Provider.of<TestResultsProvider>(context, listen: false);
testResults.setLoading();
await testResults.search(textVal);
},
child: Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.space_bar,
// size: 4 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
style: TextStyle(
fontWeight: FontWeight.w700,