You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/core/viewModels/PharmacyPagesViewModel.dart

18 lines
404 B
Dart

import 'package:flutter/cupertino.dart';
class PharmacyPagesViewModel with ChangeNotifier {
int currentTab = 0;
PageController? pageController;
PharmacyPagesViewModel() {
pageController = PageController(keepPage: true);
}
changeCurrentTab(int tab) {
if (pageController!.hasClients) {
currentTab = tab;
pageController!.jumpToPage(tab);
notifyListeners();
}
}
}