10 changed files with 227 additions and 109 deletions
-
2lib/core/routers/hero_dialog_route.dart
-
39lib/core/widgets/animations/fade_anim_controller.dart
-
5lib/core/widgets/answer_box/answer_box.dart
-
4lib/core/widgets/answer_box/answer_box_show.dart
-
5lib/core/widgets/answer_box/styles/picture_box.dart
-
2lib/features/question/domain/entity/question_entity.dart
-
67lib/features/question/presentation/bloc/question_bloc.dart
-
6lib/features/question/presentation/ui/screens/answer_screen.dart
-
76lib/features/question/presentation/ui/screens/question_screen.dart
-
2pubspec.yaml
@ -0,0 +1,39 @@ |
|||
import 'package:flutter/material.dart'; |
|||
|
|||
class FadeAnimController extends StatefulWidget { |
|||
const FadeAnimController({ |
|||
super.key, |
|||
required this.child, |
|||
required this.controller, |
|||
}); |
|||
|
|||
final Widget child; |
|||
final AnimationController controller; |
|||
|
|||
@override |
|||
State<FadeAnimController> createState() => _FadeAnimControllerState(); |
|||
} |
|||
|
|||
class _FadeAnimControllerState extends State<FadeAnimController> |
|||
with SingleTickerProviderStateMixin { |
|||
late Animation<double> _animation; |
|||
|
|||
@override |
|||
void initState() { |
|||
super.initState(); |
|||
_animation = Tween<double>( |
|||
begin: 0, |
|||
end: 1, |
|||
).animate(CurvedAnimation(parent: widget.controller, curve: Curves.linear)); |
|||
} |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return AnimatedBuilder( |
|||
animation: widget.controller, |
|||
child: widget.child, |
|||
builder: (context, child) => |
|||
FadeTransition(opacity: _animation, child: child), |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue