fix the size of the button inside the app

merge-requests/947/head
Elham Rababh 4 years ago
parent edbb99e445
commit 71ce8d22e3

@ -5,11 +5,11 @@ import 'dart:io' show Platform;
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'widgets/shared/buttons/secondary_button.dart';
class UpdatePage extends StatelessWidget {
final String message;
@ -62,15 +62,15 @@ class UpdatePage extends StatelessWidget {
child: Container(
// padding: const EdgeInsets.all(8.0),
margin: EdgeInsets.all(15),
child: SecondaryButton(
child: AppButton(
color: Colors.red[800],
onTap: () {
onPressed: () {
if (Platform.isIOS)
launch(iosLink);
else
launch(androidLink);
},
label: TranslationBase.of(context).updateNow.toUpperCase(),
title: TranslationBase.of(context).updateNow.toUpperCase(),
),
),
),

@ -436,7 +436,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.7;
const VERSION_ID = 6.5;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -13,7 +13,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -468,12 +467,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
SecondaryButton(
label:
AppButton(
title:
TranslationBase.of(context).useAnotherAccount ?? '',
color: Color(0xFFD02127),
//fontWeight: FontWeight.w700,
onTap: () {
onPressed: () {
authenticationViewModel.deleteUser();
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
@ -242,14 +243,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare || isInpatient
? Colors.red.shade700
? AppGlobal.appRedColor
: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
? AppGlobal.appRedColor
: AppGlobal.appRedColor,
fontColor: Colors.white,
vPadding: 8,
// vPadding: 8,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 20,
hPadding: 25,
fontWeight: FontWeight.normal,
fontSize: 12,
icon: SvgPicture.asset(
@ -278,14 +281,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
color: ((isInpatient) ||
isFromLiveCare) &&
model.state != ViewState.BusyLocal
? Colors.red.shade700
? AppGlobal.appRedColor
: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
?AppGlobal.appRedColor
: AppGlobal.appRedColor,
fontColor: Colors.white,
vPadding: 8,
// vPadding: 8,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 20,
hPadding: 25,
fontWeight: FontWeight.normal,
fontSize: 12,
icon: SvgPicture.asset(

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -101,18 +101,17 @@ class RadiologyDetailsPage extends StatelessWidget {
child: Container(
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: SecondaryButton(
child: AppButton(
color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "",
textColor: Color(0xffFFFFFF),
onTap: () async {
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image",
);
launch(model.radImageURL);
},
label: TranslationBase.of(context).openRad,
title: TranslationBase.of(context).openRad,
),
),
)

@ -32,10 +32,7 @@ class BottomSheetDialogButton extends StatelessWidget {
widthFactor: .80,
child: Center(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
title: label,
padding: 10,
color: Color(0xFF359846),
onPressed: onTap,
),

@ -169,9 +169,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
color: Colors.red[700],
onPressed: () async {
model.nextOnSubjectPage(model);
@ -189,9 +186,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
// height: SizeConfig.heightMultiplier *
// (SizeConfig.isHeightVeryShort ? 8 : 6),
// padding: 10,
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () {
@ -211,9 +208,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
// height: SizeConfig.heightMultiplier *
// (SizeConfig.isHeightVeryShort ? 8 : 6),
// padding: 10,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
await model.nextOnObjectivePage(model);
@ -235,9 +232,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
@ -253,9 +247,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
model.nextOnAssessmentPage(model);
@ -274,9 +266,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
children: [
Expanded(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
@ -292,9 +281,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
Expanded(
child: AppButton(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 8 : 6),
padding: 10,
title: model.isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,

@ -316,7 +316,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
child: AppButton(
title: TranslationBase.of(context).cancel,
hasBorder: true,
vPadding: 12,
// vPadding: 12,
hPadding: 8,
borderColor: Color(0xFFeaeaea),
color: Color(0xFFeaeaea),
@ -335,8 +335,6 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
child: AppButton(
title: TranslationBase.of(context).next,
hasBorder: true,
vPadding: 12,
hPadding: 8,
borderColor: Color(0xFFB8382B),
color: AppGlobal.appRedColor,
fontColor: Colors.white,

@ -33,7 +33,7 @@ class AppButton extends StatefulWidget {
this.icon,
this.color,
this.fontSize,
this.padding = 13,
this.padding = 8,
this.loading = false,
this.disabled = false,
this.fontColor = Colors.white,
@ -53,11 +53,13 @@ class _AppButtonState extends State<AppButton> {
@override
Widget build(BuildContext context) {
if (widget.fontSize == null) {
widget.fontSize = SizeConfig.getHeightMultiplier() * 1.9;
widget.fontSize = SizeConfig.getHeightMultiplier() *
(SizeConfig.isHeightVeryShort ? 1.3 : 1.7);
}
return Container(
// height: MediaQuery.of(context).size.height * 0.075,
height: widget.height,
height: widget.height?? SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 6 : 5),
child: IgnorePointer(
ignoring: widget.loading || widget.disabled,
child: RawMaterialButton(

@ -1,259 +0,0 @@
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: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins'),
),
)
],
)
],
),
),
],
),
),
),
),
),
);
}
}
Loading…
Cancel
Save