working on lakum account

merge-update-with-lab-changes
mosazaid 5 years ago
parent 4e5d6a9a00
commit 951c77feb5

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -43,12 +44,32 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
(index) => LacumPointsYearWidget( (index) => LacumPointsYearWidget(
mediaQuery, mediaQuery,
widget.selectedIndexYear == index, widget.selectedIndexYear == index,
widget.pointsAmountPerYear[index], widget.pointsAmountPerYear[index], () {
() {})), setState(() {
widget.selectedIndexYear = index;
});
})),
], ],
), ),
), ),
SizedBox(
height: 10,
),
LakumPointTableRowWidget(true, "MONTH", 0, 0, null, 0),
...List.generate(
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth.length,
(index) => LakumPointTableRowWidget(
true,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].month,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].pointsPerMonth,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].amountPerMonth,
(){},
index),
),
], ],
), ),
), ),

@ -1,15 +1,16 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LakumPointTableRowWidget extends StatefulWidget { class LakumPointTableRowWidget extends StatefulWidget {
final bool isTableTitle; // true : title , false: row final bool isTableTitle; // true : title , false: row
final String tableType; // month, day final String rowTitle;
final double points; final double points;
final double riyal; final double riyal;
final Function onTap; final Function onTap;
final int rowIndex; final int rowIndex;
LakumPointTableRowWidget( LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points,
this.isTableTitle, this.tableType, this.points, this.riyal, this.onTap, this.rowIndex); this.riyal, this.onTap, this.rowIndex);
@override @override
_LakumPointTableRowWidgetState createState() => _LakumPointTableRowWidgetState createState() =>
@ -20,12 +21,48 @@ class _LakumPointTableRowWidgetState extends State<LakumPointTableRowWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isEven = widget.rowIndex % 2 == 0; bool isEven = widget.rowIndex % 2 == 0;
return Container( return InkWell(
onTap: widget.onTap,
child: Container(
color: isEven ? Color(0xffefefef) : Colors.white,
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Expanded(
child: Container(
child: Texts(
widget.rowTitle,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "POINTS" : widget.points,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "RIYAL" : widget.riyal,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: widget.isTableTitle
? Container()
: Icon(Icons.arrow_forward_ios)),
], ],
), ),
const Divider( const Divider(
@ -37,6 +74,7 @@ class _LakumPointTableRowWidgetState extends State<LakumPointTableRowWidget> {
), ),
], ],
), ),
),
); );
} }
} }

Loading…
Cancel
Save