Added PageProvider

main
Kai Mannweiler 2023-03-03 12:48:19 +01:00
parent 1566f5c92a
commit 6e9f213cdc
2 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smoke_cess_app/providers/page_provider.dart';
import 'package:smoke_cess_app/providers/tasks_provider.dart';
import 'package:smoke_cess_app/services/pages_service.dart';
import 'package:smoke_cess_app/providers/settings_provider.dart';
@ -40,9 +41,11 @@ class MyHomePageState extends State<MyHomePage> {
appBar: AppBar(
title: Text(
'${pages.values.elementAt(_selectedIndex)['title']} ${_isConfigured ? "Gruppe ${settingsModel.settings?.group}" : ""}')),
body: Center(
child: SingleChildScrollView(
child: pages.values.elementAt(_selectedIndex)['page'])),
body: SingleChildScrollView(
child: ChangeNotifierProvider(
create: (context) => PageProvider(),
child: pages.values.elementAt(_selectedIndex)['page'],
)),
bottomNavigationBar: NavigationBar(
onDestinationSelected: _onItemTapped,
selectedIndex: _selectedIndex,

View File

@ -0,0 +1,10 @@
import 'package:flutter/material.dart';
class PageProvider extends ChangeNotifier {
bool showForm = false;
void swap() {
showForm = !showForm;
notifyListeners();
}
}