Merge branch 'master' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into develop
commit
39bf009678
@ -0,0 +1,7 @@
|
||||
const Map<String, Map<String, String>> localizedValues = {
|
||||
'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'},
|
||||
'settings': {'en': 'Settings', 'ar': 'الاعدادات'},
|
||||
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
|
||||
'lanEnglish': {'en': 'English', 'ar': 'English'},
|
||||
'lanArabic': {'en': 'العربية', 'ar': 'العربية'}
|
||||
};
|
||||
@ -1,3 +1,4 @@
|
||||
final TOKEN = 'token';
|
||||
final PROJECT_ID="projectID";
|
||||
final SLECTED_PATIENT_TYPE="slectedPatientType";
|
||||
final SLECTED_PATIENT_TYPE="slectedPatientType";
|
||||
final APP_Language = "language";
|
||||
@ -1,25 +0,0 @@
|
||||
// GENERATED FILE, do not edit!
|
||||
import 'package:i18n/i18n.dart' as i18n;
|
||||
|
||||
String get _languageCode => 'en';
|
||||
String get _localeName => 'en';
|
||||
|
||||
String _plural(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.plural(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
String _ordinal(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.ordinal(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
String _cardinal(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.cardinal(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
|
||||
class Ar {
|
||||
const Ar();
|
||||
ButtonAr get button => ButtonAr(this);
|
||||
}
|
||||
|
||||
class ButtonAr {
|
||||
final Ar _parent;
|
||||
const ButtonAr(this._parent);
|
||||
String get save => "حفظ";
|
||||
String get load => "تحميل";
|
||||
}
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
button:
|
||||
save: حفظ
|
||||
load: تحميل
|
||||
@ -1,25 +0,0 @@
|
||||
// GENERATED FILE, do not edit!
|
||||
import 'package:i18n/i18n.dart' as i18n;
|
||||
|
||||
String get _languageCode => 'en';
|
||||
String get _localeName => 'en';
|
||||
|
||||
String _plural(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.plural(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
String _ordinal(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.ordinal(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
String _cardinal(int count, {String zero, String one, String two, String few, String many, String other}) =>
|
||||
i18n.cardinal(count, _languageCode, zero:zero, one:one, two:two, few:few, many:many, other:other);
|
||||
|
||||
class En {
|
||||
const En();
|
||||
ButtonEn get button => ButtonEn(this);
|
||||
}
|
||||
|
||||
class ButtonEn {
|
||||
final En _parent;
|
||||
const ButtonEn(this._parent);
|
||||
String get save => "Save";
|
||||
String get load => "Load";
|
||||
}
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
button:
|
||||
save: Save
|
||||
load: Load
|
||||
|
||||
@ -1,18 +1,23 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
|
||||
import '../interceptor/http_interceptor.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http_interceptor/http_client_with_interceptor.dart';
|
||||
|
||||
const GET_PROJECTS =
|
||||
BASE_URL+'Lists.svc/REST/GetProjectForDoctorAPP';
|
||||
const GET_PROJECTS = BASE_URL + 'Lists.svc/REST/GetProjectForDoctorAPP';
|
||||
|
||||
class HospitalProvider with ChangeNotifier {
|
||||
|
||||
|
||||
|
||||
class ProjectsProvider with ChangeNotifier {
|
||||
Client client =
|
||||
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
|
||||
|
||||
Future<Map> getProjectsList() async {
|
||||
const url = GET_PROJECTS;
|
||||
var info = {
|
||||
@ -0,0 +1,43 @@
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ProjectProvider with ChangeNotifier{
|
||||
|
||||
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
||||
Locale _appLocale;
|
||||
String currentLanguage = 'ar';
|
||||
bool _isArabic = false;
|
||||
|
||||
Locale get appLocal => _appLocale;
|
||||
|
||||
bool get isArabic => _isArabic;
|
||||
|
||||
ProjectProvider(){
|
||||
loadSharedPrefLanguage ();
|
||||
}
|
||||
void loadSharedPrefLanguage() async {
|
||||
currentLanguage = await sharedPref.getString(APP_Language);
|
||||
_appLocale = Locale(currentLanguage ?? 'ar');
|
||||
_isArabic = currentLanguage != null
|
||||
? currentLanguage == 'ar' ? true : false
|
||||
: false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void changeLanguage(String lan) {
|
||||
if (lan != "en" && currentLanguage != lan) {
|
||||
_appLocale = Locale("ar");
|
||||
_isArabic = true;
|
||||
currentLanguage = 'ar';
|
||||
sharedPref.setString(APP_Language, 'ar');
|
||||
} else if (lan != "ar" && currentLanguage != lan) {
|
||||
_appLocale = Locale("en");
|
||||
_isArabic = false;
|
||||
currentLanguage = 'en';
|
||||
sharedPref.setString(APP_Language, 'en');
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BodyMeasurementsScreen extends StatelessWidget {
|
||||
BodyMeasurementsScreen();
|
||||
List<VitalSignResModel> vitalList;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_seriesData = List<charts.Series<Pollution, String>>();
|
||||
_seriesPieData = List<charts.Series<Task, String>>();
|
||||
_seriesLineData = List<charts.Series<Sales, int>>();
|
||||
_generateData();
|
||||
return AppScaffold(
|
||||
appBarTitle: 'Body Measurements',
|
||||
body: RoundedContainer(
|
||||
height: SizeConfig.realScreenHeight*0.4,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Body Mass Index',
|
||||
style: TextStyle(
|
||||
fontSize: 24.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Expanded(
|
||||
child: charts.BarChart(
|
||||
_seriesData,
|
||||
animate: true,
|
||||
barGroupingType: charts.BarGroupingType.grouped,
|
||||
// behaviors: [new charts.SeriesLegend()],
|
||||
// primaryMeasureAxis: ,
|
||||
animationDuration: Duration(seconds: 5),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<charts.Series<Pollution, String>> _seriesData;
|
||||
List<charts.Series<Task, String>> _seriesPieData;
|
||||
List<charts.Series<Sales, int>> _seriesLineData;
|
||||
|
||||
_generateData() {
|
||||
var data1 = [
|
||||
new Pollution(1980, 'USA', 40),
|
||||
];
|
||||
|
||||
|
||||
_seriesData.add(
|
||||
charts.Series(
|
||||
domainFn: (Pollution pollution, _) => '',
|
||||
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||
id: '2017',
|
||||
data: data1,
|
||||
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||
fillColorFn: (Pollution pollution, _) =>
|
||||
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||
),
|
||||
);
|
||||
_seriesData.add(
|
||||
charts.Series(
|
||||
domainFn: (Pollution pollution, _) => '',
|
||||
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||
id: '2017',
|
||||
data: data1,
|
||||
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||
fillColorFn: (Pollution pollution, _) =>
|
||||
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||
),
|
||||
);
|
||||
_seriesData.add(
|
||||
charts.Series(
|
||||
domainFn: (Pollution pollution, _) => '',
|
||||
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||
id: '2017',
|
||||
data: data1,
|
||||
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||
fillColorFn: (Pollution pollution, _) =>
|
||||
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||
),
|
||||
);
|
||||
_seriesData.add(
|
||||
charts.Series(
|
||||
domainFn: (Pollution pollution, _) => '',
|
||||
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||
id: '2017',
|
||||
data: data1,
|
||||
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||
fillColorFn: (Pollution pollution, _) =>
|
||||
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||
),
|
||||
);
|
||||
_seriesData.add(
|
||||
charts.Series(
|
||||
domainFn: (Pollution pollution, _) => '',
|
||||
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||
id: '2017',
|
||||
data: data1,
|
||||
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||
fillColorFn: (Pollution pollution, _) =>
|
||||
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Pollution {
|
||||
String place;
|
||||
int year;
|
||||
int quantity;
|
||||
|
||||
Pollution(this.year, this.place, this.quantity);
|
||||
}
|
||||
|
||||
class Task {
|
||||
String task;
|
||||
double taskvalue;
|
||||
Color colorval;
|
||||
|
||||
Task(this.task, this.taskvalue, this.colorval);
|
||||
}
|
||||
|
||||
class Sales {
|
||||
int yearval;
|
||||
int salesval;
|
||||
|
||||
Sales(this.yearval, this.salesval);
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
import 'package:doctor_app_flutter/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../config/size_config.dart';
|
||||
import '../../../../models/patient/vital_sign_res_model.dart';
|
||||
import '../../../../widgets/patients/profile/profile_medical_info_widget.dart';
|
||||
import '../../../../widgets/shared/app_scaffold_widget.dart';
|
||||
import '../../../../widgets/shared/rounded_container_widget.dart';
|
||||
|
||||
class VitalSignDetailsScreen extends StatelessWidget {
|
||||
// VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key);
|
||||
VitalSignResModel vitalSing;
|
||||
String url = "assets/images/";
|
||||
final double contWidth = SizeConfig.realScreenWidth * 0.70;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
vitalSing = routeArgs['vitalSing'];
|
||||
return AppScaffold(
|
||||
appBarTitle: "vital Sing ",
|
||||
body: RoundedContainer(
|
||||
height: SizeConfig.realScreenHeight * 0.7,
|
||||
child: CustomScrollView(
|
||||
primary: false,
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
sliver: SliverGrid.count(
|
||||
childAspectRatio: 0.7,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 0,
|
||||
crossAxisCount: 3,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: (){
|
||||
Navigator.of(context).pushNamed(BODY_MEASUREMENTS);
|
||||
},
|
||||
child: CircleAvatarWidget(
|
||||
des: 'Body Measurements',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Temperature',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Pulse',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Respiration',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Blood Pressure',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Oxygenation',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
CircleAvatarWidget(
|
||||
des: 'Pain Scale',
|
||||
url: url + 'heartbeat.png',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// height: 500,
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,65 @@
|
||||
import 'package:doctor_app_flutter/providers/project_provider.dart';
|
||||
import 'package:doctor_app_flutter/providers/hospital_provider.dart';
|
||||
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:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
class SettingsScreen extends StatelessWidget {
|
||||
|
||||
ProjectProvider projectsProvider;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectsProvider = Provider.of(context);
|
||||
return AppScaffold(
|
||||
appBarTitle: "SETTINS",
|
||||
body: Container(),
|
||||
appBarTitle: TranslationBase.of(context).settings.toUpperCase(),
|
||||
body: ListView(
|
||||
children: [
|
||||
AppText(TranslationBase.of(context).language.toUpperCase(),fontSize: 18,margin: 5,fontWeight: FontWeight.bold,),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey[600],width: 2.0),
|
||||
borderRadius: BorderRadius.circular(8.0)
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(7.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () { projectsProvider.changeLanguage('en'); },
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 350),
|
||||
decoration: BoxDecoration(
|
||||
color: !projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent,
|
||||
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
|
||||
),
|
||||
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: (){projectsProvider.changeLanguage('ar');},
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 350),
|
||||
decoration: BoxDecoration(
|
||||
color: projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent,
|
||||
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
|
||||
),
|
||||
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:doctor_app_flutter/config/localized_values.dart';
|
||||
import 'package:flutter/foundation.dart' show SynchronousFuture;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TranslationBase {
|
||||
TranslationBase(this.locale);
|
||||
|
||||
final Locale locale;
|
||||
|
||||
static TranslationBase of(BuildContext context) {
|
||||
return Localizations.of<TranslationBase>(context, TranslationBase);
|
||||
}
|
||||
|
||||
|
||||
|
||||
String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode];
|
||||
|
||||
String get settings => localizedValues['settings'][locale.languageCode];
|
||||
|
||||
String get language => localizedValues['language'][locale.languageCode];
|
||||
|
||||
String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode];
|
||||
|
||||
String get lanArabic => localizedValues['lanArabic'][locale.languageCode];
|
||||
|
||||
}
|
||||
|
||||
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {
|
||||
const TranslationBaseDelegate();
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) => ['en', 'ar'].contains(locale.languageCode);
|
||||
|
||||
@override
|
||||
Future<TranslationBase> load(Locale locale) {
|
||||
return SynchronousFuture<TranslationBase>(TranslationBase(locale));
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldReload(TranslationBaseDelegate old) => false;
|
||||
}
|
||||
Loading…
Reference in New Issue