hot ECG,add a new button and hot fixes

merge-requests/492/head
Mohammad Aljammal 5 years ago
parent 6ed3a8424f
commit da084d889c

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

@ -86,6 +86,9 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
String request= json.encode(body);
var asd="";
if (await Helpers.checkConnection()) {
final response = await http.post(url,

@ -841,7 +841,7 @@ const Map<String, Map<String, String>> localizedValues = {
"step": {"en": "Step", "ar": "خطوة"},
"fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"},
"applyOrRescheduleLeave": {
"en": "Apply Or Reschedule Leave",
"en": "Apply Reschedule Leave",
"ar": "التقدم بطلب أو إعادة جدولة الإجازة"
},
"myQRCode": {"en": "My QR Code", "ar": "My QR Code"},

@ -10,6 +10,7 @@ class PatientMuseService extends BaseService {
body['PatientType'] = patientType;
body['PatientOutSA'] = patientOutSA;
body['PatientID'] = patientID;
hasError = false;
await baseAppClient.post(
GET_ECG,
onSuccess: (dynamic response, int statusCode) {

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
@ -50,7 +51,7 @@ class ECGPage extends StatelessWidget {
},
child: Container(
width: double.infinity,
height: 110,
height: 120,
margin: EdgeInsets.only(top: 5,bottom: 5),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
@ -110,7 +111,7 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 15,),
Align(
alignment: Alignment.topRight,
child: Icon(Icons.arrow_circle_up_rounded),
child: Icon(DoctorApp.external_link),
)
],
),

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -92,15 +93,18 @@ class RadiologyDetailsPage extends StatelessWidget {
),
bottomSheet: model.radImageURL.isNotEmpty
? Container(
height: 80,
width: double.maxFinite,
child: Container(
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton(
onPressed: () {
child: SecondaryButton(
color: Colors.red[600],
disabled: finalRadiology.dIAPACSURL == "",
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
label: TranslationBase.of(context).openRad,
),
),
)

@ -46,8 +46,6 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientProfileHeaderNewDesign(
patient, patientType, arrivalType),
Container(
margin: EdgeInsets.all(16.0),
child: Column(

@ -274,7 +274,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
children: [
AppText(
patient.nationalityName ??
patient.nationality,
patient.nationality??"",
fontWeight: FontWeight.bold,
fontSize: 12,
),
@ -323,7 +323,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,

@ -182,7 +182,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime,
patient.startTime??"",
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
@ -235,7 +235,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
Row(
children: [
AppText(
patient.nationalityName ?? patient.nationality,
patient.nationalityName ?? patient.nationality??"",
fontWeight: FontWeight.bold,
fontSize: 12,
),
@ -307,7 +307,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName,
name: doctorName??"",
url: profileUrl,
),
width: 25,

@ -0,0 +1,261 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
/// SecondaryButton widget
/// [label] button label
/// [icon] button icon its optional
/// [iconOnly] just show the icon
/// [color] the background color
/// [textColor] the text color
/// [onTap] button function
/// [loading] show the progress indicator
/// [disabled] disabled the button
/// [borderColor] the button border color
/// [noBorderRadius] remove border radius
class SecondaryButton extends StatefulWidget {
SecondaryButton(
{Key key,
this.label = "",
this.icon,
this.iconOnly = false,
this.color,
this.textColor = Colors.white,
this.onTap,
this.loading: false,
this.small = false,
this.disabled = false,
this.borderColor,
this.noBorderRadius = false})
: super(key: key);
final String label;
final Widget icon;
final VoidCallback onTap;
final bool loading;
final Color color;
final Color textColor;
final Color borderColor;
final bool small;
final bool iconOnly;
final bool disabled;
final bool noBorderRadius;
@override
_SecondaryButtonState createState() => _SecondaryButtonState();
}
class _SecondaryButtonState extends State<SecondaryButton>
with TickerProviderStateMixin {
double _buttonSize = 1.0;
AnimationController _animationController;
Animation _animation;
double _rippleSize = 0.0;
AnimationController _rippleController;
Animation _rippleAnimation;
@override
void initState() {
if (widget.disabled != null && !widget.disabled) {
setState(() {
_rippleSize = 1.0;
});
}
_animationController = AnimationController(
vsync: this,
lowerBound: 0.7,
upperBound: 1.0,
duration: Duration(milliseconds: 120));
_animation = CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutQuad,
reverseCurve: Curves.easeOutQuad);
_animation.addListener(() {
setState(() {
_buttonSize = _animation.value;
});
});
_rippleController = AnimationController(
vsync: this,
lowerBound: 0.0,
upperBound: 1.0,
duration: Duration(seconds: 1));
_rippleAnimation = CurvedAnimation(
parent: _rippleController, curve: Curves.easeInOutQuint);
_rippleAnimation.addListener(() {
setState(() {
_rippleSize = _rippleAnimation.value;
});
});
super.initState();
}
@override
void dispose() {
_animationController.dispose();
_rippleController.dispose();
super.dispose();
}
Widget _buildIcon() {
if (widget.icon != null && (widget.label != null && widget.label != "")) {
return Container(height: 25.0, child: widget.icon);
} else if (widget.icon != null &&
(widget.label == null || widget.label == "")) {
return Container(height: 25.0, width: 25, child: widget.icon);
} else {
return Container();
}
}
@override
void didUpdateWidget(SecondaryButton oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.disabled != widget.disabled) {
bool d = widget.disabled ?? false;
if (!d) {
_rippleController.forward();
} else {
if (_rippleSize == 1.0)
_rippleController.reverse(from: 1.0);
else
_rippleController.reverse();
}
}
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return IgnorePointer(
ignoring: widget.loading,
child: GestureDetector(
onTapDown: (TapDownDetails tap) {
_animationController.reverse(from: 1.0);
},
onTapUp: (TapUpDetails tap) {
_animationController.forward();
},
onTapCancel: () {
_animationController.forward();
},
onTap: () => {
widget.disabled ? null : widget.onTap(),
},
// onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,
child: Container(
decoration: BoxDecoration(
border: widget.borderColor != null
? Border.all(
color: widget.borderColor.withOpacity(0.1), width: 2.0)
: null,
borderRadius: BorderRadius.all(Radius.circular(100.0)),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.04),
spreadRadius: -0.0,
offset: Offset(0, 4.0),
blurRadius: 18.0)
],
),
child: ClipRRect(
borderRadius: widget.noBorderRadius
? BorderRadius.all(Radius.circular(0.0))
: BorderRadius.all(Radius.circular(10.0)),
child: Stack(
children: <Widget>[
Positioned(
left: 0,
bottom: 0,
child: Container(
width: MediaQuery.of(context).size.width,
height: 100,
decoration: BoxDecoration(
color: widget.disabled
? Colors.grey
: widget.color ?? Theme.of(context).buttonColor),
),
),
Positioned(
left: -MediaQuery.of(context).size.width * 2.2 / 1.8,
bottom: -MediaQuery.of(context).size.width * 2.2 / 1.8,
child: Transform.scale(
scale: widget.disabled != null ? _rippleSize : 1.0,
child: Container(
width: MediaQuery.of(context).size.width * 2.2,
height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.disabled
? Colors.grey
: widget.color ?? Theme.of(context).buttonColor,
),
),
),
),
Container(
padding: widget.iconOnly
? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0)
: EdgeInsets.only(
top: widget.small ? 8.0 : 14.0,
bottom: widget.small ? 6.0 : 14.0,
left: 18.0,
right: 18.0),
child: Stack(
children: <Widget>[
Positioned(
child: _buildIcon(),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
widget.loading
? Padding(
padding: EdgeInsets.all(2.6),
child: SizedBox(
height: 19.0,
width: 19.0,
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor:
AlwaysStoppedAnimation<Color>(
Colors.grey[300],
),
),
),
)
: Padding(
padding: EdgeInsets.only(
bottom: widget.small ? 4.0 : 3.0),
child: Text(
widget.label,
style: TextStyle(
color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0,
// fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic
? 'Cairo'
: 'WorkSans'),
),
)
],
)
],
),
),
],
),
),
),
),
),
);
}
}
Loading…
Cancel
Save