import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; class LakumPointTableRowWidget extends StatefulWidget { final bool isTableTitle; // true : title , false: row final String rowTitle; final double points; final double riyal; final Function onTap; final int rowIndex; LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points, this.riyal, this.onTap, this.rowIndex); @override _LakumPointTableRowWidgetState createState() => _LakumPointTableRowWidgetState(); } class _LakumPointTableRowWidgetState extends State { @override Widget build(BuildContext context) { bool isEven = widget.rowIndex % 2 == 0; return InkWell( onTap: widget.onTap, child: Container( color: isEven ? Color(0xffefefef) : Colors.white, child: Column( children: [ Row( 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( color: Color(0xFFD6D6D6), height: 1, thickness: 2, indent: 0, endIndent: 0, ), ], ), ), ); } }