import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import '../controllers/kebun_controller.dart';

class KebunView extends GetView<KebunController> {
  const KebunView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: Text(
          'Tambah Kebun',
          style: GoogleFonts.poppins(
            fontSize: 18,
            fontWeight: FontWeight.bold,
            color: Colors.white,
          ),
        ),
        centerTitle: true,
        backgroundColor: Colors.green,
        elevation: 0,
        automaticallyImplyLeading: true,
        iconTheme: const IconThemeData(
          color: Colors.white,
        ),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: ListView(
          children: [
            TextField(
              controller: controller.namaKebunC,
              decoration: const InputDecoration(
                labelText: 'Nama Kebun',
                border: OutlineInputBorder(),
              ),
            ),
            const SizedBox(height: 16),
            TextField(
              controller: controller.alamatC,
              decoration: const InputDecoration(
                labelText: 'Alamat',
                border: OutlineInputBorder(),
              ),
            ),
            const SizedBox(height: 16),
            TextField(
              controller: controller.tanamanC,
              decoration: const InputDecoration(
                labelText: 'Tanaman',
                border: OutlineInputBorder(),
              ),
            ),
            const SizedBox(height: 16),
            TextField(
              controller: controller.namaPetaniC,
              decoration: const InputDecoration(
                labelText: 'Nama Petani',
                border: OutlineInputBorder(),
              ),
            ),
            const SizedBox(height: 32),
            ElevatedButton(
  onPressed: controller.simpanKebun,
  style: ElevatedButton.styleFrom(
    backgroundColor: Colors.green, // warna background
    foregroundColor: Colors.white, // warna teks
  ),
  child: const Text('Simpan'),
),

          ],
        ),
      ),
    );
  }
}
