Last active
April 22, 2021 10:14
-
-
Save suragch/558e7a24d7432a5a9d396bcda48693e5 to your computer and use it in GitHub Desktop.
Playing short audio clips in Flutter with Just Audio (setup)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => _MyAppState(); | |
} | |
class _MyAppState extends State<MyApp> { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
body: Center( | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
ElevatedButton( | |
onPressed: () { | |
// TODO: cow button | |
}, | |
child: Text('Cow'), | |
), | |
SizedBox(width: 10), | |
ElevatedButton( | |
onPressed: () { | |
// TODO: horse button | |
}, | |
child: Text('Horse'), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment