Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. class AlphabetPage extends StatefulWidget {
  2. @override
  3. _AlphabetPageState createState() => _AlphabetPageState();
  4. }
  5.  
  6. class _AlphabetPageState extends State<AlphabetPage> {
  7.  
  8.  
  9. testing(){
  10. GestureDetector(
  11. onTap: (){
  12. play('a');
  13. },
  14. child: Container(
  15.  
  16. color: Colors.white,
  17. margin: EdgeInsets.fromLTRB(15, 10, 0, 0),
  18. child: Image(image: AssetImage('images/a.jpg'),
  19. height: 60,
  20. width: 60,
  21.  
  22. ),
  23.  
  24. ),
  25. );
  26. }
  27. play(a){
  28. final player = AudioCache();
  29. player.play('$a.wav');
  30. }
  31.  
  32. @override
  33. Widget build(BuildContext context) {
  34. return MaterialApp(
  35. home: Scaffold(
  36. appBar: AppBar(
  37. backgroundColor: Colors.purple,
  38. automaticallyImplyLeading: true,
  39. //`true` if you want Flutter to automatically add Back Button when needed,
  40. //or `false` if you want to force your own back button every where
  41. title: Text('Alphabet Sounds'),
  42. leading: IconButton(
  43. icon: Icon(Icons.arrow_back),
  44. onPressed: () => Navigator.pop(context, false),
  45. ),
  46. ),
  47. body: Column(children: <Widget>[
  48. Row(
  49. //ROW 1
  50. children: [
  51. testing(),
  52. testing(),
  53. ],
  54. ),
  55. ],
  56. ),
  57. ),
  58. );
  59.  
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement