You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
Dart
67 lines
1.9 KiB
Dart
|
4 years ago
|
import 'package:doctor_app_flutter/config/config.dart';
|
||
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:flutter/services.dart';
|
||
|
|
|
||
|
|
import 'app-textfield-custom.dart';
|
||
|
|
|
||
|
|
class AppTextFieldCustomSerach extends StatelessWidget {
|
||
|
|
const AppTextFieldCustomSerach({
|
||
|
|
Key key,
|
||
|
|
this.onChangeFun,
|
||
|
|
this.positionedChild,
|
||
|
|
this.marginTop,
|
||
|
|
this.suffixIcon,
|
||
|
|
this.validationError,
|
||
|
|
this.inputType,
|
||
|
|
this.inputFormatters,
|
||
|
|
this.searchController,
|
||
|
|
this.onFieldSubmitted,
|
||
|
|
this.hintText,
|
||
|
|
});
|
||
|
|
|
||
|
|
final TextEditingController searchController;
|
||
|
|
|
||
|
|
final Function onChangeFun;
|
||
|
|
final Function onFieldSubmitted;
|
||
|
|
|
||
|
|
final Widget positionedChild;
|
||
|
|
final IconButton suffixIcon;
|
||
|
|
final double marginTop;
|
||
|
|
final String validationError;
|
||
|
|
final String hintText;
|
||
|
|
|
||
|
|
final TextInputType inputType;
|
||
|
|
final List<TextInputFormatter> inputFormatters;
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Container(
|
||
|
|
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop),
|
||
|
|
child: Stack(
|
||
|
|
children: [
|
||
|
|
AppTextFieldCustom(
|
||
|
|
hintText:
|
||
|
|
hintText ?? TranslationBase.of(context).searchPatientName,
|
||
|
|
isTextFieldHasSuffix: true,
|
||
|
|
hasHintmargin: true,
|
||
|
|
inputFormatters: inputFormatters,
|
||
|
|
suffixIcon: suffixIcon ??
|
||
|
|
IconButton(
|
||
|
|
icon: Icon(
|
||
|
|
Icons.search,
|
||
|
|
color: Colors.black,
|
||
|
|
),
|
||
|
|
onPressed: () {},
|
||
|
|
),
|
||
|
|
controller: searchController,
|
||
|
|
onChanged: onChangeFun,
|
||
|
|
onFieldSubmitted: onFieldSubmitted,
|
||
|
|
validationError: validationError),
|
||
|
|
if (positionedChild != null)
|
||
|
|
Positioned(right: 35, top: 5, child: positionedChild)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|