Untitled

mail@pastecode.io avatar
unknown
plain_text
13 days ago
2.9 kB
3
Indexable
Never
import 'package:flutter/material.dart';

class GradeRecord extends StatefulWidget {
  const GradeRecord({super.key});

  @override
  State<GradeRecord> createState() => _GradeRecordState();
}

class _GradeRecordState extends State<GradeRecord> {
  var _semName = TextEditingController();
  var _semGrade = TextEditingController();
  var _idController = TextEditingController();
  String _gradeResult = '';

  var _isLoading = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Grade Recorder'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          children: [
            TextFormField(
              keyboardType: TextInputType.name,
              controller: _idController,
              validator: (value) {
                if (value!.isEmpty) {
                  return 'Enter id to update/delete';
                }
              },
              decoration: const InputDecoration(
                hintText: 'Enter id to update/delete',
                border: OutlineInputBorder(),
                labelText: 'Enter id to update/delete',
              ),
            ),
            SizedBox(
              height: 10,
            ),
            TextFormField(
              keyboardType: TextInputType.name,
              controller: _semName,
              validator: (value) {
                if (value!.isEmpty) {
                  return 'Enter Semester';
                }
              },
              decoration: const InputDecoration(
                hintText: 'Enter Semester',
                border: OutlineInputBorder(),
                labelText: 'Enter Semester',
              ),
            ),
            SizedBox(height: 10),
            TextFormField(
              keyboardType: TextInputType.name,
              controller: _semGrade,
              validator: (value) {
                if (value!.isEmpty) {
                  return 'Enter Grade';
                }
              },
              decoration: const InputDecoration(
                  hintText: 'Enter Grade ',
                  border: OutlineInputBorder(),
                  labelText: 'Grade'),
            ),
            Wrap(
              children: [
                OutlinedButton(
                    onPressed: () {
                      //addGrades();
                    },
                    child: Text('Add')),
                SizedBox(width: 10),
                OutlinedButton(onPressed: () {}, child: Text('Update')),
                SizedBox(width: 10),
                OutlinedButton(onPressed: () {}, child: Text('Delete')),
                SizedBox(height: 10),
                SizedBox(width: 10),
              ],
            ),
            Text(_gradeResult),
          ],
        ),
      ),
    );
  }
}
Leave a Comment