Merge remote-tracking branch 'origin/fatima' into fatima

# Conflicts:
#	lib/api/client/user_api_client.dart
#	lib/classes/consts.dart
fatima
Fatimah Alshammari 4 years ago
commit 4f17e7f22b

@ -1,6 +1,7 @@
import 'package:car_provider_app/api/client/user_api_client.dart';
import 'package:car_provider_app/classes/utils.dart';
import 'package:car_provider_app/config/routes.dart';
import 'package:car_provider_app/models/m_response.dart';
import 'package:car_provider_app/models/user/basic_otp.dart';
import 'package:car_provider_app/models/user/register_user.dart';
import 'package:car_provider_app/utils/navigator.dart';
@ -28,6 +29,7 @@ class CompleteProfilePage extends StatefulWidget {
class _CompleteProfilePageState extends State<CompleteProfilePage> {
String? firstName = "", lastName = "", email = "", password = "", confirmPassword = "";
bool isChecked = false;
@override
void initState() {
// TODO: implement initState
@ -68,6 +70,8 @@ class _CompleteProfilePageState extends State<CompleteProfilePage> {
TxtField(
hint: "Email",
value: email,
isButtonEnable: email!.length > 0 ? true : false,
buttonTitle: "Verify",
onChanged: (v) {
email = v;
},
@ -117,8 +121,8 @@ class _CompleteProfilePageState extends State<CompleteProfilePage> {
),
),
);
}
Widget buildCheckbox() => Checkbox(
value: isChecked,
activeColor: Colors.blue,
@ -181,6 +185,12 @@ class _CompleteProfilePageState extends State<CompleteProfilePage> {
return regExp.hasMatch(value);
}
bool isEmail(String em) {
String p = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regExp = new RegExp(p);
return regExp.hasMatch(em);
}
bool validation() {
bool isValid = true;
if (firstName!.isEmpty) {

@ -22,13 +22,15 @@ class OtpDialog extends StatelessWidget {
return Container(
color: Colors.white,
padding: EdgeInsets.all(24),
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Please insert OTP Code".toText24(),
20.height,
OTPWidget(
Center(
child: OTPWidget(
autoFocus: true,
controller: _pinPutController,
defaultBorderColor: const Color(0xffD8D8D8),
@ -37,14 +39,15 @@ class OtpDialog extends StatelessWidget {
pinBoxColor: Colors.white,
onDone: (code) => _onOtpCallBack(code, null),
textBorderColor: const Color(0xffD8D8D8),
pinBoxWidth: 60,
pinBoxHeight: 60,
pinBoxWidth: 48,
pinBoxHeight: 48,
pinTextStyle: const TextStyle(fontSize: 24.0, color: MyColors.darkTextColor),
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: const Duration(milliseconds: 300),
pinBoxRadius: 10,
pinBoxRadius: 8,
keyboardType: TextInputType.number,
),
),
// Row(
// children: [
// Expanded(

@ -16,7 +16,7 @@ class TxtField extends StatelessWidget {
bool isNeedClickAll;
bool isButtonEnable;
double? elevation;
Function? onTap;
VoidCallback? onTap;
String? buttonTitle;
int? maxLines;
bool isSidePaddingZero;
@ -47,6 +47,7 @@ class TxtField extends StatelessWidget {
@override
Widget build(BuildContext context) {
controller.text = value ?? "";
controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));
return InkWell(
onTap: isNeedClickAll == false
? null
@ -130,7 +131,7 @@ class TxtField extends StatelessWidget {
if (isButtonEnable)
Material(
child: InkWell(
onTap: () {},
onTap: onTap,
customBorder: inkWellCorner(),
child: Container(
height: 55,

Loading…
Cancel
Save