Added PageProvider
parent
1566f5c92a
commit
6e9f213cdc
|
@ -1,6 +1,7 @@
|
||||||
import 'package:awesome_dialog/awesome_dialog.dart';
|
import 'package:awesome_dialog/awesome_dialog.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.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/providers/tasks_provider.dart';
|
||||||
import 'package:smoke_cess_app/services/pages_service.dart';
|
import 'package:smoke_cess_app/services/pages_service.dart';
|
||||||
import 'package:smoke_cess_app/providers/settings_provider.dart';
|
import 'package:smoke_cess_app/providers/settings_provider.dart';
|
||||||
|
@ -40,9 +41,11 @@ class MyHomePageState extends State<MyHomePage> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(
|
title: Text(
|
||||||
'${pages.values.elementAt(_selectedIndex)['title']} ${_isConfigured ? "Gruppe ${settingsModel.settings?.group}" : ""}')),
|
'${pages.values.elementAt(_selectedIndex)['title']} ${_isConfigured ? "Gruppe ${settingsModel.settings?.group}" : ""}')),
|
||||||
body: Center(
|
body: SingleChildScrollView(
|
||||||
child: SingleChildScrollView(
|
child: ChangeNotifierProvider(
|
||||||
child: pages.values.elementAt(_selectedIndex)['page'])),
|
create: (context) => PageProvider(),
|
||||||
|
child: pages.values.elementAt(_selectedIndex)['page'],
|
||||||
|
)),
|
||||||
bottomNavigationBar: NavigationBar(
|
bottomNavigationBar: NavigationBar(
|
||||||
onDestinationSelected: _onItemTapped,
|
onDestinationSelected: _onItemTapped,
|
||||||
selectedIndex: _selectedIndex,
|
selectedIndex: _selectedIndex,
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PageProvider extends ChangeNotifier {
|
||||||
|
bool showForm = false;
|
||||||
|
|
||||||
|
void swap() {
|
||||||
|
showForm = !showForm;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue