|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class GetOutPatientStack extends StatelessWidget {
|
|
|
|
|
final value;
|
|
|
|
|
|
|
|
|
|
GetOutPatientStack(this.value);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
value.summaryoptions
|
|
|
|
|
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
|
|
|
|
|
|
|
|
|
|
var list = new List<Widget>();
|
|
|
|
|
value.summaryoptions.forEach((result) =>
|
|
|
|
|
{list.add(getStack(result, value.summaryoptions.first.value))});
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
value.kPIName,
|
|
|
|
|
medium: true,
|
|
|
|
|
),
|
|
|
|
|
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getStack(Summaryoptions value, max) {
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 2),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
color: Colors.red[50],
|
|
|
|
|
),
|
|
|
|
|
child: Stack(children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: SizedBox(),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
height: max != 0 ? (150 * value.value) / max : 0,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
color: Color(0x63D02127),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 150,
|
|
|
|
|
margin: EdgeInsets.only(left: 5, top: 5),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 3,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Align(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
child: AppText(
|
|
|
|
|
value.kPIParameter + ' (' + value.value.toString() + ') ',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|