import 'package:flutter/material.dart'; class AirManualSampling extends StatefulWidget { @override State createState() => _AirManualSamplingState(); } class _AirManualSamplingState extends State { final _formKey = GlobalKey(); String station = ''; String parameter = ''; String value = ''; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Air Manual Sampling")), body: Padding( padding: const EdgeInsets.all(24), child: Form( key: _formKey, child: ListView( children: [ Text("Enter Sampling Data", style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), SizedBox(height: 24), TextFormField( decoration: InputDecoration(labelText: "Station"), onChanged: (val) => station = val, validator: (val) => val == null || val.isEmpty ? "Required" : null, ), SizedBox(height: 16), TextFormField( decoration: InputDecoration(labelText: "Parameter"), onChanged: (val) => parameter = val, validator: (val) => val == null || val.isEmpty ? "Required" : null, ), SizedBox(height: 16), TextFormField( decoration: InputDecoration(labelText: "Value"), keyboardType: TextInputType.number, onChanged: (val) => value = val, validator: (val) => val == null || val.isEmpty ? "Required" : null, ), SizedBox(height: 24), ElevatedButton( onPressed: () { if (_formKey.currentState!.validate()) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text("Air sampling data submitted")), ); } }, child: Text("Submit"), ), ], ), ), ), ); } }