|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_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/uitl/utils_new.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/charts/custom_line_chart.dart';
|
|
|
|
|
|
|
|
class MonthPage extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
return BaseView<H2OViewModel>(
|
|
|
|
onModelReady: (model) => model.getUserProgressForMonthData(),
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
isShowAppBar: false,
|
|
|
|
appBarTitle: TranslationBase.of(context).h2o,
|
|
|
|
baseViewModel: model,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
child: (model.userProgressForMonthDataSeries ?? []).isEmpty
|
|
|
|
? getNoDataWidget(context)
|
|
|
|
: Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(16, 14, 16, 14),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(10.0),
|
|
|
|
),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
blurRadius: 27,
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).waterConsumedInMonth,
|
|
|
|
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
|
|
|
|
),
|
|
|
|
SizedBox(height: 24),
|
|
|
|
CustomLineChart(model.userProgressForMonthDataSeries, projectViewModel.isArabic),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|