|
|
|
@ -1,10 +1,12 @@ |
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:gif/gif.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_colors.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_text_style.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/utils/set_platform_size.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/widgets/images/my_image.dart'; |
|
|
|
|
|
|
|
@ -16,6 +18,7 @@ class AnswerPictureBox extends StatelessWidget { |
|
|
|
required this.index, |
|
|
|
required this.correctAnswer, |
|
|
|
this.onTap, |
|
|
|
this.autostart = Autostart.no, |
|
|
|
}); |
|
|
|
|
|
|
|
final bool selected; |
|
|
|
@ -23,6 +26,7 @@ class AnswerPictureBox extends StatelessWidget { |
|
|
|
final int index; |
|
|
|
final int correctAnswer; |
|
|
|
final VoidCallback? onTap; |
|
|
|
final Autostart autostart; |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
@ -41,16 +45,24 @@ class AnswerPictureBox extends StatelessWidget { |
|
|
|
switchInCurve: Curves.linear, |
|
|
|
switchOutCurve: Curves.linear, |
|
|
|
child: selected && (index != correctAnswer) ? |
|
|
|
Image.file( |
|
|
|
Gif( |
|
|
|
key: Key('1'), |
|
|
|
File(image), |
|
|
|
width: context.widthScreen, |
|
|
|
height: context.heightScreen, |
|
|
|
image: FileImage(File(image)), |
|
|
|
fps: 30, |
|
|
|
autostart: autostart, |
|
|
|
fit: BoxFit.cover, |
|
|
|
color: MyColors.black, |
|
|
|
colorBlendMode: BlendMode.color, |
|
|
|
) : |
|
|
|
Image.file( |
|
|
|
Gif( |
|
|
|
key: Key('2'), |
|
|
|
File(image), |
|
|
|
width: context.widthScreen, |
|
|
|
height: context.heightScreen, |
|
|
|
image: FileImage(File(image)), |
|
|
|
fps: 30, |
|
|
|
autostart: autostart, |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
transitionBuilder: (child, animation) => |
|
|
|
|