|
|
|
|
@ -8,6 +8,7 @@ import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:hmg_patient_app/uitl/utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app/uitl/font_utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
|
|
|
|
|
import 'package:smooth_corner/smooth_corner.dart';
|
|
|
|
|
|
|
|
|
|
class GenericBottomSheet extends StatefulWidget {
|
|
|
|
|
String? countryCode;
|
|
|
|
|
@ -86,7 +87,8 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
|
|
|
|
|
? TranslationBase.of(context).enterEmail
|
|
|
|
|
: TranslationBase.of(context).enterPhoneNumber,
|
|
|
|
|
fontSize: 28,
|
|
|
|
|
letterSpacing: -2,
|
|
|
|
|
letterSpacing: -1,
|
|
|
|
|
height: 1.33,
|
|
|
|
|
color: Color(0xFF2E3039),
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
@ -100,7 +102,7 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
// Subtitle
|
|
|
|
|
AppText(
|
|
|
|
|
widget.isFromSavedLogin
|
|
|
|
|
@ -109,9 +111,9 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
|
|
|
|
|
? TranslationBase.of(context).enterEmailDesc
|
|
|
|
|
: TranslationBase.of(context).enterPhoneDesc,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
height: 1.33,
|
|
|
|
|
color: Color(0xFF2E3039),
|
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
|
|
|
|
|
if (widget.isFromSavedLogin)
|
|
|
|
|
...[]
|
|
|
|
|
@ -120,35 +122,6 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
// Directionality(
|
|
|
|
|
// textDirection: TextDirection.ltr,
|
|
|
|
|
// child: newInputWidget(
|
|
|
|
|
// labelText: widget.isForEmail ? TranslationBase.of(context).email : TranslationBase.of(context).phoneNumber,
|
|
|
|
|
// hintText: widget.isForEmail ? "demo@gmail.com" : "5xxxxxxxx",
|
|
|
|
|
// controller: widget.textController,
|
|
|
|
|
// padding: const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
|
|
|
|
|
// keyboardType: widget.isForEmail ? TextInputType.emailAddress : TextInputType.number,
|
|
|
|
|
// onChange: (value) {
|
|
|
|
|
// if (value != null) {
|
|
|
|
|
// widget.textController?.text = value;
|
|
|
|
|
// widget.onChange?.call(value);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// isEnable: true,
|
|
|
|
|
// autoFocus: true,
|
|
|
|
|
// keepFocus: true,
|
|
|
|
|
// refocusOnChange: true,
|
|
|
|
|
// isReadOnly: widget.isFromSavedLogin,
|
|
|
|
|
// prefix: widget.isForEmail ? null : widget.countryCode,
|
|
|
|
|
// hasSelection: false,
|
|
|
|
|
// isBorderAllowed: false,
|
|
|
|
|
// isAllowLeadingIcon: true,
|
|
|
|
|
// countryList: Country.values,
|
|
|
|
|
// isCountryDropDown: widget.isEnableCountryDropdown,
|
|
|
|
|
// onCountryChange: widget.onCountryChange,
|
|
|
|
|
// leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg",
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
Directionality(
|
|
|
|
|
textDirection: TextDirection.ltr,
|
|
|
|
|
child: newInputWidget(
|
|
|
|
|
@ -218,7 +191,7 @@ class CustomButton extends StatelessWidget {
|
|
|
|
|
this.borderColor = const Color(0xFFED1C2B),
|
|
|
|
|
this.textColor = Colors.white,
|
|
|
|
|
this.borderRadius = 12,
|
|
|
|
|
this.borderWidth = 1,
|
|
|
|
|
this.borderWidth = 2,
|
|
|
|
|
this.padding = const EdgeInsets.fromLTRB(8, 10, 8, 10),
|
|
|
|
|
this.fontSize = 16,
|
|
|
|
|
this.fontFamily,
|
|
|
|
|
@ -230,44 +203,50 @@ class CustomButton extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: isDisabled ? null : onPressed,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 56,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: isDisabled ? backgroundColor.withOpacity(0.5) : backgroundColor,
|
|
|
|
|
borderRadius: BorderRadius.circular(borderRadius),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: isDisabled ? borderColor.withOpacity(0.5) : borderColor,
|
|
|
|
|
width: borderWidth,
|
|
|
|
|
onTap: isDisabled ? null : onPressed,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 56,
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: isDisabled ? backgroundColor.withOpacity(0.5) : backgroundColor,
|
|
|
|
|
borderRadius: borderRadius,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: padding,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (icon != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
icon!,
|
|
|
|
|
width: 24,
|
|
|
|
|
height: 24,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: padding,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (icon != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
icon!,
|
|
|
|
|
width: 24,
|
|
|
|
|
height: 24,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
text,
|
|
|
|
|
style: context.dynamicTextStyle(
|
|
|
|
|
fontSize: fontSize,
|
|
|
|
|
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
|
|
|
|
|
fontWeight: fontWeight,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
text,
|
|
|
|
|
style: context.dynamicTextStyle(
|
|
|
|
|
fontSize: fontSize,
|
|
|
|
|
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
|
|
|
|
|
fontWeight: fontWeight,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// .toSmoothContainer(
|
|
|
|
|
// smoothness: 1,
|
|
|
|
|
// side: BorderSide(width: borderWidth, color: backgroundColor),
|
|
|
|
|
// borderRadius: BorderRadius.circular(borderRadius * 1.2),
|
|
|
|
|
// foregroundDecoration: BoxDecoration(
|
|
|
|
|
// color: isDisabled ? backgroundColor.withOpacity(0.5) : Colors.transparent,
|
|
|
|
|
// borderRadius: BorderRadius.circular(borderRadius),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|