summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHritik Chouhan <hritikc3961@gmail.com>2022-09-23 20:38:07 +0200
committerHritik Chouhan <hritikc3961@gmail.com>2022-09-23 20:42:46 +0200
commit735de5a38ea937ee13157f6ac594053ddb8b027b (patch)
treeb30e0eff251a1c5ded3024c852454a99bcdbdcf6
parent1698dd7db75dadb4915e1b48f0f974b804a019f8 (diff)
Add music player with empty playlistlamprey_12.1.13lamprey/12.1.1312.1.13needlefish
-Update empty music page in flutter mediaplayer app. Signed-off-by: Hritik Chouhan <hritikc3961@gmail.com> Change-Id: Ice0a07fd81d2f9e8c827c76db50a46df53e427cd
-rw-r--r--lib/nomusic.dart220
1 files changed, 209 insertions, 11 deletions
diff --git a/lib/nomusic.dart b/lib/nomusic.dart
index 8fd8b67..0898a6a 100644
--- a/lib/nomusic.dart
+++ b/lib/nomusic.dart
@@ -1,27 +1,225 @@
// SPDX-License-Identifier: Apache-2.0
+import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
+import 'package:musicplayer/size.dart';
-class NoMusicFound extends StatelessWidget {
+class NoMusicFound extends StatefulWidget {
const NoMusicFound({Key? key}) : super(key: key);
@override
+ State<NoMusicFound> createState() => _NoMusicFoundState();
+}
+
+class _NoMusicFoundState extends State<NoMusicFound> {
+ double val = 0;
+
+ @override
Widget build(BuildContext context) {
+
+ SizeConfig().init(context);
return Scaffold(
- body: SafeArea(child: Center(child: Container(
- height: MediaQuery.of(context).size.height*0.5,
- width: MediaQuery.of(context).size.width*0.5,
- color: Colors.white,
- child: const Center(
- child: Text("NO MUSIC FILE FOUND IN THE MUSIC DIRECTORY!!!!", style: TextStyle(
- fontSize: 30,
- color: Colors.black,
+
+ body: Flex(
+ direction: Axis.vertical,
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Flexible(
+ flex: 4,
+ child: Flex(direction: Axis.horizontal,
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Flexible(
+ flex: 1,
+ child: Container(
+
+ height: SizeConfig.screenHeight*0.5,
+ width: SizeConfig.screenWidth*0.4,
+ // color: Colors.blueGrey,
+ decoration: BoxDecoration(
+ color: Colors.blueGrey,
+ borderRadius: BorderRadius.circular(10)),
+ child: Padding(
+ padding: const EdgeInsets.all(15.0),
+ child: Flex(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ direction: Axis.vertical,
+ children: [
+ Flexible(
+ flex: 3,
+ child: Image.asset('assets/music.png')),
+ Flexible(
+ flex: 1,
+ child: Flex(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ direction: Axis.horizontal,
+ children: [Flexible(
+ flex: 3,
+ child: SingleChildScrollView(
+ scrollDirection: Axis.vertical,
+ child: Text("Title",
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: SizeConfig.fontsize/2,
+
+ ),),
+ ),
+ ),
+ Flexible(
+ flex: 1,
+ child: Text("duration",
+ style: TextStyle(color: Colors.white,fontSize: SizeConfig.fontsize*0.4),)),
+ ],)),
+
+ Flexible(
+ flex: 1,
+ child:Text("Artist",
+ style: TextStyle(color: Colors.white,fontSize: SizeConfig.fontsize*0.4),),
+ )
+ ],
+ ),
+ ),
+
),),
- ),
- ),)),
+ Flexible(flex : 1,
+ child: Container(
+ height: SizeConfig.screenHeight*0.5,
+ width: SizeConfig.screenWidth*0.4,
+ child: Center(child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: const [
+ Text("Empty Playlist",
+ style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20),),
+ Text("Please Add the music files in Media directory or Plug in USB drive",
+ style: TextStyle(fontWeight: FontWeight.bold),),
+ ],
+ )),
+ ),),
+
+
+ ],
+ )),
+ Flexible(
+ flex: 2,
+ child: Flex(
+ direction: Axis.vertical,
+ children: [
+ Flexible(
+ flex: 1,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Flexible(
+ flex: 1,
+
+ child: Text("00:00")),
+ Flexible(
+ flex: 6,
+ child: RotatedBox(
+ quarterTurns: 4,
+ child: Slider(
+ activeColor: Colors.blueGrey,
+
+ thumbColor: Colors.transparent,
+ value: 0,
+ onChanged:(value){
+
+ },
+ max: 1,
+ min: 0,
+ ),
+ ),
+ ),
+ Flexible(
+ flex: 1,
+ child: Text("00:00")),
+
+
+ ],
+ ),),
+ Flex(
+ direction: Axis.horizontal,
+
+ children: [
+ Flexible(
+ flex: 1,
+ child: SizedBox(
+ width: SizeConfig.screenWidth/3,
+ )),
+ Flexible(
+ flex : 1,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+
+ Badge(
+ elevation: 0,
+ badgeColor: Colors.greenAccent,
+ child: IconButton(
+ icon: const Icon(Icons.loop),
+ color: Colors.greenAccent,
+ onPressed: (() {
+
+ }),),
+ ),
+
+
+ IconButton(onPressed: (){
+
+ }, icon: Icon(Icons.skip_previous)),
+ IconButton(
+ onPressed: (){
+
+ },
+ icon: Icon(Icons.play_arrow)
+ ),
+ IconButton(onPressed: (){
+
+ }, icon: Icon(Icons.skip_next)),
+
+ ],
+ ),),
+ Flexible(
+ flex: 1,
+ child: Row(
+ children: [
+ Icon(Icons.volume_up),
+ SizedBox(
+ width: SizeConfig.screenWidth/4,
+ child: RotatedBox(
+ quarterTurns: 4,
+ child: Slider(
+ value: val,
+ onChanged: (value){
+ setState(() {
+ val = value;
+ });
+
+ }),
+ ),
+ ),
+ ],
+ ),
+
+ )
+ ],
+ ),
+ ],
+ ),
+ ),
+
+ ],
+
+
+
+ ),
);
}
} \ No newline at end of file