Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AlphabetPage extends StatefulWidget {
- @override
- _AlphabetPageState createState() => _AlphabetPageState();
- }
- class _AlphabetPageState extends State<AlphabetPage> {
- testing(){
- GestureDetector(
- onTap: (){
- play('a');
- },
- child: Container(
- color: Colors.white,
- margin: EdgeInsets.fromLTRB(15, 10, 0, 0),
- child: Image(image: AssetImage('images/a.jpg'),
- height: 60,
- width: 60,
- ),
- ),
- );
- }
- play(a){
- final player = AudioCache();
- player.play('$a.wav');
- }
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.purple,
- automaticallyImplyLeading: true,
- //`true` if you want Flutter to automatically add Back Button when needed,
- //or `false` if you want to force your own back button every where
- title: Text('Alphabet Sounds'),
- leading: IconButton(
- icon: Icon(Icons.arrow_back),
- onPressed: () => Navigator.pop(context, false),
- ),
- ),
- body: Column(children: <Widget>[
- Row(
- //ROW 1
- children: [
- testing(),
- testing(),
- ],
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement