fix: homework state update on homepage

This commit is contained in:
checkedear
2026-06-11 11:02:29 +02:00
parent 141431f378
commit 1ef6ae6e87
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
import 'package:firka/core/bloc/home_refresh_cubit.dart';
import 'package:firka/ui/phone/widgets/info_card.dart';
import 'package:firka_common/ui/components/filled_circle.dart';
import 'package:firka_common/ui/shared/grade_small_card.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kreta_api/kreta_api.dart';
import 'package:firka/data/models/homework_cache_model.dart';
import 'package:firka/core/extensions.dart';
@@ -493,6 +495,7 @@ Future<void> showHomeworkBottomSheet(
color: appStyle.colors.accent,
),
onTap: () {
context.read<HomeRefreshCubit>().requestRefresh();
Navigator.pop(context);
!done
? markAsDone(data.isar, homework.uid)

View File

@@ -50,7 +50,7 @@ class _HomeMainScreen extends FirkaState<HomeMainScreen> {
void _onRefreshRequested(BuildContext context) async {
final cubit = context.read<HomeRefreshCubit>();
await fetchData(cacheOnly: false);
setState(() {});
if (mounted) {
cubit.onRefreshComplete();
}