• 19-03-2026, 05:14:37
    #1
    YAPAY ZEKA İLE HIZLI TABLO YAPMAK İÇİN PROGRAM YAPIYODUM . AMA TABLONUN BELLİ KISMINDAKİ ALT ÇİZGİYİ KALDIRAMADIM .


                 // 1. TABLO: ANA BAŞLIKLAR
                  pw.Table(
                    border: pw.TableBorder.all(width: 0.8),
                    columnWidths: {
                      0: const pw.FixedColumnWidth(siraW),
                      1: const pw.FixedColumnWidth(noktaW),
                      2: const pw.FixedColumnWidth(sabitW),
                      3: const pw.FixedColumnWidth(gunduzW),
                      4: const pw.FixedColumnWidth(notlarW),
                    },
                    children: [
                      pw.TableRow(
                        children: [
                          _cell("SIRA", fontBold, 7, color: PdfColors.red),
                          _cell(
                            "GÖREV\nNOKTASI",
                            fontBold,
                            8,
                            color: PdfColors.red,
                          ),
                          _cell(
                            "SABİT\nÇALIŞAN",
                            fontBold,
                            8,
                            color: PdfColors.red,
                          ),
                          _cell(
                            "GÜNDÜZ GRUBU\n(${_grupBaslikController.text})",
                            fontBold,
                            9,
                            color: PdfColors.red,
                          ),
                          _cell("NOTLAR", fontBold, 8, color: PdfColors.red),
                        ],
                      ),
                    ],
                  ),
                  // 2. TABLO: GENEL VARDİYA SORUMLUSU (BAŞLIKTAN SONRA, VERİDEN ÖNCE)
                  pw.Table(
                    border: pw.TableBorder.all(width: 0.8),
                    columnWidths: {
                      0: const pw.FixedColumnWidth(siraW + noktaW),
                      1: const pw.FixedColumnWidth(sabitW),
                      2: const pw.FixedColumnWidth(gunduzW),
                      3: const pw.FixedColumnWidth(notlarW),
                    },
                    children: [
                      pw.TableRow(
                        children: [
                          _cell(
                            "GENEL VARDİYA SORUMLUSU",
                            fontBold,
                            8,
                            color: PdfColors.blue900,
                          ),
                          _cell("Kudret", fontBold, 9, color: PdfColors.black),
                          _cell("", font, 7),
                          _cell("", font, 7),
                        ],
                      ),
                    ],
                  ),
                  // 3. TABLO: ASIL VERİ LİSTESİ
                  pw.Table(
                    border: pw.TableBorder.all(width: 0.8),
                    columnWidths: {
                      0: const pw.FixedColumnWidth(siraW),
                      1: const pw.FixedColumnWidth(noktaW),
                      2: const pw.FixedColumnWidth(sabitW),
                      3: const pw.FixedColumnWidth(gunduzW / 2),
                      4: const pw.FixedColumnWidth(gunduzW / 2),
                      5: const pw.FixedColumnWidth(notlarW / 2),
                      6: const pw.FixedColumnWidth(notlarW / 2),
                    },
                    children: List.generate(_veriler.length, (i) {
                      String yerHam = _veriler[i]['yer'];
                      bool isSosyalYasam = yerHam == "SOSYAL YAŞAM MERKEZİ";
                      return pw.TableRow(
                        children: [
                          _cell(_veriler[i]['no'], font, 7),
                          _cell(
                            yerHam.replaceAll(" (", "\n("),
                            fontBold,
                            7,
                            color: PdfColors.blue800,
                          ),
                          _cell(_ctrls[i]['sabit']!.text, font, 7),
                          _cell(_ctrls[i]['gunduz']!.text, font, 7),
                          _cell(
                            _ctrls[i]['bosluk']!.text,
                            fontBold,
                            7,
                            color: isSosyalYasam
                                ? PdfColors.blue
                                : PdfColors.blue800,
                          ),
                          _cell(
                            _ctrls[i]['izin']!.text,
                            fontBold,
                            7,
                            color: isSosyalYasam ? PdfColors.blue : PdfColors.black,
                          ),
                          _cell(
                            _ctrls[i]['gorev']!.text,
                            fontBold,
                            7,
                            color: isSosyalYasam ? PdfColors.blue : PdfColors.black,
                          ),
                        ],
                      );
                    }),
                  ),
                ];
              },
            ),
          );
          await Printing.layoutPdf(onLayout: (f) async => pdf.save());
        } catch (e) {
          ScaffoldMessenger.of(
            context,
          ).showSnackBar(SnackBar(content: Text("Hata: $e")));
        }
      }
      pw.Widget _cell(
        String t,
        pw.Font f,
        double s, {
        PdfColor color = PdfColors.black,
      }) => pw.Container(
        alignment: pw.Alignment.center,
        padding: const pw.EdgeInsets.symmetric(vertical: 2, horizontal: 1),
        child: pw.Text(
          t,
          style: pw.TextStyle(font: f, fontSize: s, color: color),
          textAlign: pw.TextAlign.center,
        ),
      );
  • 19-03-2026, 05:54:30
    #2
    Merhaba
    Soldaki tablo Excel ile yapıldıysa Excel to CSV yapın online üzerinden yapabilirsiniz, tablo bozulmazsa CSV dosyasını yapay zekaya verin buna göre ayarlasın
    Eğer problem devam ederse veya CSV dosyası bozuk olursa prompt'u bana atın Opus'a yaptıralım
    Bu arada tablonun tamamen js ile yapılması enteresan, html içinde zaten tablo oluşturmak için tagler var, özel bir sebebi yoksa html ile yapılmasını prompttan belirtin