fix stepper labels and translate it.

episode_fixes
Elham Rababh 4 years ago
parent 8a69becab3
commit 88b04a8f5d

@ -705,4 +705,8 @@ const Map<String, Map<String, String>> localizedValues = {
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
"finish": {"en": "Finish", "ar": "انهاء"},
"severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"},
"inProgress": {"en": "inProgress", "ar": "تحت المعالجه"},
"Completed": {"en": "Completed", "ar": "مكتمل"},
"Locked": {"en": "Locked", "ar": "مقفل"},
};

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart';
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';

@ -0,0 +1,22 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class StepDetailsWidget extends StatelessWidget {
final String stepLabel;
final double marginLeft;
const StepDetailsWidget({
Key key, this.stepLabel, this.marginLeft = 0,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppText(
stepLabel,
fontWeight: FontWeight.bold,
marginLeft: marginLeft,
fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12,
);
}
}

@ -0,0 +1,52 @@
import 'package:doctor_app_flutter/config/size_config.dart';
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:hexcolor/hexcolor.dart';
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key);
final int stepId;
final int selectedStepId;
@override
Widget build(BuildContext context) {
return Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
child: Center(
child: AppText(
stepId == selectedStepId
? TranslationBase.of(context).inProgress
: stepId < selectedStepId
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
),
),
);
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -7,6 +8,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'Step_details_widget.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
@ -77,7 +80,7 @@ class StepsWidget extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepWidget(stepLabel: "Subjective",),
StepDetailsWidget(stepLabel: "Subjective",),
StatusLabel(
selectedStepId: index,
stepId: 0,
@ -129,7 +132,7 @@ class StepsWidget extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepWidget(stepLabel: "Objective",),
StepDetailsWidget(stepLabel: "Objective",),
StatusLabel(
selectedStepId: index,
stepId: 1,
@ -183,7 +186,7 @@ class StepsWidget extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepWidget(stepLabel: "Assessment",),
StepDetailsWidget(stepLabel: "Assessment",),
StatusLabel(
selectedStepId: index,
stepId: 2,
@ -232,7 +235,7 @@ class StepsWidget extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
StepWidget(stepLabel: "Plan",marginLeft: 30,),
StepDetailsWidget(stepLabel: "Plan",marginLeft: 30,),
StatusLabel(
selectedStepId: index,
stepId: 3,
@ -303,11 +306,7 @@ class StepsWidget extends StatelessWidget {
SizedBox(height: 3),
Column(
children: [
AppText(
"شخصي",
fontWeight: FontWeight.bold,
fontSize: 16,
),
StepDetailsWidget(stepLabel: "شخصي",),
StatusLabel(
selectedStepId: index,
stepId: 0,
@ -323,7 +322,7 @@ class StepsWidget extends StatelessWidget {
right: MediaQuery
.of(context)
.size
.width * 0.28,
.width * 0.25,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column(
@ -356,11 +355,7 @@ class StepsWidget extends StatelessWidget {
SizedBox(height: 5),
Column(
children: [
AppText(
"هدف",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StepDetailsWidget(stepLabel: "هدف",),
StatusLabel(
selectedStepId: index,
stepId: 1,
@ -376,7 +371,7 @@ class StepsWidget extends StatelessWidget {
right: MediaQuery
.of(context)
.size
.width * 0.52,
.width * 0.50,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
@ -413,11 +408,7 @@ class StepsWidget extends StatelessWidget {
padding: const EdgeInsets.only(right: 2),
child: Column(
children: [
AppText(
"تقدير",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StepDetailsWidget(stepLabel: "تقدير",),
StatusLabel(
selectedStepId: index,
stepId: 2,
@ -468,11 +459,7 @@ class StepsWidget extends StatelessWidget {
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StepDetailsWidget(stepLabel: "خطة",),
StatusLabel(
selectedStepId: index,
stepId: 3,
@ -488,69 +475,3 @@ class StepsWidget extends StatelessWidget {
);
}
}
class StepWidget extends StatelessWidget {
final String stepLabel;
final double marginLeft;
const StepWidget({
Key key, this.stepLabel, this.marginLeft = 0,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppText(
stepLabel,
fontWeight: FontWeight.bold,
marginLeft: marginLeft,
fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12,
);
}
}
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key);
final int stepId;
final int selectedStepId;
@override
Widget build(BuildContext context) {
return Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
child: Center(
child: AppText(
stepId == selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed"
: "Locked",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
),
),
);
}
}

@ -1233,6 +1233,9 @@ class TranslationBase {
localizedValues['typeHereToReply'][locale.languageCode];
String get searchHere => localizedValues['searchHere'][locale.languageCode];
String get remove => localizedValues['remove'][locale.languageCode];
String get inProgress => localizedValues['inProgress'][locale.languageCode];
String get completed => localizedValues['Completed'][locale.languageCode];
String get locked => localizedValues['Locked'][locale.languageCode];
String get step => localizedValues['step'][locale.languageCode];
String get fieldRequired =>

Loading…
Cancel
Save