Split into multiple files

This commit is contained in:
2025-05-03 00:25:11 +02:00
parent 88f0b8d4d1
commit d9e66711e4
5 changed files with 147 additions and 85 deletions

View File

@@ -0,0 +1,23 @@
library;
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';
class MyAppState extends ChangeNotifier {
var current = WordPair.random();
var favourites = <WordPair>[];
void getNext() {
current = WordPair.random();
notifyListeners();
}
void toggleFavourites() {
if (favourites.contains(current)) {
favourites.remove(current);
} else {
favourites.add(current);
}
notifyListeners();
}
}