kalfalarinOmer Widget squareScrollCardWidget(
//Kare Widget(activities-water sports vb.)
{required String squareCardTitle,
required String? squareCardImageUrl,
required Widget? squareCardButton,
String squareCardWidgetId = '123456',
required BuildContext context}) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: isDarkTheme == true ? Colors.grey.shade800 : Colors.white),
onPressed: () {
Get.to(squareCardButton);
},
child: SizedBox(
width: MediaQuery.of(context).size.width / 1.5,
height: MediaQuery.of(context).size.width / 2.2,
// height: MediaQuery.of(context).size.height / 1.5,
child: Column(children: [
squareCardImageUrl == null
? Image.asset("assets/images/square.png")
: Image.network(squareCardImageUrl),
SizedBox(
height: 3,
),
Text(
squareCardTitle,
style: TextStyle(
fontSize: 18,
color: isDarkTheme == false ? Colors.black : Colors.white),
),
]),
),
);
FutureBuilder<List<GetHotelServicesWithDeviceIDModel>>(
future: _getHotelServices,
builder: ((context, snapshot) {
var dataList = snapshot.data;
if (snapshot.hasData) {
return SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 3,
child: ListView.builder(
scrollDirection: Axis.vertical,
controller: ScrollController(keepScrollOffset: true),
itemCount: dataList![0].subTenantServices!.length,
itemBuilder: (context, index) {
debugPrint(index.toString());
return squareScrollCardWidget(
squareCardTitle:
dataList[0].subTenantServices![index].name,
squareCardImageUrl:
dataList[0].subTenantServices![index].img[0].path,
squareCardButton:
SquareChoosePage(chooseIndex: index),
context: context);
},
),
);
} else {
return const Center(child: CircularProgressIndicator());
}