mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 00:34:06 +02:00
18 lines
358 B
Dart
18 lines
358 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
enum PageSelector { homePage, productsPage, cartPage, receiptsPage }
|
|
|
|
class Routing extends ChangeNotifier {
|
|
int currentIndex = 0;
|
|
|
|
void routeTo(PageSelector page) {
|
|
currentIndex = page.index;
|
|
notifyListeners();
|
|
}
|
|
|
|
void routeToIndex(int index) {
|
|
currentIndex = index;
|
|
notifyListeners();
|
|
}
|
|
}
|