-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
104 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
void showShackBar(BuildContext context, String msg) { | ||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg))); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:learn_flutter/common/commons.dart'; | ||
import 'package:logger/logger.dart'; | ||
|
||
final logger = Logger(); | ||
|
||
class AudioPlayerRoute extends StatelessWidget { | ||
const AudioPlayerRoute({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
theme: ThemeData( | ||
colorSchemeSeed: const Color(0xff6750a4), | ||
useMaterial3: true, | ||
), | ||
home: Scaffold( | ||
appBar: AppBar( | ||
centerTitle: true, | ||
title: const Text("AudioPlayer"), | ||
leading: const IconButton( | ||
onPressed: null, | ||
icon: Icon( | ||
Icons.arrow_back_ios, | ||
color: Colors.black, | ||
), | ||
), | ||
actions: const [ | ||
MyMenuAction(), | ||
], | ||
), | ||
body: const Center( | ||
child: Text("Audio Player"), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class MyMenuAction extends StatelessWidget { | ||
const MyMenuAction({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SizedBox.square( | ||
dimension: 56, | ||
child: IconButton( | ||
icon: const Icon(Icons.menu), | ||
onPressed: () { | ||
logger.d("menu clicked"); | ||
showShackBar(context, "menu clicked"); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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
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