28 changed files with 408 additions and 147 deletions
-
1assets/animations/Celebration.json
-
3devtools_options.yaml
-
4lib/core/constants/my_api.dart
-
7lib/core/constants/my_constants.dart
-
2lib/core/middlewares/my_middlewares.dart
-
2lib/core/routers/hero_dialog_route.dart
-
21lib/core/services/audio_service.dart
-
102lib/core/widgets/animations/globe_animation.dart
-
26lib/core/widgets/animations/slide_anim.dart
-
2lib/core/widgets/showcase/my_showcase_widget.dart
-
2lib/features/download/presentation/bloc/download_bloc.dart
-
2lib/features/home/presentation/bloc/home_bloc.dart
-
6lib/features/level/data/model/level_model.dart
-
4lib/features/level/domain/entity/level_entity.dart
-
7lib/features/level/domain/entity/level_entity.g.dart
-
32lib/features/level/presentation/ui/level_page.dart
-
20lib/features/question/data/model/question_model.dart
-
2lib/features/question/domain/entity/answer_entity.dart
-
53lib/features/question/domain/entity/asdasd.json
-
29lib/features/question/domain/entity/question_entity.dart
-
39lib/features/question/domain/entity/question_entity.g.dart
-
60lib/features/question/presentation/bloc/question_bloc.dart
-
4lib/features/question/presentation/bloc/question_state.dart
-
18lib/features/question/presentation/ui/screens/answer_screen.dart
-
87lib/features/question/presentation/ui/screens/question_screen.dart
-
9lib/features/sample/presentation/ui/sample_page.dart
-
8pubspec.lock
-
3pubspec.yaml
1
assets/animations/Celebration.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,3 +0,0 @@ |
|||
description: This file stores settings for Dart & Flutter DevTools. |
|||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states |
|||
extensions: |
|||
@ -0,0 +1,102 @@ |
|||
import 'dart:async'; |
|||
|
|||
import 'package:flutter/material.dart'; |
|||
import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart'; |
|||
|
|||
class GlobeAnimation extends StatefulWidget { |
|||
const GlobeAnimation({super.key, required this.child, this.state = true}); |
|||
|
|||
final Widget child; |
|||
final bool state; |
|||
|
|||
@override |
|||
State<GlobeAnimation> createState() => _GlobeAnimationState(); |
|||
} |
|||
|
|||
class _GlobeAnimationState extends State<GlobeAnimation> |
|||
with SingleTickerProviderStateMixin { |
|||
Timer? _timer; |
|||
Gradient? _gradient; |
|||
late AnimationController _controller; |
|||
late Animation<double> _animation; |
|||
|
|||
@override |
|||
void initState() { |
|||
super.initState(); |
|||
_controller = AnimationController( |
|||
vsync: this, |
|||
duration: Duration(seconds: 1), |
|||
reverseDuration: Duration(seconds: 1), |
|||
); |
|||
_animation = Tween<double>( |
|||
begin: 1, |
|||
end: 1.05, |
|||
).animate(CurvedAnimation(parent: _controller, curve: Curves.linear)); |
|||
} |
|||
|
|||
@override |
|||
void didUpdateWidget(covariant GlobeAnimation oldWidget) { |
|||
super.didUpdateWidget(oldWidget); |
|||
if (widget.state) { |
|||
_controller.repeat(reverse: true); |
|||
_timer = Timer.periodic(Duration(seconds: 1), (timer) { |
|||
if (_gradient == null) { |
|||
setState(() { |
|||
_gradient = RadialGradient( |
|||
colors: [ |
|||
Color(0XFFDFCD00), |
|||
Color(0XFFDFCD00).withValues(alpha: 0.35), |
|||
Color(0XFFDFCD00).withValues(alpha: 0), |
|||
], |
|||
center: Alignment.center, |
|||
); |
|||
}); |
|||
} else { |
|||
setState(() { |
|||
_gradient = null; |
|||
}); |
|||
} |
|||
}); |
|||
} else { |
|||
_timer?.cancel(); |
|||
_timer = null; |
|||
_controller.stop(); |
|||
setState(() { |
|||
_gradient = RadialGradient( |
|||
colors: [ |
|||
Color(0XFFDFCD00).withValues(alpha: 0), |
|||
Color(0XFFDFCD00).withValues(alpha: 0), |
|||
Color(0XFFDFCD00).withValues(alpha: 0), |
|||
], |
|||
center: Alignment.center, |
|||
); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
@override |
|||
void dispose() { |
|||
_timer?.cancel(); |
|||
_timer = null; |
|||
_controller.dispose(); |
|||
super.dispose(); |
|||
} |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return AnimatedBuilder( |
|||
animation: _controller, |
|||
child: widget.child, |
|||
builder: (context, child) => ScaleTransition( |
|||
scale: _animation, |
|||
alignment: Alignment.center, |
|||
child: AnimatedContainer( |
|||
duration: const Duration(milliseconds: 500), |
|||
padding: EdgeInsets.all(MySpaces.s0), |
|||
decoration: BoxDecoration(gradient: _gradient), |
|||
child: child, |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
{ |
|||
"result": [ |
|||
{ |
|||
"id": 73, |
|||
"order": 1, |
|||
"title": "Stage One", |
|||
"questions": [ |
|||
{ |
|||
"id": 594, |
|||
"title": "Hadi and Morteza are playing soccer in the yard. Hadi kicks the ball hard, and it goes over the neighbor's wall. Hadi gets a ladder to climb up, but Morteza says, \"Wait! We should ask for permission first.\" Hadi climbs up anyway to get the ball. Suddenly, he sees the neighbor looking right at him! What should Hadi do?", |
|||
"audio_id": "31775a6d74", |
|||
"audio_info": { |
|||
"filename": "level_01_question_01_en.mp3", |
|||
"size": 352802, |
|||
"extension": ".mp3" |
|||
}, |
|||
"order": 1, |
|||
"correct_answer": 3, |
|||
"correct_answer_text": "That is correct! Great job!", |
|||
"correct_answer_audio_id": "9d89be8fd6", |
|||
"correct_answer_audio_info": { |
|||
"filename": "level_01_question_01_correct_en.mp3", |
|||
"size": 31391, |
|||
"extension": ".mp3" |
|||
}, |
|||
"hadiths": [], |
|||
"is_active": true, |
|||
"answers": [ |
|||
{ |
|||
"id": 2335, |
|||
"title": "Tell Morteza, \"Come up here! Look, the neighbor is eating chicken!\"", |
|||
"image_id": "7eb7047f81", |
|||
"image_info": { |
|||
"filename": "level_01_question_01_answer_01_image.jpg", |
|||
"size": 190516, |
|||
"extension": ".jpg" |
|||
}, |
|||
"audio_id": "9a3c564d47", |
|||
"audio_info": { |
|||
"filename": "level_01_question_01_answer_01_en.mp3", |
|||
"size": 74859, |
|||
"extension": ".mp3" |
|||
}, |
|||
"order": 1, |
|||
"is_active": true |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
], |
|||
"levels_count": 5 |
|||
} |
|||
@ -1,10 +1,17 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:lottie/lottie.dart'; |
|||
|
|||
class SamplePage extends StatelessWidget { |
|||
const SamplePage({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return const Scaffold(); |
|||
return Scaffold( |
|||
body: Center( |
|||
child: Lottie.asset( |
|||
'assets/animations/Celebration.json', |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue