mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 08:44:06 +02:00
16 lines
375 B
Dart
16 lines
375 B
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class AddToCartStateRepo extends ChangeNotifier {
|
|
int currentAmount = 0;
|
|
Timer resetTimer = Timer(const Duration(), () {});
|
|
|
|
void notify(Duration displayDuration) {
|
|
resetTimer.cancel();
|
|
currentAmount++;
|
|
notifyListeners();
|
|
resetTimer = Timer(displayDuration, () => currentAmount = 0);
|
|
}
|
|
}
|