H2O feature improvement

merge-requests/259/head
Sikander Saleem 5 years ago
parent 8f37fbf260
commit 3b4e791017

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

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

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

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

@ -1,11 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.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/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MonthPage extends StatelessWidget {
@override
@ -15,11 +17,38 @@ class MonthPage extends StatelessWidget {
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
appBarTitle: "Water Tracker",
baseViewModel:model ,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: AppBarChart(
seriesList: model.userProgressForMonthDataSeries),
baseViewModel: model,
body: Padding(
padding: EdgeInsets.all(8.0),
child: ListView(
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(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 40,
),
// SizedBox(
// height: 40,
// ),
Text(
"Consumed",
style: TextStyle(fontSize: 20.0),
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: model.userProgressData.quantityConsumed
.toString() +
'ml',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: HexColor("#60BCF9")),
model.userProgressData == null ? "0.0" : model.userProgressData.quantityConsumed.toString() + 'ml',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
@ -71,7 +65,7 @@ class TodayPage extends StatelessWidget {
),
Text(
"Remaining",
style: TextStyle(fontSize: 20.0),
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
@ -79,18 +73,10 @@ class TodayPage extends StatelessWidget {
Text(
model.userProgressData == null
? "0.0"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed) <
0
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0
? "0 ml"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed)
.toString() +
' ml',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18.0),
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + ' ml',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
),
@ -104,42 +90,32 @@ class TodayPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
margin: EdgeInsets.only(left: 20),
height: 30,
width: 70,
decoration: BoxDecoration(
color: HexColor("#D1E3F6"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"Remaining % ",
style: TextStyle(fontSize: 20.0),
"Remaining %",
style: TextStyle(fontSize: 16.0),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
margin: EdgeInsets.only(left: 20),
height: 30,
width: 70,
decoration: BoxDecoration(
color: HexColor("#60BCF9"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"Consumed % ",
style: TextStyle(fontSize: 20.0),
"Consumed %",
style: TextStyle(fontSize: 16.0),
)
],
)

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.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/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -17,14 +18,39 @@ class WeekPage extends StatelessWidget {
isShowAppBar: false,
appBarTitle: "Water Tracker",
baseViewModel: model,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: AppBarChart(seriesList: model.userProgressForWeekDataSeries),
body: Padding(
padding: EdgeInsets.all(8.0),
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';
class H20FloatingActionButton extends StatefulWidget {
const H20FloatingActionButton({
Key key,
@required AnimationController controller,
@required this.model
}) :
super(key: key);
const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
final H2OViewModel model;
@ -26,7 +20,7 @@ class H20FloatingActionButton extends StatefulWidget {
_H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
}
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
@ -39,9 +33,13 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
@override
Widget build(BuildContext context) {
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(
@ -87,11 +85,9 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
animation: _controller,
builder: (BuildContext context, Widget child) {
return new Transform(
transform: new Matrix4.rotationZ(
_controller.value * 0.5 * math.pi),
transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
alignment: FractionalOffset.center,
child: new Icon(
_controller.isDismissed ? Icons.add : Icons.close),
child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
);
},
),
@ -104,21 +100,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
},
),
new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
scale: new CurvedAnimation(
parent: _controller,
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(
backgroundColor: Colors.white,
heroTag: null,
mini: true,
// mini: true,
child: Text(
"Custom",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
style: TextStyle(fontSize: 12, color: Colors.grey),
),
onPressed: () {
Navigator.push(
@ -134,21 +130,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
),
),
new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
scale: new CurvedAnimation(
parent: _controller,
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(
backgroundColor: Colors.white,
heroTag: null,
mini: true,
//mini: true,
child: Text(
"Undo",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
style: TextStyle(fontSize: 12.0, color: Colors.grey),
),
onPressed: () {},
),
@ -162,11 +158,7 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
}
class ActionButton extends StatelessWidget {
const ActionButton(
{Key key,
@required AnimationController controller,
@required this.text,
this.onTap})
const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
: _controller = controller,
super(key: key);
@ -177,6 +169,7 @@ class ActionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 4, bottom: 8),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
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),
),
child: new FloatingActionButton(
heroTag: null,
backgroundColor: Colors.white,
mini: true,
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
),
onPressed: onTap
),
heroTag: null,
backgroundColor: Colors.white,
//mini: true,
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0, color: Colors.grey),
),
onPressed: onTap),
),
);
}

@ -658,6 +658,8 @@ class TranslationBase {
String get mobileNumber =>
localizedValues['MobileNumber'][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 =>
localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode];
String get pleaseEnterTheVerificationCode =>

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

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

Loading…
Cancel
Save