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