@ -20,6 +20,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final bool Function ( EntityList ) isEntityListSelected ;
final List < EntityList > masterList ;
Function ( String val ) selectedType ;
final bool shouldDisplaySearchField ;
EntityListCheckboxSearchWidget ( {
Key ? key ,
@ -30,6 +31,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
required this . addProcedure ,
required this . isEntityListSelected ,
required this . selectedType ,
this . shouldDisplaySearchField = true ,
} ) : super ( key: key ) ;
@ override
@ -231,59 +233,62 @@ class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearc
child: ListView (
padding: EdgeInsets . all ( 12 ) ,
children: [
Padding (
padding: const EdgeInsets . only ( bottom: 12.0 ) ,
child: AppTextFieldCustom (
suffixWidget: _isSearching
? Padding (
padding: const EdgeInsets . all ( 12.0 ) ,
child: SizedBox (
width: 20 ,
height: 20 ,
child: CircularProgressIndicator (
strokeWidth: 2 ,
valueColor: AlwaysStoppedAnimation < Color > ( Color ( 0xFFD02127 ) ) ,
Visibility (
visible: widget . shouldDisplaySearchField ,
child: Padding (
padding: const EdgeInsets . only ( bottom: 12.0 ) ,
child: AppTextFieldCustom (
suffixWidget: _isSearching
? Padding (
padding: const EdgeInsets . all ( 12.0 ) ,
child: SizedBox (
width: 20 ,
height: 20 ,
child: CircularProgressIndicator (
strokeWidth: 2 ,
valueColor: AlwaysStoppedAnimation < Color > ( Color ( 0xFFD02127 ) ) ,
) ,
) ,
)
: InkWell (
onTap: ( ) {
if ( procedureName . text . length > = 3 ) {
widget . model . filterSearchResults (
procedureName . text , widget . masterList , items ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( _ ) {
/ / if ( mounted ) {
/ / setState ( ( ) { } ) ;
/ / }
} ) ;
}
} ,
child: Icon (
Icons . search ,
size: 25.0 ,
) ,
) ,
) ,
)
: InkWell (
onTap: ( ) {
if ( procedureName . text . length > = 3 ) {
widget . model . filterSearchResults (
procedureName . text , widget . masterList , items ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( _ ) {
/ / if ( mounted ) {
/ / setState ( ( ) { } ) ;
/ / }
} ) ;
hintText: TranslationBase . of ( context ) . searchProcedureHere ,
isTextFieldHasSuffix: false ,
maxLines: 1 ,
minLines: 1 ,
hasBorder: true ,
controller: procedureName ,
onChanged: ( value ) {
_onSearchChanged ( value ? ? ' ' ) ;
} ,
onFieldSubmitted: ( ) {
if ( procedureName . text . length > = 3 ) {
widget . model . filterSearchResults (
procedureName . text , widget . masterList , items ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( _ ) {
if ( mounted ) {
setState ( ( ) { } ) ;
}
} ,
child: Icon (
Icons . search ,
size: 25.0 ,
) ,
) ,
hintText: TranslationBase . of ( context ) . searchProcedureHere ,
isTextFieldHasSuffix: false ,
maxLines: 1 ,
minLines: 1 ,
hasBorder: true ,
controller: procedureName ,
onChanged: ( value ) {
_onSearchChanged ( value ? ? ' ' ) ;
} ,
onFieldSubmitted: ( ) {
if ( procedureName . text . length > = 3 ) {
widget . model . filterSearchResults (
procedureName . text , widget . masterList , items ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( _ ) {
if ( mounted ) {
setState ( ( ) { } ) ;
} ) ;
}
} ) ;
}
} ,
) ,
} ,
) ,
) ,
) ,
if ( items . isEmpty & & procedureName . text . length > = 3 )
Center (