H2O feature improvement

merge-update-with-lab-changes
Sikander Saleem 5 years ago
parent 8f37fbf260
commit 3b4e791017

@ -610,6 +610,8 @@ const Map localizedValues = {
"DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"},
"MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"},
"Ok": {"en": "Ok", "ar": "حسنا"}, "Ok": {"en": "Ok", "ar": "حسنا"},
"WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"},
"WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"},
"TheVerificationCodeExpiresIn": { "TheVerificationCodeExpiresIn": {
"en": "The Verification Code Expires In", "en": "The Verification Code Expires In",
"ar": "تنتهي صلاحية رمز التحقق في" "ar": "تنتهي صلاحية رمز التحقق في"

@ -37,6 +37,8 @@ import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'h2o/h2o_page.dart';
class AllHabibMedicalService extends StatefulWidget { class AllHabibMedicalService extends StatefulWidget {
//TODO //TODO
final Function goToMyProfile; final Function goToMyProfile;
@ -56,12 +58,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
locationUtils = locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))});
WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
}); });
super.initState(); super.initState();
} }
@ -100,8 +98,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).healthWeatherIndicators,
.healthWeatherIndicators,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
@ -134,11 +131,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
width: 60, width: 60,
height: 60, height: 60,
), ),
Directionality( Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white))
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
], ],
), ),
Texts( Texts(
@ -158,8 +151,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.pop(context); Navigator.pop(context);
widget.goToMyProfile(); widget.goToMyProfile();
}, },
imageLocation: imageLocation: 'assets/images/new-design/my_file_bottom_bar.png',
'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile, title: TranslationBase.of(context).myMedicalFile,
), ),
ServicesContainer( ServicesContainer(
@ -181,8 +173,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/booking_icon_active.png',
'assets/images/new-design/booking_icon_active.png',
title: TranslationBase.of(context).bookAppo, title: TranslationBase.of(context).bookAppo,
), ),
ServicesContainer( ServicesContainer(
@ -192,8 +183,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: PaymentService(), page: PaymentService(),
), ),
), ),
imageLocation: imageLocation: 'assets/images/al-habib_online_payment_service_icon.png',
'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService, title: TranslationBase.of(context).onlinePaymentService,
), ),
ServicesContainer( ServicesContainer(
@ -201,8 +191,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
context, context,
FadePage(), FadePage(),
), ),
imageLocation: imageLocation: 'assets/images/al-habib_online_payment_service_icon.png',
'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).covid19_driveThrueTest, title: TranslationBase.of(context).covid19_driveThrueTest,
), ),
ServicesContainer( ServicesContainer(
@ -235,17 +224,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: InsuranceUpdate(), page: InsuranceUpdate(),
), ),
), ),
imageLocation: imageLocation: 'assets/images/medical/insurance_card_icon.png',
'assets/images/medical/insurance_card_icon.png',
title: TranslationBase.of(context).updateInsurance, title: TranslationBase.of(context).updateInsurance,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(page: authUser.patientID == null ? EReferralIndexPage() : EReferralPage()),
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
), ),
imageLocation: 'assets/images/ereferral_service_icon.png', imageLocation: 'assets/images/ereferral_service_icon.png',
title: TranslationBase.of(context).ereferral, title: TranslationBase.of(context).ereferral,
@ -257,20 +242,18 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: MyFamily(), page: MyFamily(),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/family_menu_icon_red.png',
'assets/images/new-design/family_menu_icon_red.png',
title: TranslationBase.of(context).myFamily, title: TranslationBase.of(context).myFamily,
), ),
if(projectViewModel.havePrivilege(35)) if (projectViewModel.havePrivilege(35))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(page: ChildVaccinesPage()), FadePage(page: ChildVaccinesPage()),
),
imageLocation: 'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine,
), ),
imageLocation:
'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -278,27 +261,26 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ToDo(isShowAppBar: true), page: ToDo(isShowAppBar: true),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png',
'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
if(projectViewModel.havePrivilege(42)) if (projectViewModel.havePrivilege(42))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: TranslationBase.of(context).symptomCheckerTitle),
if(projectViewModel.havePrivilege(36))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(page: BloodDonationPage()), FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: TranslationBase.of(context).symptomCheckerTitle),
if (projectViewModel.havePrivilege(36))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: TranslationBase.of(context).bloodD,
), ),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: TranslationBase.of(context).bloodD,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -306,8 +288,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: (HealthCalculators()), page: (HealthCalculators()),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/health_calculator_icon.png',
'assets/images/new-design/health_calculator_icon.png',
title: TranslationBase.of(context).calculators, title: TranslationBase.of(context).calculators,
), ),
ServicesContainer( ServicesContainer(
@ -317,30 +298,30 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: HealthConverter(), page: HealthConverter(),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/health_convertor_icon.png',
'assets/images/new-design/health_convertor_icon.png',
title: TranslationBase.of(context).converters, title: TranslationBase.of(context).converters,
), ),
if(projectViewModel.havePrivilege(38)) if (projectViewModel.havePrivilege(38))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(context, FadePage(page: H2OPage())),
context, // Navigator.push(
FadePage( // context,
page: H2OPageIndexPage(), // FadePage(
), // page: H2OPageIndexPage(),
// ),
// ),
imageLocation: 'assets/images/new-design/water_icon.png',
title: 'H2O',
), ),
imageLocation: 'assets/images/new-design/water_icon.png', if (projectViewModel.havePrivilege(41))
title: 'H2O', ServicesContainer(
), onTap: () => Navigator.push(
if(projectViewModel.havePrivilege(41)) context,
ServicesContainer( FadePage(),
onTap: () => Navigator.push( ),
context, imageLocation: 'assets/images/new-design/smartwatch_icon.png',
FadePage(), title: TranslationBase.of(context).smartWatches,
), ),
imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -348,15 +329,12 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ParkingPage(), page: ParkingPage(),
), ),
), ),
imageLocation: imageLocation: 'assets/images/new-design/parking_system_icon.png',
'assets/images/new-design/parking_system_icon.png',
title: TranslationBase.of(context).parking, title: TranslationBase.of(context).parking,
), ),
ServicesContainer( ServicesContainer(
onTap: () => launch( onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"),
"https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png',
imageLocation:
'assets/images/new-design/virtual_tour_icon.png',
title: TranslationBase.of(context).vTour, title: TranslationBase.of(context).vTour,
), ),
ServicesContainer( ServicesContainer(
@ -364,12 +342,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => MyWebView( builder: (BuildContext context) => MyWebView(
title: "HMG News", title: "HMG News",
selectedUrl: selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
))); )));
}, },
imageLocation: imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png',
'assets/images/new-design/twitter_dashboard_icon.png',
title: TranslationBase.of(context).latestNews, title: TranslationBase.of(context).latestNews,
), ),
ServicesContainer( ServicesContainer(
@ -392,8 +368,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });
@ -407,8 +382,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}); });
} else { } else {
setState(() { setState(() {
weather = weather = data != null ? data['Temperature'].toString() + '\u2103' : '--';
data != null ? data['Temperature'].toString() + '\u2103' : '--';
}); });
} }
} }

@ -12,9 +12,7 @@ class ConfirmAddAmountDialog extends StatefulWidget {
final String unit; final String unit;
final H2OViewModel model; final H2OViewModel model;
ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
ConfirmAddAmountDialog(
{Key key, this.model,this.amount,this.unit ="ml"});
@override @override
_ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
@ -29,10 +27,12 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
title: Center( title: Center(
child: Texts( child: Texts(
"Confirm", "Confirm",
textAlign: TextAlign.center,
color: Colors.black, color: Colors.black,
), ),
), ),
@ -43,11 +43,12 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
Center( Center(
child: Texts( child: Texts(
"Are you sure you want to Add ${widget.amount} ${widget.unit} ?", "Are you sure you want to Add ${widget.amount} ${widget.unit} ?",
textAlign: TextAlign.center,
color: Colors.grey, color: Colors.grey,
), ),
), ),
SizedBox( SizedBox(
height: 5.0, height: 16.0,
), ),
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -79,8 +80,8 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () async{ onTap: () async {
InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:widget.amount ); InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
await widget.model.insertUserActivity(insertUserActivityRequestModel); await widget.model.insertUserActivity(insertUserActivityRequestModel);
Navigator.pop(context); Navigator.pop(context);
}, },
@ -88,20 +89,17 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
)), )),
), ),
), ),
), ),
], ],
) ),
], ],
) )
], ],
); );
} }
} }

@ -60,48 +60,46 @@ class _H2OPageState extends State<H2OPage>
Center( Center(
child: Container( child: Container(
height: 60.0, height: 60.0,
margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.9, // margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.9,
child: Center( child: TabBar(
child: TabBar( isScrollable: false,
isScrollable: false, controller: _tabController,
controller: _tabController, indicatorWeight: 5.0,
indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab,
indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800],
indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor,
labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
labelPadding: unselectedLabelColor: Colors.grey[800],
EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), tabs: [
unselectedLabelColor: Colors.grey[800], Container(
tabs: [ width: MediaQuery.of(context).size.width * 0.28,
Container( child: Center(
width: MediaQuery.of(context).size.width * 0.28, child: Texts("Today"),
child: Center(
child: Texts(
"Today"),
),
), ),
Container( ),
width: MediaQuery.of(context).size.width * 0.28, Container(
child: Center( width: MediaQuery.of(context).size.width * 0.28,
child: Texts("Week"), child: Center(
), child: Texts("Week"),
), ),
Container( ),
width: MediaQuery.of(context).size.width * 0.28, Container(
child: Center( width: MediaQuery.of(context).size.width * 0.28,
child: Texts("Month"), child: Center(
), child: Texts("Month"),
), ),
], ),
), ],
), ),
), ),
), ),
], ],
), ),
), ),
backgroundColor: Colors.white,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(

@ -1,11 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MonthPage extends StatelessWidget { class MonthPage extends StatelessWidget {
@override @override
@ -15,11 +17,38 @@ class MonthPage extends StatelessWidget {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
appBarTitle: "Water Tracker", appBarTitle: "Water Tracker",
baseViewModel:model , baseViewModel: model,
body: SingleChildScrollView( body: Padding(
padding: EdgeInsets.symmetric(vertical: 12), padding: EdgeInsets.all(8.0),
child: AppBarChart( child: ListView(
seriesList: model.userProgressForMonthDataSeries), children: [
Center(
child: Text(
TranslationBase.of(context).waterConsumedInMonth,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0, color: Colors.black87),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 10,
width: 40,
color: Colors.blue,
),
SizedBox(width: 8),
Text(
TranslationBase.of(context).waterConsumedInMonth,
style: TextStyle(fontSize: 12.0),
),
],
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForMonthDataSeries),
],
),
), ),
), ),
); );

@ -36,27 +36,21 @@ class TodayPage extends StatelessWidget {
//, //,
center: Center( center: Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox( // SizedBox(
height: 40, // height: 40,
), // ),
Text( Text(
"Consumed", "Consumed",
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 16.0),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
Text( Text(
model.userProgressData == null model.userProgressData == null ? "0.0" : model.userProgressData.quantityConsumed.toString() + 'ml',
? "0.0" style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
: model.userProgressData.quantityConsumed
.toString() +
'ml',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: HexColor("#60BCF9")),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -71,7 +65,7 @@ class TodayPage extends StatelessWidget {
), ),
Text( Text(
"Remaining", "Remaining",
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 16.0),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -79,18 +73,10 @@ class TodayPage extends StatelessWidget {
Text( Text(
model.userProgressData == null model.userProgressData == null
? "0.0" ? "0.0"
: (model.userProgressData.quantityLimit - : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0
model.userProgressData
.quantityConsumed) <
0
? "0 ml" ? "0 ml"
: (model.userProgressData.quantityLimit - : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + ' ml',
model.userProgressData style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
.quantityConsumed)
.toString() +
' ml',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18.0),
), ),
], ],
), ),
@ -104,42 +90,32 @@ class TodayPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Center( Container(
child: Container( margin: EdgeInsets.only(bottom: 16),
margin: EdgeInsets.only(left: 20), height: 30,
height: 30, width: 70,
width: 70, decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
decoration: BoxDecoration(
color: HexColor("#D1E3F6"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
), ),
Text( Text(
"Remaining % ", "Remaining %",
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 16.0),
) )
], ],
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Center( Container(
child: Container( margin: EdgeInsets.only(bottom: 16),
margin: EdgeInsets.only(left: 20), height: 30,
height: 30, width: 70,
width: 70, decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
decoration: BoxDecoration(
color: HexColor("#60BCF9"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
), ),
Text( Text(
"Consumed % ", "Consumed %",
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 16.0),
) )
], ],
) )

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -17,14 +18,39 @@ class WeekPage extends StatelessWidget {
isShowAppBar: false, isShowAppBar: false,
appBarTitle: "Water Tracker", appBarTitle: "Water Tracker",
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: Padding(
padding: EdgeInsets.symmetric(vertical: 12), padding: EdgeInsets.all(8.0),
child: AppBarChart(seriesList: model.userProgressForWeekDataSeries), child: ListView(
children: [
Center(
child: Text(
TranslationBase.of(context).waterConsumedInWeek,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0, color: Colors.black87),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 10,
width: 40,
color: Colors.blue,
),
SizedBox(width: 8),
Text(
TranslationBase.of(context).waterConsumedInWeek,
style: TextStyle(fontSize: 12.0),
),
],
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForWeekDataSeries),
],
),
), ),
), ),
); );
} }
} }

@ -12,13 +12,7 @@ import 'package:flutter/material.dart';
import '../add_custom_amount.dart'; import '../add_custom_amount.dart';
class H20FloatingActionButton extends StatefulWidget { class H20FloatingActionButton extends StatefulWidget {
const H20FloatingActionButton({ const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
Key key,
@required AnimationController controller,
@required this.model
}) :
super(key: key);
final H2OViewModel model; final H2OViewModel model;
@ -26,7 +20,7 @@ class H20FloatingActionButton extends StatefulWidget {
_H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
} }
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin { class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
AnimationController _controller; AnimationController _controller;
@override @override
void initState() { void initState() {
@ -39,9 +33,13 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
void showConfirmMessage(int amount, H2OViewModel model) { void showConfirmMessage(int amount, H2OViewModel model) {
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); showDialog(
context: context,
child: ConfirmAddAmountDialog(
model: model,
amount: amount,
));
} }
return Container( return Container(
@ -87,11 +85,9 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
animation: _controller, animation: _controller,
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
return new Transform( return new Transform(
transform: new Matrix4.rotationZ( transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
_controller.value * 0.5 * math.pi),
alignment: FractionalOffset.center, alignment: FractionalOffset.center,
child: new Icon( child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
_controller.isDismissed ? Icons.add : Icons.close),
); );
}, },
), ),
@ -104,21 +100,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
}, },
), ),
new Container( new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter, alignment: FractionalOffset.topCenter,
child: new ScaleTransition( child: new ScaleTransition(
scale: new CurvedAnimation( scale: new CurvedAnimation(
parent: _controller, parent: _controller,
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
curve: Curves.easeOut),
), ),
child: new FloatingActionButton( child: new FloatingActionButton(
backgroundColor: Colors.white, backgroundColor: Colors.white,
heroTag: null, heroTag: null,
mini: true, // mini: true,
child: Text( child: Text(
"Custom", "Custom",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey), style: TextStyle(fontSize: 12, color: Colors.grey),
), ),
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
@ -134,21 +130,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
), ),
), ),
new Container( new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter, alignment: FractionalOffset.topCenter,
child: new ScaleTransition( child: new ScaleTransition(
scale: new CurvedAnimation( scale: new CurvedAnimation(
parent: _controller, parent: _controller,
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
curve: Curves.easeOut),
), ),
child: new FloatingActionButton( child: new FloatingActionButton(
backgroundColor: Colors.white, backgroundColor: Colors.white,
heroTag: null, heroTag: null,
mini: true, //mini: true,
child: Text( child: Text(
"Undo", "Undo",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey), style: TextStyle(fontSize: 12.0, color: Colors.grey),
), ),
onPressed: () {}, onPressed: () {},
), ),
@ -162,11 +158,7 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
} }
class ActionButton extends StatelessWidget { class ActionButton extends StatelessWidget {
const ActionButton( const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
{Key key,
@required AnimationController controller,
@required this.text,
this.onTap})
: _controller = controller, : _controller = controller,
super(key: key); super(key: key);
@ -177,6 +169,7 @@ class ActionButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(left: 4, bottom: 8),
alignment: FractionalOffset.topCenter, alignment: FractionalOffset.topCenter,
child: new ScaleTransition( child: new ScaleTransition(
scale: new CurvedAnimation( scale: new CurvedAnimation(
@ -184,16 +177,15 @@ class ActionButton extends StatelessWidget {
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), ),
child: new FloatingActionButton( child: new FloatingActionButton(
heroTag: null, heroTag: null,
backgroundColor: Colors.white, backgroundColor: Colors.white,
mini: true, //mini: true,
child: Text( child: Text(
text, text,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey), style: TextStyle(fontSize: 12.0, color: Colors.grey),
), ),
onPressed: onTap onPressed: onTap),
),
), ),
); );
} }

@ -658,6 +658,8 @@ class TranslationBase {
String get mobileNumber => String get mobileNumber =>
localizedValues['MobileNumber'][locale.languageCode]; localizedValues['MobileNumber'][locale.languageCode];
String get ok => localizedValues['Ok'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode];
String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode];
String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode];
String get theVerificationCodeExpiresIn => String get theVerificationCodeExpiresIn =>
localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode];
String get pleaseEnterTheVerificationCode => String get pleaseEnterTheVerificationCode =>

@ -13,30 +13,38 @@ class AppBarChart extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: 400, height: 400,
margin: EdgeInsets.only(top: 60), //margin: EdgeInsets.only(top: 60),
child: charts.BarChart( child: charts.BarChart(
seriesList, seriesList,
// animate: animate, // animate: animate,
domainAxis: charts.OrdinalAxisSpec(
renderSpec: charts.GridlineRendererSpec(
labelAnchor: charts.TickLabelAnchor.after,
labelRotation: -30,
labelOffsetFromAxisPx: 30,
labelOffsetFromTickPx: 15,
labelJustification: charts.TickLabelJustification.inside,
),
),
/// Customize the primary measure axis using a small tick renderer. /// Customize the primary measure axis using a small tick renderer.
/// Use String instead of num for ordinal domain axis /// Use String instead of num for ordinal domain axis
/// (typically bar charts). /// (typically bar charts).
primaryMeasureAxis: new charts.NumericAxisSpec( primaryMeasureAxis: new charts.NumericAxisSpec(
renderSpec: new charts.GridlineRendererSpec( renderSpec: new charts.GridlineRendererSpec(
// Display the measure axis labels below the gridline. // Display the measure axis labels below the gridline.
// //
// 'Before' & 'after' follow the axis value direction. // 'Before' & 'after' follow the axis value direction.
// Vertical axes draw 'before' below & 'after' above the tick. // Vertical axes draw 'before' below & 'after' above the tick.
// Horizontal axes draw 'before' left & 'after' right the tick. // Horizontal axes draw 'before' left & 'after' right the tick.
labelAnchor: charts.TickLabelAnchor.before, labelAnchor: charts.TickLabelAnchor.before,
// Left justify the text in the axis. // Left justify the text in the axis.
// //
// Note: outside means that the secondary measure axis would right // Note: outside means that the secondary measure axis would right
// justify. // justify.
labelJustification: labelJustification: charts.TickLabelJustification.outside,
charts.TickLabelJustification.outside, )),
)),
), ),
); );
} }

@ -96,6 +96,7 @@ class AppScaffold extends StatelessWidget {
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: body, : body,
floatingActionButton: floatingActionButton,
); );
} }

Loading…
Cancel
Save