diff --git a/app/lib/dashboard/dashboard_page.dart b/app/lib/dashboard/dashboard_page.dart index 99ec03610..02a2ad773 100644 --- a/app/lib/dashboard/dashboard_page.dart +++ b/app/lib/dashboard/dashboard_page.dart @@ -99,7 +99,7 @@ class _DashboardPageState extends State { ), navigationItem: NavigationItem.overview, body: const DashboardPageBody(), - floatingActionButton: _DashboardPageFAB(), + floatingActionButton: const _DashboardPageFAB(), ); } } diff --git a/app/lib/dashboard/widgets/dashboard_fab.dart b/app/lib/dashboard/widgets/dashboard_fab.dart index 7aca1de7a..eccdb1d15 100644 --- a/app/lib/dashboard/widgets/dashboard_fab.dart +++ b/app/lib/dashboard/widgets/dashboard_fab.dart @@ -10,30 +10,10 @@ part of '../dashboard_page.dart'; enum _DashboardFabResult { homework, exam, event, lesson, blackboard } -class _DashboardPageFAB extends StatefulWidget { - @override - _DashboardPageFABState createState() => _DashboardPageFABState(); -} - -class _DashboardPageFABState extends State<_DashboardPageFAB> { - bool open = false; +class _DashboardPageFAB extends StatelessWidget { + const _DashboardPageFAB(); - @override - Widget build(BuildContext context) { - return MatchingTypeOfUserBuilder( - expectedTypeOfUser: TypeOfUser.parent, - matchesTypeOfUserWidget: Container(), - notMatchingWidget: ModalFloatingActionButton( - heroTag: 'sharezone-fab', - tooltip: 'Neue Elemente hinzufügen', - label: 'Hinzufügen', - icon: const Icon(Icons.add), - onPressed: () => openDashboardFabSheet(context), - ), - ); - } - - Future openDashboardFabSheet(BuildContext buildContext) async { + Future openDashboardFabSheet(BuildContext context) async { final analytics = DashboardAnalytics(Analytics(getBackend())); analytics.logOpenFabSheet(); @@ -70,6 +50,21 @@ class _DashboardPageFABState extends State<_DashboardPageFAB> { break; } } + + @override + Widget build(BuildContext context) { + return MatchingTypeOfUserBuilder( + expectedTypeOfUser: TypeOfUser.parent, + matchesTypeOfUserWidget: Container(), + notMatchingWidget: ModalFloatingActionButton( + heroTag: 'sharezone-fab', + tooltip: 'Neue Elemente hinzufügen', + label: 'Hinzufügen', + icon: const Icon(Icons.add), + onPressed: () => openDashboardFabSheet(context), + ), + ); + } } class _DashboardFabSheet extends StatelessWidget {