|
|
|
|
@ -2,11 +2,13 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
|
@ -194,30 +196,33 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
.only(
|
|
|
|
|
bottom:
|
|
|
|
|
5),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons
|
|
|
|
|
.person),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 7,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Text(result.patientName),
|
|
|
|
|
Text('File No:' +
|
|
|
|
|
result.iD.toString()),
|
|
|
|
|
])),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
switchUser(
|
|
|
|
|
result,
|
|
|
|
|
context);
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.person),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex:
|
|
|
|
|
7,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(result.patientName),
|
|
|
|
|
Text('File No:' + result.iD.toString()),
|
|
|
|
|
])),
|
|
|
|
|
],
|
|
|
|
|
)))
|
|
|
|
|
: SizedBox();
|
|
|
|
|
}).toList()));
|
|
|
|
|
}
|
|
|
|
|
@ -355,4 +360,25 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
|
return familyFileProvider.getSharedRecordByStatus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switchUser(user, context) {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
this
|
|
|
|
|
.familyFileProvider
|
|
|
|
|
.silentLoggin(user)
|
|
|
|
|
.then((value) => loginAfter(value, context));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loginAfter(result, context) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
result = CheckActivationCode.fromJson(result);
|
|
|
|
|
this.sharedPref.clear();
|
|
|
|
|
this.sharedPref.setObject(USER_PROFILE, result.list);
|
|
|
|
|
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
|
|
|
|
|
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
|
|
|
|
|
//this.checkIfUserAgreedBefore(result),
|
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
|
HOME,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|