@ -29,10 +29,12 @@ import 'package:diplomaticquarterapp/services/livecare_services/livecare_provide
import ' package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart ' ;
import ' package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/app-permissions.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_shared_preferences.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/date_uitl.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/penguin_method_channel.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
@ -50,6 +52,7 @@ import 'package:flutter_countdown_timer/current_remaining_time.dart';
import ' package:flutter_countdown_timer/flutter_countdown_timer.dart ' ;
import ' package:flutter_rating_bar/flutter_rating_bar.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:permission_handler/permission_handler.dart ' ;
import ' package:provider/provider.dart ' ;
class ToDo extends StatefulWidget {
@ -354,23 +357,52 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
style: TextStyle ( fontSize: 10 , fontWeight: FontWeight . w600 , color: Color ( 0xff2E303A ) , letterSpacing: - 0.48 , height: 25 / 16 ) ,
) ,
) ,
InkWell (
onTap: ( ) {
navigateToAppointmentDetails ( context , appoList [ index ] ) ;
} ,
child: Padding (
padding: const EdgeInsets . only ( top: 0.0 ) ,
child: Text (
TranslationBase . of ( context ) . moreDetails ,
style: TextStyle (
fontSize: 10 ,
fontWeight: FontWeight . w600 ,
color: CustomColors . accentColor ,
letterSpacing: - 0.48 ,
height: 25 / 16 ,
decoration: TextDecoration . underline ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
InkWell (
onTap: ( ) {
navigateToAppointmentDetails ( context , appoList [ index ] ) ;
} ,
child: Padding (
padding: const EdgeInsets . only ( top: 0.0 ) ,
child: Text (
TranslationBase . of ( context ) . moreDetails ,
style: TextStyle (
fontSize: 10 ,
fontWeight: FontWeight . w600 ,
color: CustomColors . accentColor ,
letterSpacing: - 0.48 ,
height: 25 / 16 ,
decoration: TextDecoration . underline ) ,
) ,
) ,
) ,
) ,
InkWell (
onTap: ( ) {
NavigationClinicDetails data = NavigationClinicDetails ( ) ;
data . clinicId = appoList [ index ] . clinicID . toString ( ) ;
data . patientId = appoList [ index ] . patientID . toString ( ) ;
data . projectId = appoList [ index ] . projectID . toString ( ) ;
initPenguinSDK ( data ) ;
} ,
child: Column (
children: [
Icon ( Icons . directions_walk ) ,
Text (
TranslationBase . of ( context ) . clinicLocation ,
style: TextStyle (
fontSize: 10 ,
fontWeight: FontWeight . w600 ,
color: CustomColors . accentColor ,
letterSpacing: - 0.48 ,
height: 25 / 16 ,
decoration: TextDecoration . underline ) ,
) ,
] ,
) ,
) ,
] ,
) ,
] ,
) ,
@ -530,6 +562,21 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
) ;
}
initPenguinSDK ( NavigationClinicDetails data ) async {
final bool permited = await AppPermission . askPenguinPermissions ( ) ;
if ( ! permited ) {
Map < Permission , PermissionStatus > statuses = await [
Permission . location ,
Permission . bluetooth ,
Permission . bluetoothConnect ,
Permission . bluetoothScan ,
Permission . activityRecognition ,
] . request ( ) . whenComplete ( ( ) {
PenguinMethodChannel . launch ( " penguin " , projectViewModel . isArabic ? " ar " : " en " , projectViewModel . authenticatedUserObject . user . patientID . toString ( ) , details: data ) ;
} ) ;
}
}
String getNextActionImage ( nextAction ) {
switch ( nextAction ) {
case 0 :