|
|
|
@ -41,27 +41,37 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
double? fCalMeal;
|
|
|
|
double? fCalMeal;
|
|
|
|
|
|
|
|
|
|
|
|
void calculateDietRatios() {
|
|
|
|
void calculateDietRatios() {
|
|
|
|
if (dropdownValue == TranslationBase.of(context).dietVeryLow) {
|
|
|
|
if (dropdownValue == TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietVeryLow) {
|
|
|
|
meals = 3;
|
|
|
|
meals = 3;
|
|
|
|
protein = 45;
|
|
|
|
protein = 45;
|
|
|
|
carbs = 10;
|
|
|
|
carbs = 10;
|
|
|
|
fat = 45;
|
|
|
|
fat = 45;
|
|
|
|
} else if (dropdownValue == TranslationBase.of(context).dietLow) {
|
|
|
|
} else if (dropdownValue == TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietLow) {
|
|
|
|
meals = 3;
|
|
|
|
meals = 3;
|
|
|
|
protein = 40;
|
|
|
|
protein = 40;
|
|
|
|
carbs = 30;
|
|
|
|
carbs = 30;
|
|
|
|
fat = 30;
|
|
|
|
fat = 30;
|
|
|
|
} else if (dropdownValue == TranslationBase.of(context).dietModerate) {
|
|
|
|
} else if (dropdownValue == TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietModerate) {
|
|
|
|
meals = 3;
|
|
|
|
meals = 3;
|
|
|
|
protein = 25;
|
|
|
|
protein = 25;
|
|
|
|
carbs = 50;
|
|
|
|
carbs = 50;
|
|
|
|
fat = 25;
|
|
|
|
fat = 25;
|
|
|
|
} else if (dropdownValue == TranslationBase.of(context).dietUSDA) {
|
|
|
|
} else if (dropdownValue == TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietUSDA) {
|
|
|
|
meals = 3;
|
|
|
|
meals = 3;
|
|
|
|
protein = 15;
|
|
|
|
protein = 15;
|
|
|
|
carbs = 55;
|
|
|
|
carbs = 55;
|
|
|
|
fat = 30;
|
|
|
|
fat = 30;
|
|
|
|
} else if (dropdownValue == TranslationBase.of(context).dietZone) {
|
|
|
|
} else if (dropdownValue == TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietZone) {
|
|
|
|
meals = 3;
|
|
|
|
meals = 3;
|
|
|
|
protein = 30;
|
|
|
|
protein = 30;
|
|
|
|
carbs = 40;
|
|
|
|
carbs = 40;
|
|
|
|
@ -87,13 +97,17 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
dropdownValue = TranslationBase.of(context).dietVeryLow;
|
|
|
|
dropdownValue = TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietVeryLow;
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
appBarTitle: TranslationBase.of(context).carbohydrate,
|
|
|
|
appBarTitle: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.carbohydrate,
|
|
|
|
appBarIcons: [
|
|
|
|
appBarIcons: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
|
|
|
|
@ -113,7 +127,9 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).carbProteinDesc,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.carbProteinDesc,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
@ -128,7 +144,9 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
inputWidget(TranslationBase.of(context).calDay, "0", textController),
|
|
|
|
inputWidget(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.calDay, "0", textController),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
@ -139,8 +157,14 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).notSure,
|
|
|
|
TranslationBase
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.accentColor, decoration: TextDecoration.underline),
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.notSure,
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 12,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
|
|
|
decoration: TextDecoration.underline),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -165,7 +189,9 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).selectDiet,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.selectDiet,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontSize: 11,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
@ -194,11 +220,21 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: <String>[
|
|
|
|
items: <String>[
|
|
|
|
TranslationBase.of(context).dietVeryLow,
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).dietLow,
|
|
|
|
.of(context)
|
|
|
|
TranslationBase.of(context).dietModerate,
|
|
|
|
.dietVeryLow,
|
|
|
|
TranslationBase.of(context).dietUSDA,
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).dietZone
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietLow,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietModerate,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietUSDA,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dietZone
|
|
|
|
].map<DropdownMenuItem<String>>((String value) {
|
|
|
|
].map<DropdownMenuItem<String>>((String value) {
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
value: value,
|
|
|
|
value: value,
|
|
|
|
@ -232,7 +268,9 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: SecondaryButton(
|
|
|
|
child: SecondaryButton(
|
|
|
|
label: TranslationBase.of(context).calculate,
|
|
|
|
label: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.calculate,
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -307,8 +345,7 @@ class _CarbsState extends State<Carbs> {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget inputWidget(
|
|
|
|
Widget inputWidget(String _labelText,
|
|
|
|
String _labelText,
|
|
|
|
|
|
|
|
String _hintText,
|
|
|
|
String _hintText,
|
|
|
|
TextEditingController? _controller, {
|
|
|
|
TextEditingController? _controller, {
|
|
|
|
Function(String?)? onChange,
|
|
|
|
Function(String?)? onChange,
|
|
|
|
@ -542,8 +579,258 @@ Widget inputWidget(
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget newInputWidget(String _labelText,
|
|
|
|
|
|
|
|
String _hintText,
|
|
|
|
|
|
|
|
TextEditingController? _controller, {
|
|
|
|
|
|
|
|
Function(String?)? onChange,
|
|
|
|
|
|
|
|
String? prefix,
|
|
|
|
|
|
|
|
bool isEnable = true,
|
|
|
|
|
|
|
|
bool hasSelection = false,
|
|
|
|
|
|
|
|
bool hasSelectionCustomIcon = false,
|
|
|
|
|
|
|
|
String? selectionCustomIcon,
|
|
|
|
|
|
|
|
bool isBorderAllowed = true,
|
|
|
|
|
|
|
|
bool isAllowLeadingIcon = false,
|
|
|
|
|
|
|
|
bool isLeadingCountry = false,
|
|
|
|
|
|
|
|
String? leadingIcon,
|
|
|
|
|
|
|
|
bool removePadding = false,
|
|
|
|
|
|
|
|
bool isAllowRadius = true,
|
|
|
|
|
|
|
|
bool isReadOnly = false,
|
|
|
|
|
|
|
|
TextInputType keyboardType = TextInputType.number,
|
|
|
|
|
|
|
|
List<String>? dropdownItems,
|
|
|
|
|
|
|
|
String? selectedValue,
|
|
|
|
|
|
|
|
SelectionType? selectionType,
|
|
|
|
|
|
|
|
Function(bool)? onCalendarTypeChanged,
|
|
|
|
|
|
|
|
EdgeInsetsGeometry? padding,
|
|
|
|
|
|
|
|
String lang = 'en',
|
|
|
|
|
|
|
|
}) {
|
|
|
|
|
|
|
|
return Builder(
|
|
|
|
|
|
|
|
builder: (context) {
|
|
|
|
|
|
|
|
final isRtl = Directionality.of(context) == TextDirection.rtl;
|
|
|
|
|
|
|
|
return Directionality(
|
|
|
|
|
|
|
|
textDirection: Directionality.of(context),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
padding: padding,
|
|
|
|
|
|
|
|
// padding: removePadding && isAllowLeadingIcon && prefix == null
|
|
|
|
|
|
|
|
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8)
|
|
|
|
|
|
|
|
// : removePadding && !hasSelection
|
|
|
|
|
|
|
|
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0)
|
|
|
|
|
|
|
|
// : removePadding && hasSelection
|
|
|
|
|
|
|
|
// ? null
|
|
|
|
|
|
|
|
// : const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: isAllowRadius ? BorderRadius.circular(15) : null,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
textDirection: Directionality.of(context),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
if (isAllowLeadingIcon && leadingIcon != null)
|
|
|
|
|
|
|
|
Directionality(
|
|
|
|
|
|
|
|
textDirection: Directionality.of(context),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 40,
|
|
|
|
|
|
|
|
width: 40,
|
|
|
|
|
|
|
|
margin: isRtl ? const EdgeInsets.only(left: 10) : const EdgeInsets.only(right: 10),
|
|
|
|
|
|
|
|
padding: isLeadingCountry ? null : const EdgeInsets.all(8),
|
|
|
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(0xFFEFEFF0),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
leadingIcon,
|
|
|
|
|
|
|
|
width: 24,
|
|
|
|
|
|
|
|
height: 24,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
crossAxisAlignment: isRtl ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Directionality(
|
|
|
|
|
|
|
|
textDirection: Directionality.of(context),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
_labelText,
|
|
|
|
|
|
|
|
// textAlign: isRtl ? TextAlign.right : TextAlign.left,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
color: const Color(0xff898A8D),
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
height: 18 / 12,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
hasSelection
|
|
|
|
|
|
|
|
? GestureDetector(
|
|
|
|
|
|
|
|
onTap: isEnable && !isReadOnly
|
|
|
|
|
|
|
|
? () async {
|
|
|
|
|
|
|
|
if (selectionType == SelectionType.dropdown) {
|
|
|
|
|
|
|
|
final renderBox = context.findRenderObject() as RenderBox;
|
|
|
|
|
|
|
|
final offset = renderBox.localToGlobal(Offset.zero);
|
|
|
|
|
|
|
|
final selected = await showMenu<String>(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
position: RelativeRect.fromLTRB(
|
|
|
|
|
|
|
|
offset.dx,
|
|
|
|
|
|
|
|
offset.dy + renderBox.size.height,
|
|
|
|
|
|
|
|
offset.dx + renderBox.size.width,
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
items: dropdownItems
|
|
|
|
|
|
|
|
?.map(
|
|
|
|
|
|
|
|
(e) =>
|
|
|
|
|
|
|
|
PopupMenuItem<String>(
|
|
|
|
|
|
|
|
value: e,
|
|
|
|
|
|
|
|
child: Text(e),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.toList() ??
|
|
|
|
|
|
|
|
[],
|
|
|
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selected != null && onChange != null) {
|
|
|
|
|
|
|
|
onChange(selected);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (selectionType == SelectionType.calendar) {
|
|
|
|
|
|
|
|
bool isGregorian = true;
|
|
|
|
|
|
|
|
// final picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2100));
|
|
|
|
|
|
|
|
final picked = await showHijriGregBottomSheet(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
switcherIcon: SvgPicture.asset("assets/images/svg/language.svg", width: 24),
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
language: lang,
|
|
|
|
|
|
|
|
initialDate: DateTime.now(),
|
|
|
|
|
|
|
|
okWidget: Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/images/svg/confirm.svg",
|
|
|
|
|
|
|
|
width: 24,
|
|
|
|
|
|
|
|
height: 24,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
cancelWidget: Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/images/svg/cancel.svg",
|
|
|
|
|
|
|
|
colorFilter: ColorFilter.mode(
|
|
|
|
|
|
|
|
Colors.white,
|
|
|
|
|
|
|
|
BlendMode.srcIn,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
width: 24,
|
|
|
|
|
|
|
|
height: 24,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onCalendarTypeChanged: (bool value) {
|
|
|
|
|
|
|
|
isGregorian = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (picked != null && onChange != null) {
|
|
|
|
|
|
|
|
print(picked.toIso8601String());
|
|
|
|
|
|
|
|
if (onCalendarTypeChanged != null) {
|
|
|
|
|
|
|
|
print(isGregorian.toString());
|
|
|
|
|
|
|
|
onCalendarTypeChanged.call(isGregorian);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
onChange(picked.toIso8601String());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
(selectedValue == null || selectedValue.isEmpty) ? _hintText : selectedValue,
|
|
|
|
|
|
|
|
textAlign: isRtl ? TextAlign.right : TextAlign.left,
|
|
|
|
|
|
|
|
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 14,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
color: (selectedValue != null && selectedValue.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0),
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (hasSelectionCustomIcon && selectionCustomIcon != null)
|
|
|
|
|
|
|
|
SvgPicture.asset(selectionCustomIcon, width: 24, height: 24)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
const Icon(Icons.keyboard_arrow_down_outlined),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: TextField(
|
|
|
|
|
|
|
|
enabled: isEnable,
|
|
|
|
|
|
|
|
scrollPadding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
keyboardType: keyboardType,
|
|
|
|
|
|
|
|
controller: _controller,
|
|
|
|
|
|
|
|
readOnly: isReadOnly,
|
|
|
|
|
|
|
|
textAlignVertical: TextAlignVertical.top,
|
|
|
|
|
|
|
|
textAlign: isRtl ? TextAlign.right : TextAlign.left,
|
|
|
|
|
|
|
|
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
|
|
|
|
|
|
|
|
onChanged: onChange,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 14,
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
color: const Color(0xff2E3039),
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
|
|
|
isDense: true,
|
|
|
|
|
|
|
|
hintText: _hintText,
|
|
|
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 16,
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
color: const Color(0xff898A8D),
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
prefixIconConstraints: const BoxConstraints(minWidth: 45),
|
|
|
|
|
|
|
|
prefixIcon: prefix == null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: Text(
|
|
|
|
|
|
|
|
"+" + prefix,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 14,
|
|
|
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
color: const Color(0xff2E303A),
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
border: InputBorder.none,
|
|
|
|
|
|
|
|
focusedBorder: InputBorder.none,
|
|
|
|
|
|
|
|
enabledBorder: InputBorder.none,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extension BorderedContainer on Widget {
|
|
|
|
extension BorderedContainer on Widget {
|
|
|
|
Widget get withBorderedContainer => Container(
|
|
|
|
Widget get withBorderedContainer =>
|
|
|
|
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
|
|
|
|
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|