mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 19:48:56 +03:30
49 lines
1.4 KiB
Dart
Executable File
49 lines
1.4 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../../providers/labels.dart';
|
|
|
|
class LabelSearchBox extends StatelessWidget {
|
|
const LabelSearchBox({
|
|
Key? key,
|
|
required this.searchCTRL,
|
|
required double deviceBlockSize,
|
|
}) : _deviceBlockSize = deviceBlockSize,
|
|
super(key: key);
|
|
|
|
final TextEditingController searchCTRL;
|
|
final double _deviceBlockSize;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextField(
|
|
onEditingComplete: () {
|
|
FocusScope.of(context).unfocus();
|
|
},
|
|
onChanged: (value) {
|
|
Provider.of<LabelsProvider>(context, listen: false).search(value);
|
|
},
|
|
controller: searchCTRL,
|
|
decoration: InputDecoration(
|
|
icon: Icon(
|
|
FontAwesomeIcons.search,
|
|
size: 6 * _deviceBlockSize,
|
|
),
|
|
labelStyle: TextStyle(
|
|
fontWeight: FontWeight.w100,
|
|
fontSize: 4 * _deviceBlockSize,
|
|
),
|
|
labelText: 'Search by package name',
|
|
isDense: true,
|
|
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
|
),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontSize: 5 * _deviceBlockSize,
|
|
),
|
|
keyboardType: TextInputType.number,
|
|
);
|
|
}
|
|
}
|