You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.5 KiB

2 years ago
  1. import 'package:flutter_riverpod/flutter_riverpod.dart';
  2. import 'package:my_flutter_puzzle/application/notifiers/image_splitter_notifier.dart';
  3. import 'package:my_flutter_puzzle/application/notifiers/login_register_notifier.dart';
  4. import 'package:my_flutter_puzzle/application/notifiers/puzzle_notifier.dart';
  5. import 'package:my_flutter_puzzle/application/notifiers/puzzle_type_notifier.dart';
  6. import 'package:my_flutter_puzzle/application/states/image_splitter_state.dart';
  7. import 'package:my_flutter_puzzle/application/states/puzzle_state.dart';
  8. import 'package:my_flutter_puzzle/utils/image_splitter.dart';
  9. import 'package:my_flutter_puzzle/utils/puzzle_solver.dart';
  10. import 'application/notifiers/timer_notifier.dart';
  11. final imageSplitterProvider = Provider<ImageSplitter>((ref) => ImageSplitter());
  12. final puzzleNotifierProvider = StateNotifierProvider.family<PuzzleNotifier, PuzzleState, PuzzleSolverClient>(
  13. (ref, solverClient) => PuzzleNotifier(solverClient),
  14. );
  15. final imageSplitterNotifierProvider = StateNotifierProvider<ImageSplitterNotifier, ImageSplitterState>(
  16. (ref) => ImageSplitterNotifier(
  17. ref.watch(imageSplitterProvider),
  18. ),
  19. );
  20. final timerNotifierProvider = StateNotifierProvider<TimerNotifier, String>(
  21. ((ref) => TimerNotifier()),
  22. );
  23. final puzzleTypeNotifierProvider = StateNotifierProvider<PuzzleTypeNotifier, PuzzleType>(
  24. (ref) => PuzzleTypeNotifier(),
  25. );
  26. final isLoginNotifier = StateNotifierProvider<IsLoginNotifier, bool>(
  27. (ref) => IsLoginNotifier(),
  28. );