Files
cssd/lib/widgets/CycleScreens/Result/search_box.dart
2023-11-22 14:53:35 +04:30

52 lines
1.4 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ResultSearchBox extends StatelessWidget {
const ResultSearchBox({
Key? key,
required this.searchCTRL,
required double deviceBlockSize,
required this.text,
required this.onChanged,
this.text2 = 'ID',
this.textInputType = TextInputType.number,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final TextEditingController searchCTRL;
final double _deviceBlockSize;
final String text;
final String text2;
final dynamic onChanged;
final TextInputType textInputType;
@override
Widget build(BuildContext context) {
return TextField(
onEditingComplete: () {
FocusScope.of(context).unfocus();
},
controller: searchCTRL,
onChanged: onChanged,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.search,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Search by $text $text2',
isDense: true,
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: textInputType,
);
}
}