23 lines
527 B
Dart
23 lines
527 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:smoke_cess_app/services/pages_service.dart';
|
|
|
|
class PageProvider extends ChangeNotifier {
|
|
bool showForm = false;
|
|
Pages _currentPage = Pages.settings;
|
|
|
|
void swap() {
|
|
showForm = !showForm;
|
|
notifyListeners();
|
|
}
|
|
|
|
Map<String, dynamic> get currentPageData => pages[_currentPage]!;
|
|
|
|
int get currentPageIndex => _currentPage.index;
|
|
|
|
void setCurrentPage(int index) {
|
|
showForm = false;
|
|
_currentPage = Pages.values[index];
|
|
notifyListeners();
|
|
}
|
|
}
|