Fix UI issues in Dashboard and Student screens

This commit is contained in:
ssbg04 committed 2026-07-22 16:00:54 +08:00
1 parent 6b8e1da0fc
commit b69908fb67
3 files changed
+10 -26

No files matched your search

@@ -688,7 +688,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
crossAxisCount: crossAxisCount,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
mainAxisExtent: isSquare ? 115 : 85,
mainAxisExtent: isSquare ? 135 : 85,
),
children: [
StatCard(
@@ -82,6 +82,7 @@ class _StudentsScreenState extends ConsumerState<StudentsScreen> {
final currentQuery = ref.read(studentQueryProvider).search;
if (_searchController.text != currentQuery) {
_searchController.text = currentQuery;
if (mounted) setState(() {});
}
}
});
@@ -254,28 +255,7 @@ class _StudentsScreenState extends ConsumerState<StudentsScreen> {
);
}
Widget _batchActionBtn({
required IconData icon,
required String label,
required Color color,
required VoidCallback onTap,
}) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, color: color, size: 22),
const SizedBox(height: 4),
Text(label, style: TextStyle(color: color, fontSize: 11, fontWeight: FontWeight.bold)),
],
),
),
);
}
void _showBulkEnrollModal() {
showDialog(
@@ -73,7 +73,12 @@ class _AppSearchBarState extends ConsumerState<AppSearchBar> {
void _onTextChanged() {
final hasText = _controller.text.isNotEmpty;
if (hasText != _hasText) setState(() => _hasText = hasText);
if (hasText != _hasText) {
setState(() {
_hasText = hasText;
if (hasText) _isExpanded = true;
});
}
// Update overlay if history is visible
if (_overlayEntry != null && widget.enableHistory) {
@@ -273,9 +278,8 @@ class _AppSearchBarState extends ConsumerState<AppSearchBar> {
widget.onSubmitted?.call('');
setState(() {
_hasText = false;
_isExpanded = true;
});
_focusNode.requestFocus();
_focusNode.unfocus();
},
)
: null,