add TODO to Elham

auth_refactor
Mohammad Aljammal 5 years ago
parent 745545ffc3
commit 081bfe3f61

@ -322,4 +322,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.10.1

@ -169,13 +169,13 @@ class AuthenticationViewModel extends BaseViewModel {
}
//TODO Elham remove it
getDate(DateTime date) {
final DateFormat formatter = DateFormat('dd MMM yyyy');
return formatter.format(date);
}
//TODO Elham remove it
getTime(DateTime date) {
final DateFormat formatter = DateFormat('HH:mm a');

@ -36,7 +36,7 @@ class DoctorProfileViewModel extends BaseViewModel {
}
notifyListeners();
}
//TODO Elham move it auth view model
APP_STATUS get stutas {
if (isLoading) {
return APP_STATUS.LOADING;

@ -28,9 +28,9 @@ import '../../lookups/auth_lookup.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../widgets/auth/auth_header.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
//TODO Elham remove it
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
//TODO Elham change the name
class Loginsreen extends StatefulWidget {
@override
_LoginsreenState createState() => _LoginsreenState();
@ -51,12 +51,13 @@ class _LoginsreenState extends State<Loginsreen> {
FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode();
// HospitalViewModel hospitalViewModel;
//TODO Elham to change it ti UserModel
var userInfo = UserModel();
@override
void initState() {
super.initState();
//TODO Elham move it root page and the logic in the view model
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
@ -88,6 +89,7 @@ class _LoginsreenState extends State<Loginsreen> {
});
}
//TODO Elham change it to GIF
void changeLoadingState(isLoading) {
setState(() {
_isLoading = isLoading;
@ -100,6 +102,7 @@ class _LoginsreenState extends State<Loginsreen> {
return BaseView<AuthenticationViewModel>(
//TODO Elham remove it
onModelReady: (model) => {},
builder: (_, model, w) =>
AppScaffold(
@ -457,6 +460,7 @@ class _LoginsreenState extends State<Loginsreen> {
loginFormKey.currentState.save();
GifLoaderDialogUtils.showMyDialog(context);
sharedPref.setInt(PROJECT_ID, userInfo.projectID);
//TODO Elham move the sharedPref to view model
await model.login(userInfo);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
@ -466,6 +470,7 @@ class _LoginsreenState extends State<Loginsreen> {
saveObjToString(LOGGED_IN_USER, model.loginInfo);
sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, model.loginInfo.logInTokenID);
//TODO Elham move the sharedPref to view model
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushReplacement(
@ -478,13 +483,13 @@ class _LoginsreenState extends State<Loginsreen> {
}
}
}
//TODO Elham to it view model
Future<void> setSharedPref(key, value) async {
sharedPref.setString(key, value).then((success) {
});
}
//TODO Elham to it view model
saveObjToString(String key, value) async {
sharedPref.setObj(key, value);
}

@ -39,6 +39,7 @@ class VerificationMethodsScreen extends StatefulWidget {
VerificationMethodsScreen({this.changeLoadingState, this.password});
final password;
//TODO Elham remove this fun
final Function changeLoadingState;
@override
@ -62,12 +63,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
final LocalAuthentication auth = LocalAuthentication();
//TODO Elham remove this fun
@override
void initState() {
super.initState();
}
//TODO Elham remove this fun
@override
void didChangeDependencies() async{
super.didChangeDependencies();
@ -229,11 +231,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
child: InkWell(
onTap: () => {
// TODO check this logic it seem it will create bug to us
authenticateUser(
AuthMethodTypes
.Fingerprint,
true)
authenticateUser(AuthMethodTypes.Fingerprint, true)
},
child: MethodCard(
authMethodType: model.user
@ -337,6 +335,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
],
),
),
//TODO Elham move it to bottom sheet
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
@ -473,7 +472,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
},
).displayDialog(context);
}
//TODO Elham move it to view model
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes,
isActive) async {
if (isActive) {
@ -505,17 +504,15 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
checkActivationCode({value}) async {
await model
.checkActivationCodeForDoctorApp(activationCode:value );
await model.checkActivationCodeForDoctorApp(activationCode:value );
if (model.state == ViewState.ErrorLocal) {
Navigator.pop(context);
Helpers.showErrorToast(model.error);
} else {
sharedPref.setString(
TOKEN,
model
.checkActivationCodeForDoctorAppRes.authenticationTokenID);
TOKEN, model.checkActivationCodeForDoctorAppRes.authenticationTokenID);
//TODO Elham check the logic
if (model.checkActivationCodeForDoctorAppRes.listDoctorsClinic.isNotEmpty) {
loginProcessCompleted(model.checkActivationCodeForDoctorAppRes.list_DoctorProfile[0]);
sharedPref.setObj(
@ -532,7 +529,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
}
}
//TODO Elham move it to view model
loginProcessCompleted(Map<String, dynamic> profile) {
var doctor = DoctorProfileModel.fromJson(profile);
doctorProfileViewModel.setDoctorProfile(doctor);
@ -546,7 +543,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
(r) => false);
}
//TODO Elham move it to view model
getDocProfiles(ClinicModel clinicInfo) {
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID,

@ -6,7 +6,7 @@ import 'package:hexcolor/hexcolor.dart';
import '../../config/size_config.dart';
import '../../lookups/auth_lookup.dart';
//TODO Elham delete this widget
class AuthHeader extends StatelessWidget {
var userType;
AuthHeader(this.userType);

@ -20,6 +20,7 @@ class MethodCard extends StatefulWidget {
class _MethodCardState extends State<MethodCard> {
//TODO Elham change it to list Enum
var _availableBiometrics;
final LocalAuthentication auth = LocalAuthentication();
@ -65,6 +66,7 @@ class _MethodCardState extends State<MethodCard> {
case AuthMethodTypes.WhatsApp:
return InkWell(
onTap: () => {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)},
//TODO Elham change it to widget
child: Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
//TODO Elham check it
class SMSOTP {
final AuthMethodTypes type;
final mobileNo;

Loading…
Cancel
Save