@ -1,245 +1,273 @@
import ' package:after_layout/after_layout.dart ' ;
import ' package:carousel_slider/carousel_slider.dart ' ;
import ' package:diplomaticquarterapp/config/config.dart ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/core/model/ImagesInfo.dart ' ;
import ' package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.dart ' ;
import ' package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart ' ;
import ' package:diplomaticquarterapp/core/model/packages_offers/requests/OffersProductsRequestModel.dart ' ;
import ' package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart ' ;
import ' package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart ' ;
import ' package:diplomaticquarterapp/pages/base/base_view.dart ' ;
import ' package:diplomaticquarterapp/pages/packages_offers/ClinicOfferAndPackagesPage.dart ' ;
import ' package:diplomaticquarterapp/pages/packages_offers/CreateCustomerDailogPage.dart ' ;
import ' package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart ' ;
import ' package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart ' ;
import ' package:diplomaticquarterapp/routes.dart ' ;
import ' package:diplomaticquarterapp/services/authentication/auth_provider.dart ' as auth ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils.dart ' as utils ;
import ' package:diplomaticquarterapp/ widgets/carousel_indicator/carousel_indicator .dart' ;
import ' package:diplomaticquarterapp/widgets/d ata_display/text .dart' ;
import ' package:diplomaticquarterapp/ uitl/utils_new .dart' ;
import ' package:diplomaticquarterapp/widgets/d ialogs/radio_selection_dialog .dart' ;
import ' package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart ' ;
import ' package:flutter/cupertino.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/rendering.dart ' ;
import ' package:flutter_material_pickers/flutter_material_pickers.dart ' ;
dynamic languageID ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:provider/provider.dart ' ;
class PackagesHomePage extends StatefulWidget {
final AuthenticatedUser user ;
PackagesHomePage ( this . user ) ;
@ override
_PackagesHomePageState createState ( ) = > _PackagesHomePageState ( ) ;
}
class _PackagesHomePageState extends State < PackagesHomePage > with AfterLayoutMixin < PackagesHomePage > {
getLanguageID ( ) async {
languageID = await sharedPref . getString ( APP_LANGUAGE ) ;
}
class _PackagesHomePageState extends State < PackagesHomePage > {
ProjectViewModel projectViewModel ;
@ override
void initState ( ) {
super . initState ( ) ;
getLanguageID ( ) ;
}
@ override
void afterFirstLayout ( BuildContext context ) async {
viewModel . service . patientUser = widget . user ;
viewModel . service . loadOffersPackagesDataForMainPage ( context: context , completion: ( ) {
setState ( ( ) { } ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( timeStamp ) {
viewModel . service . patientUser = widget . user ;
viewModel . service . loadOffersPackagesDataForMainPage (
context: context ,
completion: ( ) {
setState ( ( ) { } ) ;
} ) ;
} ) ;
}
/ / Controllers
var _searchTextController = TextEditingController ( ) ;
var _filterTextController = TextEditingController ( ) ;
var _carouselController = CarouselController ( ) ;
int carouselIndicatorIndex = 0 ;
CarouselSlider _bannerCarousel ;
TextField _textFieldSearch ;
TextField _textFieldFilterSelection ;
ListView _listViewLatestOffers ;
ListView _listViewBestSeller ;
PackagesViewModel viewModel ;
onCartClick ( ) {
if ( viewModel . service . customer = = null ) {
onCartClick ( ) {
if ( viewModel . service . customer = = null ) {
utils . Utils . showErrorToast ( " Cart is empty for your current session " ) ;
return ;
}
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > PackagesCartPage ( )
)
) ;
Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( BuildContext context ) = > PackagesCartPage ( ) ) ) ;
}
onProductCartClick ( PackagesResponseModel product ) async {
if ( viewModel . service . customer = = null ) {
if ( viewModel . service . customer = = null ) {
/ / viewModel . service . customer = await CreateCustomerDialogPage ( context: context ) . show ( ) ;
loginCheck ( context ) ;
}
if ( viewModel . service . customer ! = null ) {
if ( viewModel . service . customer ! = null ) {
var request = AddProductToCartRequestModel ( product_id: product . id , customer_id: viewModel . service . customer . id ) ;
await viewModel . service . addProductToCart ( request , context: context ) . then ( ( response ) {
/ / appScaffold . appBar . badgeUpdater ( viewModel . service . cartItemCount ) ;
} ) . catchError ( ( error ) {
await viewModel . service . addProductToCart ( request , context: context ) . then ( ( response ) { } ) . catchError ( ( error ) {
utils . Utils . showErrorToast ( error . toString ( ) ) ;
} ) ;
}
}
AppScaffold appScaffold ;
PackagesCategoriesResponseModel selectedClinic ;
@ override
Widget build ( BuildContext context ) {
projectViewModel = Provider . of ( context ) ;
return BaseView < PackagesViewModel > (
allowAny: true ,
onModelReady: ( model ) = > viewModel = model ,
builder: ( _ , model , wi ) {
return
appScaffold =
AppScaffold (
description: TranslationBase . of ( context ) . offerAndPackagesDetails ,
imagesInfo: [ ImagesInfo ( imageAr: ' https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png ' , imageEn: ' https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png ' ) ] ,
appBarTitle: TranslationBase . of ( context ) . offerAndPackages ,
isShowAppBar: true ,
isPharmacy: false ,
showPharmacyCart: false ,
showHomeAppBarIcon: false ,
isOfferPackages: true ,
showOfferPackagesCart: true ,
isShowDecPage: false ,
body: ListView (
allowAny: true ,
onModelReady: ( model ) = > viewModel = model ,
builder: ( _ , model , wi ) {
return appScaffold = AppScaffold (
description: TranslationBase . of ( context ) . offerAndPackagesDetails ,
imagesInfo: [ ImagesInfo ( imageAr: ' https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png ' , imageEn: ' https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png ' ) ] ,
appBarTitle: TranslationBase . of ( context ) . offerAndPackages ,
isShowAppBar: true ,
isPharmacy: false ,
showPharmacyCart: false ,
isOfferPackages: true ,
showOfferPackagesCart: false ,
isShowDecPage: false ,
showNewAppBar: true ,
showNewAppBarTitle: true ,
body: SingleChildScrollView (
child: Column (
children: [
Padding (
padding: projectViewModel . isArabic ? const EdgeInsets . only ( top: 21 , right: 21 , bottom: 21 ) : const EdgeInsets . only ( top: 21 , left: 21 , bottom: 21 ) ,
child: Column (
children: [
/ / Top Banner Carousel
AspectRatio (
aspectRatio: 2.2 / 1 ,
child: bannerCarousel ( )
inputWidget ( TranslationBase . of ( context ) . search , " " , _searchTextController , isInputTypeNum: false ) ,
SizedBox (
height: 10 ,
) ,
Center (
child: CarouselIndicator (
activeColor: Theme . of ( context ) . appBarTheme . color ,
color: Colors . grey [ 300 ] ,
cornerRadius: 15 ,
width: 15 , height: 15 ,
count: _bannerCarousel . itemCount ,
index: carouselIndicatorIndex ,
onClick: ( index ) {
debugPrint ( ' onClick at ${ index } ' ) ;
InkWell (
onTap: ( ) = > showClinicSelectionList ( ) ,
child: Container (
padding: EdgeInsets . all ( 12 ) ,
margin: projectViewModel . isArabic ? const EdgeInsets . only ( left: 21 ) : const EdgeInsets . only ( right: 21 ) ,
width: double . infinity ,
height: 65 ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 12 ) ,
border: Border . all (
color: Color ( 0xffefefef ) ,
width: 1 ,
) ,
color: Colors . white ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Text (
selectedClinic ! = null ? selectedClinic . name : TranslationBase . of ( context ) . browseOffers ,
style: TextStyle (
fontSize: 14 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.46 ,
) ,
) ,
Icon ( Icons . arrow_drop_down ) ,
] ,
) ,
) ,
) ,
SizedBox (
height: 20 ,
) ,
Container (
width: double . infinity ,
height: MediaQuery . of ( context ) . size . width * 0.8 ,
child: ListView . separated (
scrollDirection: Axis . horizontal ,
shrinkWrap: true ,
itemCount: viewModel . bestSellerList . length ,
separatorBuilder: ( context , index ) {
return mWidth ( 9.0 ) ;
} ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard (
itemModel: viewModel . bestSellerList [ index ] ,
onCartClick: onProductCartClick ,
) ;
} ,
) ,
) ,
SizedBox ( height: 10 , ) ,
Padding (
padding: const EdgeInsets . all ( 15 ) ,
child: Column (
children: [
/ / Search Textfield
searchTextField ( ) ,
SizedBox ( height: 10 , ) ,
/ / Filter Selection
filterOptionSelection ( ) ,
SizedBox ( height: 20 , ) ,
/ / Horizontal Scrollable Cards
Texts (
" Latest offers " ,
fontWeight: FontWeight . bold ,
color: Colors . black87 ,
fontSize: 20
) ,
/ / Latest Offers Horizontal Scrollable List
AspectRatio (
aspectRatio: 1.3 / 1 ,
child: LayoutBuilder ( builder: ( context , constraints ) {
double itemContentPadding = 10 ;
double itemWidth = ( constraints . maxWidth / 2 ) - ( itemContentPadding * 2 ) ;
return latestOfferListView ( itemWidth: itemWidth , itemContentPadding: itemContentPadding ) ;
} ) ,
) ,
SizedBox ( height: 10 , ) ,
Texts (
" Best sellers " ,
fontWeight: FontWeight . bold ,
color: Colors . black87 ,
fontSize: 20
) ,
/ / Best Seller Horizontal Scrollable List
AspectRatio (
aspectRatio: 1.3 / 1 ,
child: LayoutBuilder ( builder: ( context , constraints ) {
double itemContentPadding = 10 ; / / 10 is content padding in each item
double itemWidth = ( constraints . maxWidth / 2 ) - ( itemContentPadding * 2 /* 2 = LeftRight */ ) ;
return bestSellerListView ( itemWidth: itemWidth , itemContentPadding: itemContentPadding ) ;
} ) ,
)
] , ) ,
SizedBox (
height: 21 ,
) ,
/ / / / Best Seller Horizontal Scrollable List
Container (
width: double . infinity ,
height: MediaQuery . of ( context ) . size . width * 0.8 ,
child: ListView . separated (
scrollDirection: Axis . horizontal ,
shrinkWrap: true ,
itemCount: viewModel . latestOffersList . length ,
separatorBuilder: ( context , index ) {
return mWidth ( 9.0 ) ;
} ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard (
itemModel: viewModel . latestOffersList [ index ] ,
onCartClick: onProductCartClick ,
) ;
} ,
) ,
) ,
] ,
) ,
) ,
SizedBox (
height: 50.0 ,
)
. setOnAppBarCartClick ( onCartClick ) ;
}
] ,
) ,
) ,
bottomSheet: Container (
color: Colors . white ,
padding: const EdgeInsets . all ( 12.0 ) ,
child: SizedBox (
height: 43 ,
width: double . infinity ,
child: FlatButton (
onPressed: ( ) {
onCartClick ( ) ;
} ,
child: Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: [
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: SvgPicture . asset ( " assets/images/new/cart.svg " ) ,
/ / child: Icon (
/ / Icons . add_shopping_cart_rounded ,
/ / size: 30.0 ,
/ / color: Colors . white ,
/ / ) ,
) ,
Container (
child: Text (
TranslationBase . of ( context ) . myCart ,
textAlign: TextAlign . center ,
style: TextStyle ( fontSize: 16 , fontWeight: FontWeight . w600 , color: Colors . white , letterSpacing: - 0.48 ) ,
) ,
) ,
] ,
) ,
color: const Color ( 0xffD02127 ) ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 6 ) ,
) ,
) ,
) ,
) ,
) ;
} ,
) ;
}
showClinicSelectionList ( ) async {
var clinics = viewModel . service . categoryList ;
if ( clinics . isEmpty ) {
if ( clinics . isEmpty ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
clinics = await viewModel . service . getAllCategories ( OffersCategoriesRequestModel ( ) ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
}
List < String > options = clinics . map ( ( e ) = > e . toString ( ) ) . toList ( ) ;
showMaterialSelectionPicker (
List < RadioSelectionDialogModel > list = [
for ( int i = 0 ; i < clinics . length ; i + + ) RadioSelectionDialogModel ( clinics [ i ] . name , i ) ,
] ;
showDialog (
context: context ,
title: " Select Clinic " ,
items: options ,
selectedItem: options . first ,
onChanged: ( value ) async {
var selectedClinic = clinics . firstWhere ( ( element ) = > element . toString ( ) = = value ) ;
var clinicProducts = await viewModel . service . getAllProducts ( request: OffersProductsRequestModel ( categoryId: selectedClinic . id ) , context: context , showLoading: true ) ;
if ( clinicProducts . isNotEmpty )
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > ClinicPackagesPage ( products: clinicProducts )
)
) ;
else
utils . Utils . showErrorToast ( " No offers available for this clinic " ) ;
} ,
child: RadioSelectionDialog (
listData: list ,
selectedIndex: 0 ,
isScrollable: true ,
onValueSelected: ( index ) async {
selectedClinic = clinics [ index ] ;
var clinicProducts = await viewModel . service . getAllProducts ( request: OffersProductsRequestModel ( categoryId: selectedClinic . id ) , context: context , showLoading: true ) ;
if ( clinicProducts . isNotEmpty )
Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( BuildContext context ) = > ClinicPackagesPage ( products: clinicProducts ) ) ) ;
else
utils . Utils . showErrorToast ( " No offers available for this clinic " ) ;
setState ( ( ) { } ) ;
} ,
) ,
) ;
}
@ -247,182 +275,48 @@ class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMix
/ / Main Widgets of Page
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CarouselSlider bannerCarousel ( ) {
_bannerCarousel = CarouselSlider . builder (
carouselController: _carouselController ,
itemCount: 10 ,
itemBuilder: ( BuildContext context , int itemIndex ) {
return Padding (
padding: const EdgeInsets . only ( top: 10 , bottom: 10 , left: 15 , right: 15 ) ,
child: FractionallySizedBox (
widthFactor: 1 ,
heightFactor: 1 ,
child: utils . applyShadow (
spreadRadius: 1 ,
blurRadius: 5 ,
child: InkWell (
child: ClipRRect (
borderRadius: BorderRadius . circular ( 10 ) ,
child: utils . Utils . loadNetworkImage ( url: " https://wallpaperaccess.com/full/30103.jpg " , )
) ,
onTap: ( ) {
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > OfferAndPackagesDetail ( model: " " , )
)
) ;
} ,
)
) ,
) ,
Widget latestOfferListView ( { @ required double itemWidth , @ required double itemContentPadding } ) {
return _listViewLatestOffers = ListView . separated (
scrollDirection: Axis . horizontal ,
shrinkWrap: true ,
itemCount: viewModel . bestSellerList . length ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard (
itemWidth: itemWidth ,
itemContentPadding: itemContentPadding ,
itemModel: viewModel . bestSellerList [ index ] ,
onCartClick: onProductCartClick ,
) ;
} ,
options: CarouselOptions (
autoPlayInterval: Duration ( milliseconds: 3500 ) ,
enlargeStrategy: CenterPageEnlargeStrategy . scale ,
enlargeCenterPage: true ,
autoPlay: false ,
autoPlayCurve: Curves . fastOutSlowIn ,
enableInfiniteScroll: true ,
autoPlayAnimationDuration: Duration ( milliseconds: 1500 ) ,
viewportFraction: 1 ,
onPageChanged: ( page , reason ) {
setState ( ( ) {
carouselIndicatorIndex = page ;
} ) ;
} ,
) ,
separatorBuilder: separator ,
) ;
return _bannerCarousel ;
}
TextField searchTextField ( ) {
return _textFieldSearch =
TextField (
controller: _searchTextController ,
decoration: InputDecoration (
contentPadding: EdgeInsets . only ( top: 0.0 , bottom: 0.0 , left: 10 , right: 10 ) ,
enabledBorder: OutlineInputBorder (
borderSide: BorderSide ( width: 0.5 , color: Colors . grey ) ,
borderRadius: const BorderRadius . all (
const Radius . circular ( 10.0 ) ,
) ,
) ,
focusedBorder: OutlineInputBorder (
borderSide: BorderSide ( width: 1 , color: Colors . grey ) ,
borderRadius: const BorderRadius . all (
const Radius . circular ( 10.0 ) ,
) ,
) ,
filled: true ,
fillColor: Colors . white ,
hintText: " Search " ,
hintStyle: TextStyle ( color: Colors . grey [ 350 ] , fontWeight: FontWeight . bold ) ,
suffixIcon: IconButton (
onPressed: ( ) {
/ / viewModel . search ( text: _searchTextController . text ) ;
} ,
icon: Icon ( Icons . search_rounded , size: 35 , ) ,
) ,
) ,
) ;
}
Widget filterOptionSelection ( ) {
_textFieldFilterSelection =
TextField (
enabled: false ,
controller: _searchTextController ,
decoration: InputDecoration (
contentPadding: EdgeInsets . only ( top: 0.0 , bottom: 0.0 , left: 10 , right: 10 ) ,
border: OutlineInputBorder (
borderSide: BorderSide ( color: Colors . grey , width: 1 ) ,
borderRadius: const BorderRadius . all (
const Radius . circular ( 10.0 ) ,
) ,
) ,
disabledBorder: OutlineInputBorder (
borderSide: BorderSide ( width: 0.5 , color: Colors . grey ) ,
borderRadius: const BorderRadius . all (
const Radius . circular ( 10.0 ) ,
) ,
) ,
focusedBorder: OutlineInputBorder (
borderRadius: const BorderRadius . all (
const Radius . circular ( 10.0 ) ,
) ,
) ,
filled: true ,
fillColor: Colors . white ,
hintText: " Browse offers by Clinic " ,
hintStyle: TextStyle ( color: Colors . grey [ 350 ] , fontWeight: FontWeight . bold ) ,
suffixIcon: IconButton (
onPressed: ( ) {
showClinicSelectionList ( ) ;
} ,
icon: Icon ( Icons . keyboard_arrow_down_rounded , size: 35 , color: Colors . grey , ) ,
) ,
) ,
Widget bestSellerListView ( { @ required double itemWidth , @ required double itemContentPadding } ) {
return _listViewLatestOffers = ListView . separated (
scrollDirection: Axis . horizontal ,
itemCount: viewModel . bestSellerList . length ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard (
itemWidth: itemWidth ,
itemContentPadding: itemContentPadding ,
itemModel: viewModel . bestSellerList [ index ] ,
onCartClick: onProductCartClick ,
) ;
return InkWell (
child: _textFieldFilterSelection ,
onTap: ( ) {
showClinicSelectionList ( ) ;
} ,
separatorBuilder: separator ,
) ;
}
Widget latestOfferListView ( { @ required double itemWidth , @ required double itemContentPadding } ) {
return _listViewLatestOffers =
ListView . separated (
scrollDirection: Axis . horizontal ,
itemCount: viewModel . bestSellerList . length ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard ( itemWidth: itemWidth , itemContentPadding: itemContentPadding , itemModel: viewModel . bestSellerList [ index ] , onCartClick: onProductCartClick , ) ;
} ,
separatorBuilder: separator ,
) ;
}
Widget bestSellerListView ( { @ required double itemWidth , @ required double itemContentPadding } ) {
return _listViewLatestOffers =
ListView . separated (
scrollDirection: Axis . horizontal ,
itemCount: viewModel . bestSellerList . length ,
itemBuilder: ( BuildContext context , int index ) {
return PackagesItemCard ( itemWidth: itemWidth , itemContentPadding: itemContentPadding , itemModel: viewModel . bestSellerList [ index ] , onCartClick: onProductCartClick , ) ;
} ,
separatorBuilder: separator ,
) ;
}
Widget separator ( BuildContext context , int index ) {
Widget separator ( BuildContext context , int index ) {
return Container (
width: 1 ,
decoration: BoxDecoration (
gradient: LinearGradient (
begin: Alignment ( - 1.0 , - 2.0 ) ,
end: Alignment ( 1.0 , 4.0 ) ,
colors: [
Colors . grey ,
Colors . grey [ 100 ] ,
Colors . grey [ 200 ] ,
Colors . grey [ 300 ] ,
Colors . grey [ 400 ] ,
Colors . grey [ 500 ]
]
) ) ,
gradient:
LinearGradient ( begin: Alignment ( - 1.0 , - 2.0 ) , end: Alignment ( 1.0 , 4.0 ) , colors: [ Colors . grey , Colors . grey [ 100 ] , Colors . grey [ 200 ] , Colors . grey [ 300 ] , Colors . grey [ 400 ] , Colors . grey [ 500 ] ] ) ) ,
) ;
}
loginCheck ( context ) async {
var data = await sharedPref . getObject ( IMEI_USER_DATA ) ;
sharedPref . remove ( REGISTER_DATA_FOR_LOGIIN ) ;
@ -449,4 +343,76 @@ class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMix
} ) ;
}
}
Widget inputWidget ( String _labelText , String _hintText , TextEditingController _controller ,
{ VoidCallback suffixTap , bool isEnable = true , bool hasSelection = false , int lines , bool isInputTypeNum = false } ) {
return Container (
padding: EdgeInsets . only ( left: 16 , right: 16 , bottom: 15 , top: 15 ) ,
margin: projectViewModel . isArabic ? const EdgeInsets . only ( left: 21 ) : const EdgeInsets . only ( right: 21 ) ,
alignment: Alignment . center ,
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 15 ) ,
color: Colors . white ,
border: Border . all (
color: Color ( 0xffefefef ) ,
width: 1 ,
) ,
) ,
child: InkWell (
onTap: hasSelection ? ( ) { } : null ,
child: Row (
children: [
Expanded (
child: Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
_labelText ,
style: TextStyle (
fontSize: 11 ,
fontWeight: FontWeight . w600 ,
color: Color ( 0xff2B353E ) ,
letterSpacing: - 0.44 ,
) ,
) ,
TextField (
enabled: isEnable ,
scrollPadding: EdgeInsets . zero ,
keyboardType: isInputTypeNum ? TextInputType . number : TextInputType . text ,
controller: _controller ,
maxLines: lines ,
onChanged: ( value ) = > { setState ( ( ) { } ) } ,
style: TextStyle (
fontSize: 14 ,
height: 21 / 14 ,
fontWeight: FontWeight . w400 ,
color: Color ( 0xff2B353E ) ,
letterSpacing: - 0.44 ,
) ,
decoration: InputDecoration (
isDense: true ,
hintText: _hintText ,
hintStyle: TextStyle (
fontSize: 14 ,
height: 21 / 14 ,
fontWeight: FontWeight . w400 ,
color: Color ( 0xff575757 ) ,
letterSpacing: - 0.56 ,
) ,
contentPadding: EdgeInsets . zero ,
border: InputBorder . none ,
focusedBorder: InputBorder . none ,
enabledBorder: InputBorder . none ,
) ,
) ,
] ,
) ,
) ,
Icon ( Icons . search_outlined ) ,
] ,
) ,
) ,
) ;
}
}