import 'package:fikoyt_hmi_pano/apps/widgets/screen_1/controller/screen.controller.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:flutter/material.dart'; class NoDeviceWidget extends StatefulWidget { const NoDeviceWidget({super.key}); @override _NoDeviceWidgetState createState() => _NoDeviceWidgetState(); } class _NoDeviceWidgetState extends State { late final Screen1Controller screenLogic; @override void initState() { screenLogic = Get.put(Screen1Controller()); super.initState(); } @override Widget build(BuildContext context) { return Container( constraints: const BoxConstraints(maxWidth: double.infinity, maxHeight: double.infinity), width: 350, // height: height ?? double.infinity, // height: 450, // margin: const EdgeInsets.all(2.0), // padding: const EdgeInsets.all(5.0), clipBehavior: Clip.hardEdge, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.0), border: Border.all( color: Colors.grey.shade300, width: 1, style: BorderStyle.solid, ), ), child: Column( children: [ FikoYTButton( text: "Kart Okuyucu Seç", tema: FikoYTButtonTheme(textAlign: TextAlign.center, fontSize: 16, fontWeight: FontWeight.bold, textColor: Theme.of(context).extension()?.textColor, textShadow: [ Shadow( blurRadius: 1, color: Theme.of(context).extension()?.shadowColor ?? Colors.black54, ), ]), ), Divider( height: 3, ), Obx( () => ListView.builder( shrinkWrap: true, padding: EdgeInsets.all(10), itemCount: screenLogic.cardReaderList.length, itemBuilder: (context, index) => FikoYTButton( text: screenLogic.cardReaderList[index]?["info"]?["settings"]?["label"] ?? "İsim Verilmemiş", tema: FikoYTButtonTheme( textAlign: TextAlign.center, fontSize: 14, // fontWeight: FontWeight.bold, textColor: Theme.of(context).extension()?.textColor, borderColor: Colors.blue, elevation: 3, ), onPressed: () { // FikoYT.uyar.devices.device.setCardReader FikoYTCoreService.socket.emitWithAck("FikoYT.uyar.devices.device.setCardReader", {"deviceUuid": screenLogic.deviceInfo.value?["info"]?["uuid"], "readerUuid": screenLogic.cardReaderList[index]?["info"]?["uuid"]}, ack: (data) async { print(data); }); }, ), ), ), ], ), ); } }