delete function implemented on pressed -> pop up => are you sure about that? yes: all rating from all pages will be cleared no: nothing happens, pop closes
29 lines
562 B
Dart
29 lines
562 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class EssenProvider extends ChangeNotifier {
|
|
double ratingGeschmack = 0;
|
|
double ratingQuali = 0;
|
|
String freiText = "";
|
|
|
|
void setRatingGeschmack(double rating) {
|
|
ratingGeschmack = rating;
|
|
notifyListeners();
|
|
}
|
|
|
|
void setRatingQuali(double rating) {
|
|
ratingQuali = rating;
|
|
notifyListeners();
|
|
}
|
|
|
|
void setFreiText(String text) {
|
|
freiText = text;
|
|
notifyListeners();
|
|
}
|
|
|
|
void resetAllFields(){
|
|
freiText = "";
|
|
ratingGeschmack = 0;
|
|
ratingQuali = 0;
|
|
notifyListeners();
|
|
}
|
|
} |