Files
sendico/frontend/pweb/lib/pages/dashboard/buttons/balance/controller.dart
2026-01-22 18:17:41 +01:00

22 lines
407 B
Dart

import 'package:flutter/foundation.dart';
class CarouselIndexController with ChangeNotifier {
int _index = 0;
int get index => _index;
void setIndex(int value, int max) {
final next = value.clamp(0, max > 0 ? max - 1 : 0);
if (next == _index) return;
_index = next;
notifyListeners();
}
void reset() {
if (_index == 0) return;
_index = 0;
notifyListeners();
}
}