getWidgetDienTich static method
Implementation
static Widget getWidgetDienTich(
double metter, {
String mode = 'ha',
TextStyle? textStyle,
}) {
double ha = Methods.round(metter / 10000.0, 2);
String giaTri = (Methods.toInt(metter.toString())).toString();
String donVi1 = Message.getMessage('M2');
//String donVi2 = "2";
if (ha > 0.1 && mode == 'ha') {
giaTri = NumberFormat.decimalPattern().format(ha).toString();
giaTri =
giaTri.endsWith('.0') ? Methods.toInt(giaTri).toString() : giaTri;
donVi1 = 'ha';
//donVi2 = "";
}
var view = Row(
children: [
Text(
giaTri,
style: textStyle,
),
Padding(
padding: const EdgeInsets.only(bottom: 1),
child: Text(
donVi1,
overflow: TextOverflow.ellipsis,
textScaleFactor: 1.0,
style: textStyle,
),
),
],
);
return view;
}