mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 16:54:06 +02:00
26 lines
482 B
Dart
26 lines
482 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class PayingStateController extends ChangeNotifier {
|
|
PayingState state = PayingState.unset;
|
|
|
|
void next() {
|
|
state = switch (state) {
|
|
PayingState.unset => PayingState.loading,
|
|
PayingState.loading => PayingState.done,
|
|
PayingState.done => PayingState.done,
|
|
};
|
|
notifyListeners();
|
|
}
|
|
|
|
void reset() {
|
|
state = PayingState.unset;
|
|
notifyListeners();
|
|
}
|
|
}
|
|
|
|
enum PayingState {
|
|
unset,
|
|
loading,
|
|
done,
|
|
}
|