Untitled

 avatar
unknown
plain_text
a year ago
2.9 kB
6
Indexable
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),
          ],
        ),
      ),
    );
  }
}
Editor is loading...
Leave a Comment