7 changed files with 68 additions and 18 deletions
-
5lib/core/widgets/button/my_blue_button.dart
-
3lib/core/widgets/button/my_yellow_button.dart
-
4lib/core/widgets/dialog/about_us_dialog.dart
-
3lib/core/widgets/dialog/styles/dialog_button.dart
-
55lib/core/widgets/inkwell/my_inkwell.dart
-
9lib/features/home/presentation/bloc/home_bloc.dart
-
7lib/features/home/presentation/ui/home_page.dart
@ -0,0 +1,55 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:hadi_hoda_flutter/common_ui/resources/my_audios.dart'; |
|||
import 'package:hadi_hoda_flutter/core/constants/my_constants.dart'; |
|||
import 'package:hadi_hoda_flutter/core/services/audio_service.dart'; |
|||
import 'package:hadi_hoda_flutter/init_bindings.dart'; |
|||
|
|||
class MyInkwell extends StatefulWidget { |
|||
const MyInkwell({ |
|||
super.key, |
|||
this.onTap, |
|||
this.child, |
|||
this.borderRadius, |
|||
this.highlightColor, |
|||
this.splashColor, |
|||
}); |
|||
|
|||
final VoidCallback? onTap; |
|||
final Widget? child; |
|||
final BorderRadius? borderRadius; |
|||
final Color? highlightColor; |
|||
final Color? splashColor; |
|||
|
|||
@override |
|||
State<MyInkwell> createState() => _MyInkwellState(); |
|||
} |
|||
|
|||
class _MyInkwellState extends State<MyInkwell> { |
|||
final AudioService audioService = locator( |
|||
instanceName: MyConstants.effectAudioService, |
|||
); |
|||
|
|||
@override |
|||
void initState() { |
|||
super.initState(); |
|||
} |
|||
|
|||
void playAudio() { |
|||
audioService.setAudio(assetPath: MyAudios.clickButton); |
|||
audioService.play(); |
|||
} |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return InkWell( |
|||
onTap: () { |
|||
playAudio(); |
|||
widget.onTap?.call(); |
|||
}, |
|||
borderRadius: widget.borderRadius, |
|||
highlightColor: widget.highlightColor, |
|||
splashColor: widget.splashColor, |
|||
child: widget.child, |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue