getMainView method
Implementation
Widget getMainView(Map<String, dynamic> data, String tableName) {
var dataReponse = Methods.getList(data['data'], tableName);
if (dataReponse.isNotEmpty) {
Map<String, Object?> itemSuKien = dataReponse[0];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Methods.getString(itemSuKien, 'title'),
maxLines: 3,
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
const SizedBox(
height: 8,
),
_iconTitle(
icon: ImageByID.getUrlImage(
Methods.getInt(dataReponse[0], 'idIconDiaDiem'),
),
title: Methods.getString(itemSuKien, 'diaDiemToChuc'),
),
if (!Methods.getBool(itemSuKien, 'anSoLuongNguoi')) ...[
const SizedBox(height: 8),
_soLuongNguoiThamGia(itemSuKien, data['data'])
]
],
);
} else {
return const SizedBox.shrink();
}
}