mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-12 07:08:55 +03:30
Set search for labels by api
This commit is contained in:
@@ -17,12 +17,13 @@ class LabelSearchBox extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var searchVal;
|
||||
return TextField(
|
||||
onEditingComplete: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
onChanged: (value) {
|
||||
Provider.of<LabelsProvider>(context, listen: false).search(value);
|
||||
onChanged: (value) async {
|
||||
searchVal = value;
|
||||
},
|
||||
controller: searchCTRL,
|
||||
decoration: InputDecoration(
|
||||
@@ -37,6 +38,27 @@ class LabelSearchBox extends StatelessWidget {
|
||||
labelText: 'Search by package name',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
onTap: () async {
|
||||
var labels = await Provider.of<LabelsProvider>(
|
||||
context,
|
||||
listen: false);
|
||||
labels.setLoading();
|
||||
await labels.search(searchVal);
|
||||
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.input,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
|
||||
Reference in New Issue
Block a user