|
|
@ -1,7 +1,6 @@ |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart'; |
|
|
|
import 'package:image_picker/image_picker.dart'; |
|
|
|
import 'package:my_flutter_puzzle/application/states/image_splitter_state.dart'; |
|
|
|
import 'package:my_flutter_puzzle/application/states/puzzle_state.dart'; |
|
|
|
import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart'; |
|
|
@ -43,7 +42,6 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { |
|
|
|
late final RiveAnimationController _riveController; |
|
|
|
bool _puzzleSolved = false; |
|
|
|
bool _isStartPressed = false; |
|
|
|
final _imagePicker = ImagePicker(); |
|
|
|
final double _fontSize = 70.0; |
|
|
|
final double _boardSize = 280.0; |
|
|
|
final int _spacing = 4; |
|
|
@ -82,6 +80,9 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { |
|
|
|
_previousImage = next.image; |
|
|
|
_previousPalette = next.palette; |
|
|
|
}); |
|
|
|
ref.read(puzzleNotifierProvider(_solverClient).notifier).initializePuzzle( |
|
|
|
initialPuzzleData: _initialPuzzleData, |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -102,13 +103,18 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
Visibility( |
|
|
|
visible: !_isStartPressed, |
|
|
|
child: ImageViewer( |
|
|
|
puzzleSize: _puzzleSize, |
|
|
|
previousImage: _previousImage, |
|
|
|
previousPalette: _previousPalette, |
|
|
|
imageSize: 200, |
|
|
|
), |
|
|
|
), |
|
|
|
const SizedBox(height: 32), |
|
|
|
MovesTilesWidget(solverClient: _solverClient, fontSize: 16), |
|
|
|
const SizedBox(height: 32), |
|
|
|
GameButtonWidget( |
|
|
|
solverClient: _solverClient, |
|
|
|
initialPuzzleData: _initialPuzzleData, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
@ -190,7 +196,6 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { |
|
|
|
CountdownWidget( |
|
|
|
isStartPressed: _isStartPressed, |
|
|
|
onFinish: () { |
|
|
|
// ref.read(timerNotifierProvider.notifier).startTimer(); |
|
|
|
BlocProvider.of<CountDownTimerCubit>(context).start(); |
|
|
|
setState(() { |
|
|
|
_isStartPressed = false; |
|
|
@ -198,16 +203,6 @@ class _SoloScreenLargeState extends ConsumerState<PhotoScreenLarge> { |
|
|
|
}, |
|
|
|
initialSpeed: kInitialSpeed, |
|
|
|
), |
|
|
|
Visibility( |
|
|
|
visible: !_isStartPressed, |
|
|
|
child: ImageViewer( |
|
|
|
imagePicker: _imagePicker, |
|
|
|
puzzleSize: _puzzleSize, |
|
|
|
previousImage: _previousImage, |
|
|
|
previousPalette: _previousPalette, |
|
|
|
imageSize: 200, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|