After deleting the recorded data from the screen, when I focus on the TextFormField field in the form that appears, the keyboard closes and the accordion becomes closed? I have researched a lot, what do you think is the problem? I would be very happy if you could help. The screen video link is below.
` import 'package:accordion/accordion.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:plan/controller/school_setting_controller.dart'; import 'package:plan/utils/constants/colors.dart'; import 'package:plan/widgets/template.dart/custom_appbar.dart'; import 'package:plan/widgets/template.dart/custom_card.dart'; import 'package:plan/widgets/template.dart/form/custom_dropdown_button_form_field.dart'; import 'package:plan/widgets/template.dart/form/custom_elevated_button.dart'; import 'package:plan/widgets/template.dart/form/custom_text_form_field.dart';
class GeneralSettingScreen extends StatelessWidget { const GeneralSettingScreen({super.key});
static const double headerLeftIconSize = 28; static const double headerRightIconSize = 33; static const double headerPaddingVertical = 16.0; static const double headerPaddingHorizontal = 14.0; static const Color leftIconColor = PlanColors.light; static const Color rightIconColor = PlanColors.light; static const Color headerTextColor = Colors.white; static const Color contentBorderColor = Colors.transparent; static const Color headerBackgroundColor = PlanColors.bgDark; static const Color contentBackgroundColor = PlanColors.light; @override Widget build(BuildContext context) { final GlobalKey formKey = GlobalKey();
} } `
Controller page : ` import 'package:get/get.dart'; import 'package:plan/local_database.dart'; import 'package:plan/model/school_model.dart'; import 'package:plan/widgets/template.dart/custom_snackbar.dart';
class SchoolSettingController extends GetxController { RxString schoolName = ''.obs; RxString classroom = ''.obs; List schoolList = [];
@override void onInit() { getSchool(); super.onInit(); }
Future setSchoolList(List value) async {
schoolList = value;
update();
}
Future setSchool(String value) async {
schoolName.value = value;
}
Future setClassroom(String value) async {
classroom.value = value;
}
Future createSchool() async {
try {
final school = SchoolModel(
name: schoolName.value,
classroom: classroom.value,
);
final result = await LocalDatabase().createSchool(school);
if (result != -1) {
CustomSnackBar.show(
title: 'Başarılı',
message: 'Okul ayarları oluşturuldu',
state: SnackState.SUCCESS,
);
} else {
CustomSnackBar.show(
title: 'HATA!',
message: 'Okul ayarları oluşturulamadı',
state: SnackState.ERROR,
);
}
update();
} catch (e) {
print(e);
}
}
Future getSchool() async {
try {
final school = await LocalDatabase().getSchool();
if (school.isNotEmpty) {
schoolList = school;
update();
}
} catch (e) {
print(e);
}
}
Future deleteSchool(int id) async {
try {
final result = await LocalDatabase().deleteSchool(id);
if (result != -1) {
schoolList = [];
/setSchool('');
setClassroom('');/
CustomSnackBar.show(
title: 'Başarılı',
message: 'Okul ayarları silindi',
state: SnackState.SUCCESS,
);
} else {
CustomSnackBar.show(
title: 'HATA!',
message: 'Okul ayarları silindi',
state: SnackState.ERROR,
);
}
update();
} catch (e) {
print(e);
}
}
}
`
After deleting the recorded data from the screen, when I focus on the TextFormField field in the form that appears, the keyboard closes and the accordion becomes closed? I have researched a lot, what do you think is the problem? I would be very happy if you could help. The screen video link is below.
https://github.com/user-attachments/assets/7ca38bdf-0b9f-4682-b04e-162dcdcf8d01