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