77 lines
2.6 KiB
Dart
77 lines
2.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class EnhancedSearchView extends StatelessWidget {
|
|
const EnhancedSearchView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = FlutterFlowTheme.of(context);
|
|
final locale = FFLocalizations.of(context);
|
|
TextEditingController editingController = TextEditingController();
|
|
return TextFormField(
|
|
controller: editingController,
|
|
onChanged: (value) => EasyDebounce.debounce(
|
|
'_model.keyTextFieldTextController',
|
|
const Duration(milliseconds: 500),
|
|
() => filterBySearchBar(Document.fromDesc(value), context),
|
|
),
|
|
cursorColor: theme.primaryText,
|
|
showCursor: false,
|
|
cursorWidth: 2.0,
|
|
cursorRadius: Radius.circular(100),
|
|
style: TextStyle(
|
|
color: theme.primaryText,
|
|
fontSize: 16.0,
|
|
decorationColor: Colors.amber,
|
|
),
|
|
keyboardType: TextInputType.text,
|
|
textInputAction: TextInputAction.search,
|
|
autocorrect: true,
|
|
textCapitalization: TextCapitalization.sentences,
|
|
decoration: InputDecoration(
|
|
prefixIcon: Icon(Icons.search, color: theme.primary),
|
|
labelText: locale.getVariableText(
|
|
ptText: 'Pesquisar',
|
|
enText: 'Search',
|
|
),
|
|
labelStyle: TextStyle(
|
|
color: theme.primaryText,
|
|
fontSize: 16.0,
|
|
),
|
|
hintText: locale.getVariableText(
|
|
ptText: 'Digite sua pesquisa',
|
|
enText: 'Enter your search',
|
|
),
|
|
hintStyle: TextStyle(
|
|
color: theme.accent2,
|
|
fontSize: 14.0,
|
|
),
|
|
filled: true,
|
|
fillColor: Colors.transparent,
|
|
helperStyle: TextStyle(
|
|
color: theme.primaryText,
|
|
decorationColor: theme.primaryText,
|
|
),
|
|
focusColor: theme.primaryText,
|
|
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0),
|
|
enabledBorder: UnderlineInputBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
|
borderSide: BorderSide(color: theme.primaryText),
|
|
),
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
|
borderSide: BorderSide(color: theme.primaryText),
|
|
),
|
|
errorBorder: UnderlineInputBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
|
borderSide: BorderSide(color: theme.primaryText),
|
|
),
|
|
focusedErrorBorder: UnderlineInputBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
|
borderSide: BorderSide(color: theme.primaryText, width: 2.0),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|