|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
|
@ -10,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
|
|
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
|
|
|
|
|
|
class DashboardSwipeWidget extends StatefulWidget {
|
|
|
|
|
final List<DashboardModel> dashboardItemList;
|
|
|
|
|
@ -48,36 +48,36 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
|
|
|
|
|
// itemHeight: 300,
|
|
|
|
|
pagination: new SwiperCustomPagination(
|
|
|
|
|
builder: (BuildContext context, SwiperPluginConfig config) {
|
|
|
|
|
return new Stack(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
config.activeIndex == 0
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
config.activeIndex == 1
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
config.activeIndex == 2
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
],
|
|
|
|
|
return new Stack(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
config.activeIndex == 0
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
config.activeIndex == 1
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
config.activeIndex == 2
|
|
|
|
|
? SwiperRoundedPagination(true)
|
|
|
|
|
: SwiperRoundedPagination(false),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
viewportFraction: 0.9,
|
|
|
|
|
// scale: 0.9,
|
|
|
|
|
// control: new SwiperControl(),
|
|
|
|
|
@ -88,16 +88,20 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
|
|
|
|
|
Widget getSwipeWidget(List<DashboardModel> dashboardItemList, int index) {
|
|
|
|
|
if (index == 1)
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
raduis: 16,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
shadowWidth: 0.2,
|
|
|
|
|
shadowSpreadRadius: 3,
|
|
|
|
|
shadowDy: 1,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: GetOutPatientStack(dashboardItemList[1])));
|
|
|
|
|
raduis: 16,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
shadowWidth: 0.2,
|
|
|
|
|
shadowSpreadRadius: 3,
|
|
|
|
|
shadowDy: 1,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: GetOutPatientStack(
|
|
|
|
|
dashboardItemList[1],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (index == 0)
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
raduis: 16,
|
|
|
|
|
@ -120,7 +124,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
|
|
|
|
|
shadowDy: 1,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child:
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -137,9 +141,9 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
|
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
@ -228,8 +232,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static List<charts.Series<GaugeSegment, String>> _createReferralData(
|
|
|
|
|
List<DashboardModel> dashboardItemList) {
|
|
|
|
|
static List<charts.Series<GaugeSegment, String>> _createReferralData(List<DashboardModel> dashboardItemList) {
|
|
|
|
|
final data = [
|
|
|
|
|
new GaugeSegment(
|
|
|
|
|
dashboardItemList[2].summaryoptions[0].kPIParameter,
|
|
|
|
|
|