├── lib ├── screens │ ├── Tag.dart │ ├── onboarding │ │ ├── Model.dart │ │ ├── Data_Model.dart │ │ ├── OnBoard_page.dart │ │ └── Onboarding.dart │ ├── MainScreen.dart │ ├── Recents.dart │ ├── SetttingsSubScreens │ │ ├── PlayBack.dart │ │ ├── Theme.dart │ │ └── About_Us.dart │ ├── Bookmarks.dart │ ├── PlayList.dart │ ├── Settings.dart │ ├── MusicLibrary.dart │ └── HomeScreen.dart ├── themes │ ├── Themes.dart │ ├── Dark.dart │ ├── DarkAF.dart │ └── Light.dart ├── models │ ├── ProgressModel.dart │ ├── const.dart │ ├── PlaylistModel.dart │ ├── Username.dart │ ├── RecentsModel.dart │ ├── BookmarkModel.dart │ ├── Now_Playing.dart │ ├── PlaylistRepo.dart │ ├── ThemeModel.dart │ ├── RecentsHelper.dart │ ├── BookmarkHelper.dart │ ├── PlayListHelper.dart │ └── SongsModel.dart ├── custom_icons.dart ├── Animations │ └── transitions.dart └── main.dart ├── android ├── settings_aar.gradle ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ │ └── styles.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── beats │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ ├── flutter_export_environment.sh │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── assets ├── img1.png ├── img2.png ├── headphone.png └── metropolis.otf ├── fonts ├── CustomIcons.ttf └── metropolis.otf ├── .metadata ├── README.md ├── LICENSE ├── .gitignore ├── pubspec.yaml └── pubspec.lock /lib/screens/Tag.dart: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /assets/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/assets/img1.png -------------------------------------------------------------------------------- /assets/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/assets/img2.png -------------------------------------------------------------------------------- /assets/headphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/assets/headphone.png -------------------------------------------------------------------------------- /assets/metropolis.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/assets/metropolis.otf -------------------------------------------------------------------------------- /fonts/CustomIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/fonts/CustomIcons.ttf -------------------------------------------------------------------------------- /fonts/metropolis.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/fonts/metropolis.otf -------------------------------------------------------------------------------- /lib/themes/Themes.dart: -------------------------------------------------------------------------------- 1 | library themes; 2 | 3 | export 'Dark.dart'; 4 | export 'Light.dart'; 5 | export 'DarkAF.dart'; -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | org.gradle.jvmargs=-Xmx1536M 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OjasKarmarkar/Beats/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/screens/onboarding/Model.dart: -------------------------------------------------------------------------------- 1 | class OnBoardPageModel { 2 | final String imagePath; 3 | final String heading; 4 | final int pageNumber; 5 | final String subHead; 6 | 7 | OnBoardPageModel( 8 | this.imagePath, this.heading, this.pageNumber, this.subHead); 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /lib/models/ProgressModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class ProgressModel extends ChangeNotifier{ 4 | var duration; 5 | var position; 6 | setDuration(d){ 7 | duration = d; 8 | notifyListeners(); 9 | } 10 | setPosition(p){ 11 | position = p; 12 | notifyListeners(); 13 | } 14 | } -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | ## Flutter wrapper 2 | -keep class io.flutter.app.** { *; } 3 | -keep class io.flutter.plugin.** { *; } 4 | -keep class io.flutter.util.** { *; } 5 | -keep class io.flutter.view.** { *; } 6 | -keep class io.flutter.** { *; } 7 | -keep class io.flutter.plugins.** { *; } 8 | -dontwarn io.flutter.embedding.** -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Beats 2 | 3 | A Beautiful Music Player Built Using Flutter! 4 | 5 | Live On The PlayStore = https://play.google.com/store/apps/details?id=in.selvasoft.beats 6 | 7 | Ios Support Soon 8 | # androidx problems in flute library when compiling app? 9 | Please solve the problem by referring to issue [#11](https://github.com/OjasKarmarkar/Beats/issues/11) 10 | -------------------------------------------------------------------------------- /lib/models/const.dart: -------------------------------------------------------------------------------- 1 | class Constants{ 2 | static const String pl = 'Add to Playlist'; 3 | static const String bm = 'Add to Favourites'; 4 | //static const String de = 'Delete Song'; 5 | //static const String re = 'Rename Song'; 6 | 7 | static const List choices = [ 8 | pl, 9 | bm, 10 | //de, 11 | //re 12 | ]; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/screens/onboarding/Data_Model.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'Model.dart'; 3 | 4 | List onboardData = [ 5 | OnBoardPageModel( 6 | "assets/img1.png", 7 | "Music Is Dream!", 8 | 1, 9 | "Want To Relax?\n We are here to help!", 10 | ), 11 | OnBoardPageModel( 12 | "assets/img2.png", 13 | "Meditate With Music", 14 | 2, 15 | "Enjoy The Material Design!\nListen And Chill!", 16 | ) 17 | ]; 18 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/beats/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.beats; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=C:\src\flutter" 4 | export "FLUTTER_APPLICATION_PATH=C:\Users\girish\Downloads\Ojas\flutter--projects\beats" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "FLUTTER_FRAMEWORK_DIR=C:\src\flutter\bin\cache\artifacts\engine\ios" 9 | export "FLUTTER_BUILD_NAME=1.0.1" 10 | export "FLUTTER_BUILD_NUMBER=1.0.1" 11 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /lib/models/PlaylistModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'PlayListHelper.dart'; 3 | 4 | class PlayList_Model extends ChangeNotifier{ 5 | 6 | PlaylistHelper db; 7 | var prefs; 8 | var lists; 9 | 10 | PlayList_Model(){ 11 | fetchLast(); 12 | } 13 | 14 | add(List list){ 15 | //playlists_repo.save(list); 16 | fetchLast(); 17 | } 18 | 19 | remove(List list){ 20 | 21 | } 22 | 23 | fetchLast() async { 24 | //lists = await playlists_repo.findAll(); 25 | notifyListeners(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/models/Username.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | class Username with ChangeNotifier{ 5 | 6 | String name; 7 | SharedPreferences prefs; 8 | 9 | Username(){ 10 | this.name = "Welcome"; 11 | init(); 12 | } 13 | init() async{ 14 | prefs = await SharedPreferences.getInstance(); 15 | String temp = prefs.getString("user") ?? "User"; 16 | name = temp; 17 | } 18 | 19 | setName(String x){ 20 | prefs.setString("user", x); 21 | name = x; 22 | notifyListeners(); 23 | 24 | } 25 | getName(){ 26 | return name; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /lib/models/RecentsModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/models/RecentsHelper.dart'; 2 | import 'package:flute_music_player/flute_music_player.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | 5 | 6 | class Recents extends ChangeNotifier{ 7 | 8 | RecentsHelper db; 9 | List recently = List(); 10 | 11 | Recents(){ 12 | db = RecentsHelper(); 13 | fetchRecents(); 14 | } 15 | 16 | add(Song song)async { 17 | if (!alreadyExists(song)){ 18 | if (recently.length > 1) await db.deleteLast(); 19 | await db.add(song); 20 | fetchRecents(); 21 | } 22 | } 23 | 24 | alreadyExists(s){ 25 | for(Song item in recently){ 26 | if (s.uri==item.uri) return true; 27 | } 28 | return false; 29 | } 30 | 31 | fetchRecents() async { 32 | recently = await db.getRecents(); 33 | notifyListeners(); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/models/BookmarkModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flute_music_player/flute_music_player.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'BookmarkHelper.dart'; 4 | 5 | class BookmarkModel extends ChangeNotifier { 6 | BookmarkHelper db; 7 | List bookmarks = List(); 8 | 9 | BookmarkModel() { 10 | db = BookmarkHelper(); 11 | fetchBookmarks(); 12 | } 13 | 14 | add(Song song) async { 15 | if (!alreadyExists(song)) { 16 | await db.add(song); 17 | fetchBookmarks(); 18 | } 19 | } 20 | 21 | remove(Song song) async{ 22 | await db.remove(song); 23 | fetchBookmarks(); 24 | } 25 | 26 | alreadyExists(s) { 27 | for(Song item in bookmarks){ 28 | if (s.uri==item.uri) return true; 29 | } 30 | return false; 31 | } 32 | 33 | fetchBookmarks() async { 34 | bookmarks = await db.getBookmarks(); 35 | notifyListeners(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /lib/models/Now_Playing.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | class NowPlaying extends ChangeNotifier { 5 | bool immersive; 6 | SharedPreferences prefsBool; 7 | NowPlaying(this.immersive) { 8 | init(); 9 | } 10 | 11 | init() async { 12 | prefsBool = await SharedPreferences.getInstance(); 13 | bool x = prefsBool.getBool("Immersive"); 14 | if (x == false) { 15 | update(false); 16 | } 17 | else if(x==true){ 18 | update(true); 19 | } 20 | } 21 | 22 | update(bool x) { 23 | immersive = x; 24 | notifyListeners(); 25 | } 26 | 27 | getScreen() { 28 | return immersive; 29 | } 30 | 31 | setScreen(bool check) { 32 | immersive = check; 33 | if (immersive == false) { 34 | prefsBool.setBool("Immersive", false); 35 | } else if (immersive == true) { 36 | prefsBool.setBool("Immersive", true); 37 | } 38 | notifyListeners(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ojas Karmarkar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/models/PlaylistRepo.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | 5 | class PlaylistRepo extends ChangeNotifier { 6 | 7 | List playlist = []; 8 | SharedPreferences prefList; 9 | int selected; 10 | 11 | PlaylistRepo() { 12 | init(); 13 | } 14 | 15 | init() async { 16 | prefList = await SharedPreferences.getInstance(); 17 | List list = prefList.getStringList("playlist"); 18 | updatePlayList(list); 19 | } 20 | 21 | push()async { 22 | prefList.setStringList("playlist", playlist); 23 | } 24 | 25 | getList() { 26 | return playlist; 27 | } 28 | 29 | delete(String name)async{ 30 | playlist.remove(name); 31 | notifyListeners(); 32 | await prefList.setStringList("playlist", playlist); 33 | notifyListeners(); 34 | } 35 | 36 | updatePlayList(List list) { 37 | if (list != null) { 38 | playlist.addAll(list); 39 | } 40 | notifyListeners(); 41 | } 42 | 43 | add(String name) async { 44 | playlist.add(name); 45 | await prefList.setStringList("playlist", playlist); 46 | notifyListeners(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/themes/Dark.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | darkTheme() { 4 | return ThemeData( 5 | cardColor: Colors.black54, 6 | cardTheme: CardTheme(color: Colors.black54), 7 | iconTheme: IconThemeData(color: Colors.white), 8 | backgroundColor: Colors.black87, 9 | textTheme: TextTheme( 10 | display3: TextStyle( 11 | color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w500), 12 | display1: TextStyle( 13 | color: Colors.white, fontSize: 22.0, fontWeight: FontWeight.w400), 14 | display2: TextStyle( 15 | letterSpacing: 1.1, 16 | fontFamily: 'Sans', 17 | fontSize: 17, 18 | color: Colors.white, 19 | ), 20 | subhead: TextStyle( 21 | letterSpacing: 1.1, 22 | fontFamily: 'Sans', 23 | fontSize: 30, 24 | color: Colors.white, 25 | fontWeight: FontWeight.w500), 26 | headline: TextStyle( 27 | fontFamily: 'Sans', 28 | color: Colors.white, 29 | fontSize: 45, 30 | fontWeight: FontWeight.bold))); 31 | } 32 | -------------------------------------------------------------------------------- /lib/themes/DarkAF.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | darkAFTheme() { 4 | return ThemeData( 5 | cardColor: Colors.black87, 6 | cardTheme: CardTheme(color: Colors.black87), 7 | iconTheme: IconThemeData(color: Colors.white), 8 | backgroundColor: Colors.black, 9 | textTheme: TextTheme( 10 | display3: TextStyle( 11 | color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w500), 12 | display1: TextStyle( 13 | color: Colors.white, fontSize: 22.0, fontWeight: FontWeight.w400), 14 | headline: TextStyle( 15 | fontFamily: 'Sans', 16 | color: Colors.white, 17 | fontSize: 45, 18 | fontWeight: FontWeight.bold), 19 | subhead: TextStyle( 20 | letterSpacing: 1.1, 21 | fontFamily: 'Sans', 22 | fontSize: 30, 23 | color: Colors.white, 24 | fontWeight: FontWeight.w500), 25 | display2: TextStyle( 26 | fontFamily: 'Sans', 27 | letterSpacing: 1.1, 28 | fontSize: 17, 29 | color: Colors.white, 30 | ))); 31 | } 32 | -------------------------------------------------------------------------------- /lib/themes/Light.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | lightTheme() { 4 | return ThemeData( 5 | 6 | cardColor: Colors.white, 7 | cardTheme: CardTheme(color: Colors.white.withOpacity(0.9)), 8 | textTheme: TextTheme( 9 | display3: TextStyle( 10 | color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.w500), 11 | display1: TextStyle( 12 | color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.w400), 13 | headline: TextStyle( 14 | fontFamily: 'Sans', 15 | color: Colors.black, 16 | fontSize: 45, 17 | fontWeight: FontWeight.bold), 18 | subhead: TextStyle( 19 | letterSpacing: 1.1, 20 | fontFamily: 'Sans', 21 | fontSize: 30, 22 | color: Colors.black, 23 | fontWeight: FontWeight.w500), 24 | display2: TextStyle( 25 | fontFamily: 'Sans', 26 | letterSpacing: 1.1, 27 | fontSize: 17, 28 | color: Colors.black, 29 | )), 30 | iconTheme: IconThemeData(color: Colors.grey), 31 | backgroundColor: Colors.white); 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | android/key.properties 72 | android/app/key.jks 73 | android/key.jks 74 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | beats 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/models/ThemeModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:beats/themes/Themes.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class ThemeChanger with ChangeNotifier { 6 | ThemeData _themeData; 7 | SharedPreferences prefs; 8 | Color accentColor; 9 | 10 | ThemeChanger() { 11 | this._themeData = lightTheme(); 12 | this.accentColor = Colors.blue; 13 | init(); 14 | } 15 | 16 | init() async { 17 | prefs = await SharedPreferences.getInstance(); 18 | int c = prefs.getInt("color") ?? Colors.blue.value; 19 | accentColor = Color(c); 20 | String theme = prefs.getString("theme") ?? "light"; 21 | if (theme == "light") { 22 | updateTheme(lightTheme()); 23 | } else if (theme == "dark") { 24 | updateTheme(darkTheme()); 25 | } else if (theme == "darkaf") { 26 | updateTheme(darkAFTheme()); 27 | } 28 | 29 | } 30 | 31 | setAccent(Color c) { 32 | int testingColorValue = c.value; 33 | prefs.setInt("color", testingColorValue); 34 | accentColor = c; 35 | notifyListeners(); 36 | } 37 | 38 | getAccent() { 39 | return accentColor; 40 | } 41 | 42 | getTheme() { 43 | return _themeData; 44 | } 45 | 46 | updateTheme(ThemeData theme) { 47 | _themeData = theme; 48 | notifyListeners(); 49 | } 50 | 51 | setTheme(ThemeData theme) { 52 | if (theme == lightTheme()) { 53 | prefs.setString("theme", "light"); 54 | } else if (theme == darkTheme()) { 55 | prefs.setString("theme", "dark"); 56 | } else if (theme == darkAFTheme()) { 57 | prefs.setString("theme", "darkaf"); 58 | } 59 | _themeData = theme; 60 | notifyListeners(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/custom_icons.dart: -------------------------------------------------------------------------------- 1 | /// Flutter icons CustomIcons 2 | /// Copyright (C) 2019 by original authors @ fluttericon.com, fontello.com 3 | /// This font was generated by FlutterIcon.com, which is derived from Fontello. 4 | /// 5 | /// To use this font, place it in your fonts/ directory and include the 6 | /// following in your pubspec.yaml 7 | /// 8 | /// flutter: 9 | /// fonts: 10 | /// - family: CustomIcons 11 | /// fonts: 12 | /// - asset: fonts/CustomIcons.ttf 13 | /// 14 | /// 15 | /// 16 | import 'package:flutter/widgets.dart'; 17 | 18 | class CustomIcons { 19 | CustomIcons._(); 20 | 21 | static const _kFontFam = 'CustomIcons'; 22 | 23 | static const IconData arrow_circle_o_left = const IconData(0xf11a, fontFamily: _kFontFam); 24 | static const IconData coffee = const IconData(0xf199, fontFamily: _kFontFam); 25 | static const IconData google = const IconData(0xf21a, fontFamily: _kFontFam); 26 | static const IconData info_circle = const IconData(0xf24b, fontFamily: _kFontFam); 27 | static const IconData instagram = const IconData(0xf24d, fontFamily: _kFontFam); 28 | static const IconData leaf = const IconData(0xf25c, fontFamily: _kFontFam); 29 | static const IconData music = const IconData(0xf299, fontFamily: _kFontFam); 30 | static const IconData paint_brush = const IconData(0xf2a7, fontFamily: _kFontFam); 31 | static const IconData paper_plane = const IconData(0xf2a8, fontFamily: _kFontFam); 32 | static const IconData pause = const IconData(0xf2ad, fontFamily: _kFontFam); 33 | static const IconData play = const IconData(0xf2be, fontFamily: _kFontFam); 34 | static const IconData search = const IconData(0xf2eb, fontFamily: _kFontFam); 35 | static const IconData share_alt = const IconData(0xf2f1, fontFamily: _kFontFam); 36 | static const IconData step_backward = const IconData(0xf31e, fontFamily: _kFontFam); 37 | static const IconData step_forward = const IconData(0xf31f, fontFamily: _kFontFam); 38 | static const IconData user = const IconData(0xf364, fontFamily: _kFontFam); 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/MainScreen.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/screens/Bookmarks.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:expanding_bottom_bar/expanding_bottom_bar.dart'; 4 | import 'HomeScreen.dart'; 5 | import 'Settings.dart'; 6 | import 'MusicLibrary.dart'; 7 | 8 | class MainScreen extends StatefulWidget { 9 | @override 10 | _MainScreenState createState() => _MainScreenState(); 11 | } 12 | 13 | class _MainScreenState extends State with WidgetsBindingObserver{ 14 | 15 | 16 | var index = 1; 17 | var screens = [HomeScreen(), Library(), Bookmarks(), SettingsScreen()]; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | resizeToAvoidBottomInset: false, 23 | body: screens[index], 24 | bottomNavigationBar: ExpandingBottomBar( 25 | animationDuration: Duration(milliseconds: 500), 26 | backgroundColor: Theme.of(context).backgroundColor, 27 | navBarHeight: 70, 28 | items: [ 29 | ExpandingBottomBarItem( 30 | icon: Icons.home, 31 | text: "Home", 32 | selectedColor: Colors.pinkAccent), 33 | ExpandingBottomBarItem( 34 | icon: Icons.music_note, 35 | text: "Library", 36 | selectedColor: Colors.deepPurpleAccent), 37 | ExpandingBottomBarItem( 38 | icon: Icons.favorite_border, 39 | text: "Favourites", 40 | selectedColor: Colors.red), 41 | ExpandingBottomBarItem( 42 | icon: Icons.settings, 43 | text: "Settings", 44 | selectedColor: Colors.blueAccent) 45 | ], 46 | selectedIndex: index, 47 | onIndexChanged: (i) { 48 | setState(() { 49 | index = i; 50 | }); 51 | }) 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 22 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /lib/models/RecentsHelper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flute_music_player/flute_music_player.dart'; 2 | import 'package:sqflite/sqflite.dart'; 3 | import 'package:path_provider/path_provider.dart'; 4 | class RecentsHelper { 5 | 6 | String tableName = "recents"; 7 | static Database _database; 8 | 9 | Future get database async { 10 | if (_database != null) 11 | return _database; 12 | 13 | // if _database is null we instantiate it 14 | _database = await initDB(); 15 | return _database; 16 | } 17 | initDB() async { 18 | var documentsDirectory = await getApplicationDocumentsDirectory(); 19 | String path = documentsDirectory.path + "beats.db"; 20 | return await openDatabase(path, version: 1, onOpen: (db) { 21 | }, onCreate: (Database db, int version) async { 22 | await db.execute("CREATE TABLE $tableName (" 23 | "id INTEGER," 24 | "artist TEXT," 25 | "title TEXT," 26 | "album TEXT," 27 | "albumId INTEGER," 28 | "duration INTEGER," 29 | "uri TEXT," 30 | "albumArt TEXT" 31 | ")"); 32 | }); 33 | } 34 | deleteLast() async { 35 | final db = await database; 36 | await db.rawDelete("delete from $tableName where rowid in (select rowid from $tableName limit 1)"); 37 | //await db.rawDelete("delete from $tableName where rowid = (select max(rowid) from $tableName)"); 38 | } 39 | add(Song s) async { 40 | final db = await database; 41 | var res = await db.insert(tableName, toMap(s)); 42 | return res; 43 | } 44 | getRecents() async { 45 | final db = await database; 46 | var res = await db.query(tableName); 47 | List list = 48 | res.isNotEmpty ? res.map((c) => Song.fromMap(c)).toList() : []; 49 | return list; 50 | } 51 | toMap(Song s){ 52 | return { 53 | 'id': s.id, 54 | 'artist': s.artist, 55 | 'title': s.title, 56 | 'album': s.album, 57 | 'albumId': s.albumId, 58 | 'duration': s.duration, 59 | 'uri': s.uri, 60 | 'albumArt': s.albumArt 61 | }; 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /lib/models/BookmarkHelper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flute_music_player/flute_music_player.dart'; 2 | import 'package:path_provider/path_provider.dart'; 3 | import 'package:sqflite/sqflite.dart'; 4 | import 'package:sqflite/sqlite_api.dart'; 5 | 6 | class BookmarkHelper { 7 | static Database _database; 8 | String table = "bookmarks"; 9 | 10 | Future get database async { 11 | if (_database != null) return _database; 12 | 13 | // if _database is null we instantiate it 14 | _database = await initDB(); 15 | return _database; 16 | } 17 | 18 | initDB() async { 19 | var documentsDirectory = await getApplicationDocumentsDirectory(); 20 | String path = documentsDirectory.path + "bookmarks.db"; 21 | return await openDatabase(path, version: 1, onOpen: (db) {}, 22 | onCreate: (Database db, int version) async { 23 | await db.execute("CREATE TABLE $table (" 24 | "id INTEGER," 25 | "artist TEXT," 26 | "title TEXT," 27 | "album TEXT," 28 | "albumId INTEGER," 29 | "duration INTEGER," 30 | "uri TEXT," 31 | "albumArt TEXT" 32 | ")"); 33 | }); 34 | } 35 | 36 | remove(Song s) async { 37 | final db = await database; 38 | await db.rawDelete("delete from $table where id = ${s.id}"); 39 | //await db.rawDelete("delete from $table where rowid = (select max(rowid) from $table)"); 40 | } 41 | 42 | add(Song s) async { 43 | final db = await database; 44 | var res = await db.insert(table, toMap(s)); 45 | return res; 46 | } 47 | 48 | getBookmarks() async { 49 | final db = await database; 50 | var res = await db.query(table); 51 | List list = 52 | res.isNotEmpty ? res.map((c) => Song.fromMap(c)).toList() : List(); 53 | return list; 54 | } 55 | 56 | toMap(Song s) { 57 | return { 58 | 'id': s.id, 59 | 'artist': s.artist, 60 | 'title': s.title, 61 | 'album': s.album, 62 | 'albumId': s.albumId, 63 | 'duration': s.duration, 64 | 'uri': s.uri, 65 | 'albumArt': s.albumArt 66 | }; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/screens/onboarding/OnBoard_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'Model.dart'; 3 | 4 | class OnBoardPage extends StatefulWidget { 5 | final OnBoardPageModel pageModel; 6 | final PageController pageController; 7 | 8 | const OnBoardPage( 9 | {Key key, @required this.pageModel, @required this.pageController}) 10 | : super(key: key); 11 | 12 | @override 13 | _OnBoardPageState createState() => _OnBoardPageState(); 14 | } 15 | 16 | class _OnBoardPageState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | double width = MediaQuery.of(context).size.width; 20 | double height = MediaQuery.of(context).size.height; 21 | 22 | return Scaffold( 23 | backgroundColor: Colors.white, 24 | body: SingleChildScrollView( 25 | child: Column( 26 | children: [ 27 | Padding( 28 | padding: EdgeInsets.only(top: height * 0.1), 29 | child: Align( 30 | alignment: Alignment.center, 31 | child: Text( 32 | widget.pageModel.heading, 33 | style: TextStyle(fontSize: 25, fontWeight: FontWeight.w500), 34 | ), 35 | ), 36 | ), 37 | new Image.asset( 38 | widget.pageModel.imagePath, 39 | height: height * 0.5, 40 | fit: BoxFit.fitWidth, 41 | width: width, 42 | ), 43 | Padding( 44 | padding: EdgeInsets.only( 45 | top: height * 0.05, left: width * 0.1, right: width * 0.1), 46 | child: Center( 47 | child: Text( 48 | widget.pageModel.subHead, 49 | softWrap: true, 50 | maxLines: 3, 51 | textAlign: TextAlign.center, 52 | style: TextStyle( 53 | fontSize: 20, 54 | fontWeight: FontWeight.normal, 55 | ), 56 | ), 57 | ), 58 | ) 59 | ], 60 | ), 61 | )); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | def keystoreProperties = new Properties() 27 | def keystorePropertiesFile = rootProject.file('key.properties') 28 | if (keystorePropertiesFile.exists()) { 29 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 30 | } 31 | 32 | android { 33 | compileSdkVersion 28 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "in.selvasoft.beats" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode 6 45 | versionName "2.1" 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | signingConfigs { 50 | release { 51 | keyAlias keystoreProperties['keyAlias'] 52 | keyPassword keystoreProperties['keyPassword'] 53 | storeFile file("key.jks") 54 | storePassword keystoreProperties['storePassword'] 55 | } 56 | } 57 | buildTypes { 58 | release { 59 | signingConfig signingConfigs.release 60 | minifyEnabled true 61 | useProguard true 62 | 63 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 64 | } 65 | } 66 | } 67 | 68 | flutter { 69 | source '../..' 70 | } 71 | 72 | dependencies { 73 | implementation 'androidx.appcompat:appcompat:1.0.0' 74 | testImplementation 'junit:junit:4.12' 75 | androidTestImplementation 'androidx.test:runner:1.1.0' 76 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 77 | } 78 | -------------------------------------------------------------------------------- /lib/models/PlayListHelper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flute_music_player/flute_music_player.dart'; 4 | import 'package:sqflite/sqflite.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | class PlaylistHelper { 7 | 8 | String tableName; 9 | Database _database; 10 | 11 | PlaylistHelper(String playlist){ 12 | tableName = playlist; 13 | database; 14 | } 15 | 16 | Future get database async { 17 | if (_database != null) 18 | return _database; 19 | 20 | // if _database is null we instantiate it 21 | _database = await initDB(); 22 | return _database; 23 | } 24 | initDB() async { 25 | var documentsDirectory = await getApplicationDocumentsDirectory(); 26 | String path = documentsDirectory.path + tableName + ".db"; 27 | return await openDatabase(path, version: 1, onOpen: (db) { 28 | }, onCreate: (Database db, int version) async { 29 | await db.execute("CREATE TABLE [$tableName] (" 30 | "id INTEGER," 31 | "artist TEXT," 32 | "title TEXT," 33 | "album TEXT," 34 | "albumId INTEGER," 35 | "duration INTEGER," 36 | "uri TEXT," 37 | "albumArt TEXT" 38 | ")"); 39 | }); 40 | } 41 | rename(String s)async{ 42 | final db = await database; 43 | await db.execute("ALTER TABLE [$tableName] RENAME TO [$s]"); 44 | await db.close(); 45 | var documentsDirectory = await getApplicationDocumentsDirectory(); 46 | String path = documentsDirectory.path + tableName + ".db"; 47 | await File(path).rename(documentsDirectory.path + s + ".db"); 48 | } 49 | alreadyExists(Song s) async{ 50 | List list = await getSongs(); 51 | for(Song song in list){ 52 | if(song.uri == s.uri){ 53 | return true; 54 | } 55 | } 56 | return false; 57 | } 58 | deletePlaylist() async{ 59 | var documentsDirectory = await getApplicationDocumentsDirectory(); 60 | String path = documentsDirectory.path + tableName + ".db"; 61 | await File(path).delete(); 62 | } 63 | deleteSong(Song s) async { 64 | final db = await database; 65 | await db.rawDelete("delete from [$tableName] where id = ${s.id}"); 66 | //await db.rawDelete("delete from $tableName where rowid = (select max(rowid) from $tableName)"); 67 | } 68 | add(Song s) async { 69 | final db = await database; 70 | bool exists = await alreadyExists(s); 71 | if(!exists){ 72 | var res = await db.insert("["+tableName+"]", toMap(s)); 73 | } 74 | } 75 | getSongs() async { 76 | final db = await database; 77 | var res = await db.query("["+tableName+"]"); 78 | List list = 79 | res.isNotEmpty ? res.map((c) => Song.fromMap(c)).toList() : []; 80 | return list; 81 | } 82 | toMap(Song s){ 83 | return { 84 | 'id': s.id, 85 | 'artist': s.artist, 86 | 'title': s.title, 87 | 'album': s.album, 88 | 'albumId': s.albumId, 89 | 'duration': s.duration, 90 | 'uri': s.uri, 91 | 'albumArt': s.albumArt 92 | }; 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /lib/screens/Recents.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:beats/models/RecentsModel.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:beats/screens/Player.dart'; 7 | import 'package:beats/models/SongsModel.dart'; 8 | import 'MusicLibrary.dart'; 9 | 10 | class LastPlayed extends StatelessWidget { 11 | SongsModel model; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | model = Provider.of(context); 16 | return Consumer( 17 | builder: (context, lastPlayed, _) => Padding( 18 | padding: const EdgeInsets.all(2.0), 19 | child: Padding( 20 | padding: const EdgeInsets.all(8.0), 21 | child: (lastPlayed.recently == null) 22 | ? Center( 23 | child: CircularProgressIndicator(), 24 | ) 25 | : (lastPlayed.recently.length == 0) 26 | ? Center( 27 | child: Text( 28 | "Play Something!", 29 | style: Theme.of(context).textTheme.display3, 30 | )) 31 | : Container( 32 | height: height * 0.16, 33 | width: width, 34 | child: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: ListView.builder( 37 | itemCount: lastPlayed.recently.length, 38 | itemBuilder: (context, pos) { 39 | return ListTile( 40 | onTap: () { 41 | model.player.stop(); 42 | model.currentSong = lastPlayed.recently[pos]; 43 | 44 | model.play(); 45 | Navigator.push(context, 46 | MaterialPageRoute(builder: (context) { 47 | return PlayBackPage(); 48 | })); 49 | }, 50 | leading: CircleAvatar( 51 | child: getImage(lastPlayed, pos)), 52 | title: Text( 53 | lastPlayed.recently[pos].title, 54 | maxLines: 1, 55 | style: Theme.of(context).textTheme.display2, 56 | ), 57 | ); 58 | }, 59 | ), 60 | ), 61 | ), 62 | ), 63 | ), 64 | ); 65 | } 66 | 67 | getImage(lastPlayed, pos) { 68 | if (lastPlayed.recently[pos].albumArt != null) { 69 | return ClipRRect( 70 | borderRadius: BorderRadius.circular(20), 71 | child: Image.file( 72 | File.fromUri(Uri.parse(lastPlayed.recently[pos].albumArt)))); 73 | } else { 74 | return Icon(Icons.music_note); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/screens/onboarding/Onboarding.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/screens/MainScreen.dart'; 2 | import 'package:dots_indicator/dots_indicator.dart'; 3 | import 'Data_Model.dart'; 4 | import 'OnBoard_page.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class OnBoarding extends StatefulWidget { 8 | @override 9 | _OnBoardingState createState() => _OnBoardingState(); 10 | } 11 | 12 | class _OnBoardingState extends State { 13 | final PageController pageController = PageController(); 14 | final _currentPageNotifier = ValueNotifier(0); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | double width = MediaQuery.of(context).size.width; 19 | double height = MediaQuery.of(context).size.height; 20 | 21 | return Scaffold( 22 | floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, 23 | floatingActionButton: MaterialButton( 24 | child: _currentPageNotifier.value != 1 25 | ? Text("NEXT" , style: TextStyle(color: Colors.blueAccent , fontWeight: FontWeight.bold , fontSize: 18),) 26 | : Text("FINISH" , style: TextStyle(color: Colors.blueAccent , fontWeight: FontWeight.bold , fontSize: 18)), 27 | onPressed: () { 28 | if (_currentPageNotifier.value != 1) { 29 | setState(() { 30 | pageController.nextPage( 31 | duration: Duration(seconds: 1), curve: Curves.easeIn); 32 | }); 33 | } else { 34 | Navigator.of(context).pushReplacement( 35 | new MaterialPageRoute(builder: (context) => MainScreen())); 36 | } 37 | }), 38 | body: Stack( 39 | children: [ 40 | PageView.builder( 41 | controller: pageController, 42 | itemCount: onboardData.length, 43 | itemBuilder: (BuildContext context, int index) { 44 | return OnBoardPage( 45 | pageModel: onboardData[index], 46 | pageController: pageController, 47 | ); 48 | }, 49 | onPageChanged: (int index) { 50 | setState(() { 51 | _currentPageNotifier.value = index; 52 | }); 53 | }), 54 | Container( 55 | child: Align( 56 | alignment: Alignment.bottomLeft, 57 | child: Padding( 58 | padding: 59 | EdgeInsets.only(bottom: height * 0.1, left: width * 0.43), 60 | child: DotsIndicator( 61 | dotsCount: onboardData.length, 62 | position: _currentPageNotifier.value.toDouble(), 63 | decorator: DotsDecorator( 64 | activeColor: Color(0xff1a73e8), 65 | size: const Size.square(9.0), 66 | activeSize: const Size(18.0, 9.0), 67 | activeShape: RoundedRectangleBorder( 68 | borderRadius: BorderRadius.circular(5.0)), 69 | ), 70 | ), 71 | ), 72 | ), 73 | ) 74 | ], 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/Animations/transitions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Scale extends PageRouteBuilder { 4 | final Widget page; 5 | Scale({this.page}) 6 | : super( 7 | pageBuilder: ( 8 | BuildContext context, 9 | Animation animation, 10 | Animation secondaryAnimation, 11 | ) => 12 | page, 13 | transitionsBuilder: ( 14 | BuildContext context, 15 | Animation animation, 16 | Animation secondaryAnimation, 17 | Widget child, 18 | ) => 19 | ScaleTransition( 20 | scale: Tween( 21 | begin: 0.0, 22 | end: 1.0, 23 | ).animate( 24 | CurvedAnimation( 25 | parent: animation, 26 | curve: Curves.fastOutSlowIn, 27 | ), 28 | ), 29 | child: child, 30 | ), 31 | ); 32 | } 33 | 34 | class EnterExitRoute extends PageRouteBuilder { 35 | final Widget enterPage; 36 | final Widget exitPage; 37 | EnterExitRoute({this.exitPage, this.enterPage}) 38 | : super( 39 | pageBuilder: ( 40 | BuildContext context, 41 | Animation animation, 42 | Animation secondaryAnimation, 43 | ) => 44 | enterPage, 45 | transitionsBuilder: ( 46 | BuildContext context, 47 | Animation animation, 48 | Animation secondaryAnimation, 49 | Widget child, 50 | ) => 51 | Stack( 52 | children: [ 53 | SlideTransition( 54 | position: new Tween( 55 | begin: const Offset(0.0, 0.0), 56 | end: const Offset(-1.0, 0.0), 57 | ).animate(animation), 58 | child: exitPage, 59 | ), 60 | SlideTransition( 61 | position: new Tween( 62 | begin: const Offset(1.0, 0.0), 63 | end: Offset.zero, 64 | ).animate(animation), 65 | child: enterPage, 66 | ) 67 | ], 68 | ), 69 | ); 70 | } 71 | 72 | class SlideRightRoute extends PageRouteBuilder { 73 | final Widget page; 74 | SlideRightRoute({this.page}) 75 | : super( 76 | pageBuilder: ( 77 | BuildContext context, 78 | Animation animation, 79 | Animation secondaryAnimation, 80 | ) => 81 | page, 82 | transitionsBuilder: ( 83 | BuildContext context, 84 | Animation animation, 85 | Animation secondaryAnimation, 86 | Widget child, 87 | ) => 88 | SlideTransition( 89 | position: Tween( 90 | begin: const Offset(0, 1), 91 | end: Offset.zero, 92 | ).animate(animation), 93 | child: child, 94 | ), 95 | ); 96 | } 97 | 98 | 99 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: beats 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons 25 | cupertino_icons: ^0.1.2 26 | flutter_launcher_icons: ^0.7.2 27 | dots_indicator: ^1.0.0 28 | permission_handler: 29 | expanding_bottom_bar: 30 | flute_music_player: 31 | provider: 32 | pref_dessert: 33 | path_provider: 34 | flutter_material_color_picker: ^1.0.0 35 | url_launcher: ^5.0.3 36 | sqflite: 37 | share: ^0.6.2+1 38 | flutter_media_notification: 39 | file_utils: ^0.1.3 40 | 41 | flutter_icons: 42 | android: "launcher_icon" 43 | ios: true 44 | image_path : "assets/launcher.png" 45 | 46 | 47 | dev_dependencies: 48 | flutter_test: 49 | sdk: flutter 50 | 51 | 52 | # For information on the generic Dart part of this file, see the 53 | # following page: https://www.dartlang.org/tools/pub/pubspec 54 | 55 | # The following section is specific to Flutter. 56 | flutter: 57 | 58 | # The following line ensures that the Material Icons font is 59 | # included with your application, so that you can use the icons in 60 | # the material Icons class. 61 | uses-material-design: true 62 | 63 | # To add assets to your application, add an assets section, like this: 64 | assets: 65 | - assets/img1.png 66 | - assets/img2.png 67 | - assets/headphone.png 68 | 69 | 70 | # An image asset can refer to one or more resolution-specific "variants", see 71 | # https://flutter.dev/assets-and-images/#resolution-aware. 72 | 73 | # For details regarding adding assets from package dependencies, see 74 | # https://flutter.dev/assets-and-images/#from-packages 75 | 76 | # To add custom fonts to your application, add a fonts section here, 77 | # in this "flutter" section. Each entry in this list should have a 78 | # "family" key with the font family name, and a "fonts" key with a 79 | # list giving the asset and other descriptors for the font. For 80 | # example: 81 | fonts: 82 | - family: CustomIcons 83 | fonts: 84 | - asset: fonts/CustomIcons.ttf 85 | 86 | # style: italic 87 | - family: Sans 88 | fonts: 89 | - asset: fonts/metropolis.otf 90 | # - asset: fonts/TrajanPro_Bold.ttf 91 | # weight: 700 92 | # 93 | # For details regarding fonts from package dependencies, 94 | # see https://flutter.dev/custom-fonts/#from-packages 95 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /lib/screens/SetttingsSubScreens/PlayBack.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/models/SongsModel.dart'; 2 | import 'package:beats/models/ThemeModel.dart'; 3 | import 'package:beats/models/Now_Playing.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | import '../MusicLibrary.dart'; 7 | 8 | class PlayBack extends StatefulWidget { 9 | @override 10 | _PlayBackState createState() => _PlayBackState(); 11 | } 12 | 13 | class _PlayBackState extends State { 14 | ThemeChanger themeChanger; 15 | 16 | NowPlaying playScreen; 17 | 18 | SongsModel model; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | playScreen = Provider.of(context); 23 | themeChanger = Provider.of(context); 24 | model = Provider.of(context); 25 | return Scaffold( 26 | body: Stack(children: [ 27 | AppBar( 28 | leading: Padding( 29 | padding: EdgeInsets.only(top: height * 0.016, left: width * 0.03), 30 | child: IconButton( 31 | iconSize: 25.0, 32 | icon: Icon( 33 | Icons.arrow_back, 34 | color: Colors.grey, 35 | ), 36 | onPressed: () { 37 | Navigator.pop(context); 38 | }, 39 | ), 40 | ), 41 | backgroundColor: Theme.of(context).backgroundColor, 42 | centerTitle: true, 43 | title: Padding( 44 | padding: EdgeInsets.only(top: height * 0.022), 45 | child: 46 | Text("Now Playing", style: Theme.of(context).textTheme.display1), 47 | ), 48 | ), 49 | Padding( 50 | padding: EdgeInsets.only(top: 120.0, left: width * 0.02), 51 | child: ListTile( 52 | leading: Icon( 53 | Icons.play_circle_outline, 54 | size: 27.0, 55 | color: Colors.grey, 56 | ), 57 | title: Text("Change Look of Now Playing", 58 | style: Theme.of(context).textTheme.display2), 59 | onTap: () { 60 | _settingModalBottomSheet(context); 61 | }, 62 | ), 63 | ), 64 | ])); 65 | } 66 | 67 | void _settingModalBottomSheet(context) { 68 | showModalBottomSheet( 69 | context: context, 70 | builder: (BuildContext bc) { 71 | return Container( 72 | color: Theme.of(context).backgroundColor, 73 | child: new Wrap( 74 | children: [ 75 | new ListTile( 76 | leading: new Icon( 77 | Icons.details, 78 | color: themeChanger.getAccent(), 79 | ), 80 | title: new Text( 81 | 'Immersive', 82 | style: Theme.of(context).textTheme.display2, 83 | ), 84 | onTap: () => { 85 | playScreen.setScreen(true), 86 | playScreen.getScreen(), 87 | Navigator.pop(context) 88 | }), 89 | new ListTile( 90 | leading: new Icon( 91 | Icons.details, 92 | color: themeChanger.getAccent(), 93 | ), 94 | title: new Text( 95 | 'Basic', 96 | style: Theme.of(context).textTheme.display2, 97 | ), 98 | onTap: () => { 99 | playScreen.setScreen(false), 100 | playScreen.getScreen(), 101 | Navigator.pop(context) 102 | }, 103 | ), 104 | ], 105 | ), 106 | ); 107 | }); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:beats/Models/Username.dart'; 3 | import 'package:beats/models/PlaylistRepo.dart'; 4 | import 'package:beats/models/BookmarkModel.dart'; 5 | import 'package:beats/models/Now_Playing.dart'; 6 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 7 | import 'models/RecentsModel.dart'; 8 | import 'models/SongsModel.dart'; 9 | import 'package:provider/provider.dart'; 10 | import 'package:beats/screens/onboarding/Onboarding.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:flutter/services.dart'; 13 | import 'package:shared_preferences/shared_preferences.dart'; 14 | import './screens/MainScreen.dart'; 15 | import 'models/ThemeModel.dart'; 16 | import 'package:beats/models/ProgressModel.dart'; 17 | 18 | void main(List args) { 19 | var prov = ProgressModel(); 20 | var rec = Recents(); 21 | runApp(MultiProvider(providers: [ 22 | ChangeNotifierProvider( 23 | builder: (context) => BookmarkModel(), 24 | ), 25 | ChangeNotifierProvider( 26 | builder: (context) => PlaylistRepo(), 27 | ), 28 | ChangeNotifierProvider( 29 | builder: (context) => Username(), 30 | ), 31 | ChangeNotifierProvider( 32 | builder: (context) => rec, 33 | ), 34 | ChangeNotifierProvider( 35 | builder: (context) => prov, 36 | ), 37 | ChangeNotifierProvider( 38 | builder: (context) => SongsModel(prov, rec), 39 | ), 40 | ChangeNotifierProvider(builder: (context) => ThemeChanger()), 41 | ChangeNotifierProvider(builder: (context) => NowPlaying(false)) 42 | ], child: MyApp())); 43 | } 44 | 45 | class MyApp extends StatefulWidget { 46 | @override 47 | _MyAppState createState() => _MyAppState(); 48 | } 49 | 50 | class _MyAppState extends State { 51 | SongsModel model; 52 | 53 | @override 54 | void initState() { 55 | MediaNotification.setListener('pause', () { 56 | setState((){ 57 | model.pause(); 58 | }); 59 | }); 60 | 61 | MediaNotification.setListener('next', () { 62 | setState(() { 63 | model.player.stop(); 64 | model.next(); 65 | model.play(); 66 | }); 67 | }); 68 | 69 | MediaNotification.setListener('prev', () { 70 | setState((){ 71 | model.player.stop(); 72 | model.previous(); 73 | model.play(); 74 | }); 75 | }); 76 | 77 | MediaNotification.setListener('play', () { 78 | setState(() => model.play()); 79 | }); 80 | super.initState(); 81 | } 82 | 83 | @override 84 | void dispose() { 85 | super.dispose(); 86 | model.stop(); 87 | } 88 | 89 | @override 90 | Widget build(BuildContext context) { 91 | model = Provider.of(context); 92 | ThemeChanger theme = Provider.of(context); 93 | return new MaterialApp( 94 | home: new Splash(), 95 | theme: theme.getTheme(), 96 | debugShowCheckedModeBanner: false, 97 | ); 98 | } 99 | } 100 | 101 | class Splash extends StatefulWidget { 102 | @override 103 | SplashState createState() => new SplashState(); 104 | } 105 | 106 | class SplashState extends State { 107 | @override 108 | Widget build(BuildContext context) { 109 | return new Scaffold( 110 | body: new Center( 111 | child: new Text('Loading...'), 112 | ), 113 | ); 114 | } 115 | 116 | Future checkFirstSeen() async { 117 | SharedPreferences prefs = await SharedPreferences.getInstance(); 118 | bool _seen = (prefs.getBool('seen') ?? false); 119 | 120 | if (_seen) { 121 | SystemChrome.setEnabledSystemUIOverlays([]); 122 | Navigator.of(context).pushReplacement( 123 | new MaterialPageRoute(builder: (context) => new MainScreen())); 124 | } else { 125 | SystemChrome.setEnabledSystemUIOverlays([]); 126 | prefs.setBool('seen', true); 127 | Navigator.of(context).pushReplacement( 128 | new MaterialPageRoute(builder: (context) => new OnBoarding())); 129 | } 130 | } 131 | 132 | @override 133 | void initState() { 134 | SystemChrome.setPreferredOrientations([ 135 | DeviceOrientation.portraitUp, 136 | DeviceOrientation.portraitDown, 137 | ]); 138 | super.initState(); 139 | checkFirstSeen(); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /lib/models/SongsModel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flute_music_player/flute_music_player.dart'; 3 | import 'package:beats/models/ProgressModel.dart'; 4 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 5 | import 'dart:math'; 6 | import 'RecentsModel.dart'; 7 | import 'package:flutter/services.dart'; 8 | 9 | enum PlayerState { PLAYING, PAUSED, STOPPED } 10 | 11 | class SongsModel extends ChangeNotifier { 12 | // Thousands of stuff packed into this ChangeNotifier 13 | var songs = []; 14 | var duplicate = []; // Duplicate of songs variable for Search function 15 | Song currentSong; 16 | bool playlist = false; 17 | var playlistSongs = []; 18 | var currentState; 19 | MusicFinder player; 20 | ProgressModel prog; 21 | var position; 22 | bool shuffle = false; 23 | bool repeat = false; 24 | Random rnd = new Random(); 25 | Recents recents; 26 | 27 | SongsModel(prov, rec) { 28 | fetchSongs(); 29 | prog = prov; 30 | recents = rec; 31 | } 32 | 33 | fetchSongs() async { 34 | songs = await MusicFinder.allSongs(); 35 | if (songs.length == 0) songs = null; 36 | player = new MusicFinder(); 37 | initValues(); 38 | player.setPositionHandler((p) { 39 | prog.setPosition(p.inSeconds); 40 | }); 41 | songs?.forEach((item) { 42 | duplicate.add(item); 43 | }); 44 | 45 | notifyListeners(); 46 | } 47 | 48 | updateUI() { 49 | notifyListeners(); 50 | } 51 | 52 | playURI(var uri1) { 53 | player.stop(); 54 | for (var song1 in songs) { 55 | if (song1.uri == uri1) { 56 | currentSong = song1; 57 | play(); 58 | break; 59 | } 60 | } 61 | } 62 | 63 | initValues() { 64 | player.setDurationHandler((d) { 65 | prog.setDuration(d.inSeconds); 66 | }); 67 | 68 | player.setCompletionHandler(() { 69 | player.stop(); 70 | if (repeat) { 71 | current_Song(); 72 | } else if (shuffle) { 73 | random_Song(); 74 | } else { 75 | next(); 76 | } 77 | play(); 78 | }); 79 | } 80 | 81 | seek(pos) { 82 | player.seek(pos); 83 | } 84 | 85 | play() { 86 | var song = currentSong; 87 | player.play(song.uri, isLocal: true); 88 | currentState = PlayerState.PLAYING; 89 | recents.add(song); 90 | showNotification(song.title, song.artist, true); 91 | updateUI(); 92 | } 93 | 94 | stop() { 95 | currentState = PlayerState.STOPPED; 96 | hideNotification(); 97 | updateUI(); 98 | } 99 | 100 | pause() { 101 | player?.pause(); 102 | currentState = PlayerState.PAUSED; 103 | showNotification(currentSong.title, currentSong.artist, false); 104 | updateUI(); 105 | } 106 | 107 | next() { 108 | if (playlist) { 109 | if (currentSong == playlistSongs[playlistSongs.length - 1]) { 110 | currentSong = playlistSongs[0]; 111 | } else { 112 | currentSong = playlistSongs[playlistSongs.indexOf(currentSong) + 1]; 113 | } 114 | } else { 115 | if (currentSong == songs[songs.length - 1]) { 116 | currentSong = songs[0]; 117 | } else { 118 | currentSong = songs[songs.indexOf(currentSong) + 1]; 119 | } 120 | } 121 | 122 | updateUI(); 123 | } 124 | 125 | previous() { 126 | if (playlist) { 127 | if (currentSong == playlistSongs[0]) { 128 | currentSong = playlistSongs[playlistSongs.length - 1]; 129 | } else { 130 | currentSong = playlistSongs[playlistSongs.indexOf(currentSong) - 1]; 131 | } 132 | } else { 133 | if (currentSong == songs[0]) { 134 | currentSong = songs[songs.length - 1]; 135 | } else { 136 | currentSong = songs[songs.indexOf(currentSong) - 1]; 137 | } 138 | } 139 | 140 | updateUI(); 141 | } 142 | 143 | setRepeat(b) { 144 | repeat = b; 145 | notifyListeners(); 146 | } 147 | 148 | setShuffle(b) { 149 | shuffle = b; 150 | notifyListeners(); 151 | } 152 | 153 | current_Song() { 154 | if (playlist) { 155 | currentSong = playlistSongs[playlistSongs.indexOf(currentSong)]; 156 | } else { 157 | currentSong = songs[songs.indexOf(currentSong)]; 158 | } 159 | updateUI(); 160 | } 161 | 162 | random_Song() { 163 | if (playlist) { 164 | int max = playlistSongs.length; 165 | currentSong = playlistSongs[rnd.nextInt(max)]; 166 | } else { 167 | int max = songs.length; 168 | currentSong = songs[rnd.nextInt(max)]; 169 | } 170 | updateUI(); 171 | } 172 | 173 | Future hideNotification() async { 174 | try { 175 | await MediaNotification.hideNotification(); 176 | } on PlatformException {} 177 | } 178 | 179 | Future showNotification(title, author, isPlaying) async { 180 | try { 181 | await MediaNotification.showNotification( 182 | title: title, author: author, isPlaying: isPlaying); 183 | } on PlatformException {} 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /lib/screens/SetttingsSubScreens/Theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/models/SongsModel.dart'; 2 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 3 | import '../../models/ThemeModel.dart'; 4 | import 'package:flutter/material.dart'; 5 | import '../../custom_icons.dart'; 6 | import 'package:provider/provider.dart'; 7 | import '../MusicLibrary.dart'; 8 | import 'package:beats/themes/Themes.dart'; 9 | import 'package:flutter_material_color_picker/flutter_material_color_picker.dart'; 10 | 11 | class Themes extends StatefulWidget { 12 | @override 13 | _ThemesState createState() => _ThemesState(); 14 | } 15 | 16 | class _ThemesState extends State { 17 | ThemeChanger themeChanger; 18 | 19 | SongsModel model; 20 | 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | themeChanger = Provider.of(context); 25 | model = Provider.of(context); 26 | return Scaffold( 27 | body: Stack( 28 | children: [ 29 | AppBar( 30 | leading: Padding( 31 | padding: EdgeInsets.only(top: height * 0.016, left: width * 0.03), 32 | child: IconButton( 33 | iconSize: 25.0, 34 | icon: Icon( 35 | Icons.arrow_back, 36 | color: Colors.grey, 37 | ), 38 | onPressed: () { 39 | Navigator.pop(context); 40 | }, 41 | ), 42 | ), 43 | backgroundColor: Theme.of(context).backgroundColor, 44 | centerTitle: true, 45 | title: Padding( 46 | padding: EdgeInsets.only(top: height * 0.022), 47 | child: Text("Now Playing", 48 | style: Theme.of(context).textTheme.display1), 49 | ), 50 | ), 51 | Padding( 52 | padding: EdgeInsets.only(top: 120.0, left: width * 0.02), 53 | child: ListTile( 54 | trailing: Icon( 55 | Icons.brush, 56 | size: 25.0, 57 | color: Colors.grey, 58 | ), 59 | title: Text("Current Theme", 60 | style: Theme.of(context).textTheme.display2), 61 | onTap: () { 62 | _settingModalBottomSheet(context); 63 | }, 64 | ), 65 | ), 66 | Padding( 67 | padding: EdgeInsets.only(top: 190.0, left: width * 0.02), 68 | child: ListTile( 69 | title: Text("Accent Color", 70 | style: Theme.of(context).textTheme.display2), 71 | trailing: CircleColor( 72 | color: themeChanger.getAccent(), 73 | circleSize: 25.0, 74 | ), 75 | onTap: () { 76 | showDialog( 77 | context: context, 78 | builder: (_) => Padding( 79 | padding: EdgeInsets.symmetric( 80 | vertical: height * 0.14, horizontal: width * 0.15), 81 | child: Container( 82 | color: Theme.of(context).backgroundColor, 83 | height: height * 0.2, 84 | width: width * 0.4, 85 | child: Padding( 86 | padding: const EdgeInsets.all(18.0), 87 | child: Column( 88 | children: [ 89 | Padding( 90 | padding: const EdgeInsets.all(8.0), 91 | child: Text("Color Picker", 92 | style: Theme.of(context).textTheme.display1), 93 | ), 94 | Padding( 95 | padding: const EdgeInsets.all(8.0), 96 | child: MaterialColorPicker( 97 | colors: [ 98 | Colors.blue, 99 | Colors.red, 100 | Colors.deepPurpleAccent, 101 | Colors.green, 102 | Colors.greenAccent 103 | ], 104 | allowShades: false, 105 | selectedColor: themeChanger.getAccent(), 106 | circleSize: 70, 107 | onMainColorChange: (ColorSwatch selectedColor) { 108 | themeChanger.setAccent(selectedColor); 109 | }, 110 | ), 111 | ), 112 | Padding( 113 | padding: const EdgeInsets.all(18.0), 114 | child: FloatingActionButton( 115 | child: Icon(CustomIcons.leaf), 116 | onPressed: () { 117 | Navigator.of(context, rootNavigator: true) 118 | .pop('dialog'); 119 | }, 120 | ), 121 | ) 122 | ], 123 | ), 124 | ), 125 | ), 126 | ), 127 | ); 128 | }, 129 | ), 130 | ), 131 | ], 132 | ), 133 | ); 134 | } 135 | 136 | void _settingModalBottomSheet(context) { 137 | showModalBottomSheet( 138 | context: context, 139 | builder: (BuildContext bc) { 140 | return Container( 141 | color: Theme.of(context).backgroundColor, 142 | child: new Wrap( 143 | children: [ 144 | new ListTile( 145 | leading: new Icon( 146 | Icons.brush, 147 | color: Colors.grey, 148 | ), 149 | title: new Text( 150 | 'White', 151 | style: Theme.of(context).textTheme.display2, 152 | ), 153 | onTap: () => { 154 | themeChanger.setTheme(lightTheme()), 155 | Navigator.pop(context) 156 | }), 157 | new ListTile( 158 | leading: new Icon( 159 | Icons.brush, 160 | color: Colors.grey, 161 | ), 162 | title: new Text( 163 | 'Dark', 164 | style: Theme.of(context).textTheme.display2, 165 | ), 166 | onTap: () => { 167 | themeChanger.setTheme(darkTheme()), 168 | Navigator.pop(context) 169 | }, 170 | ), 171 | new ListTile( 172 | leading: new Icon( 173 | Icons.brush, 174 | color: Colors.grey, 175 | ), 176 | title: new Text( 177 | 'Amoled Black', 178 | style: Theme.of(context).textTheme.display2, 179 | ), 180 | onTap: () => { 181 | themeChanger.setTheme(darkAFTheme()), 182 | Navigator.pop(context) 183 | }, 184 | ), 185 | ], 186 | ), 187 | ); 188 | }); 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.10" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.1.2" 67 | dots_indicator: 68 | dependency: "direct main" 69 | description: 70 | name: dots_indicator 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.1.0" 74 | expanding_bottom_bar: 75 | dependency: "direct main" 76 | description: 77 | name: expanding_bottom_bar 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.1.2" 81 | file_utils: 82 | dependency: "direct main" 83 | description: 84 | name: file_utils 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.3" 88 | flute_music_player: 89 | dependency: "direct main" 90 | description: 91 | name: flute_music_player 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.0.6" 95 | flutter: 96 | dependency: "direct main" 97 | description: flutter 98 | source: sdk 99 | version: "0.0.0" 100 | flutter_launcher_icons: 101 | dependency: "direct main" 102 | description: 103 | name: flutter_launcher_icons 104 | url: "https://pub.dartlang.org" 105 | source: hosted 106 | version: "0.7.2" 107 | flutter_material_color_picker: 108 | dependency: "direct main" 109 | description: 110 | name: flutter_material_color_picker 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "1.0.0" 114 | flutter_media_notification: 115 | dependency: "direct main" 116 | description: 117 | name: flutter_media_notification 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "1.2.6" 121 | flutter_test: 122 | dependency: "direct dev" 123 | description: flutter 124 | source: sdk 125 | version: "0.0.0" 126 | globbing: 127 | dependency: transitive 128 | description: 129 | name: globbing 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.3.0" 133 | image: 134 | dependency: transitive 135 | description: 136 | name: image 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.1.4" 140 | json_annotation: 141 | dependency: transitive 142 | description: 143 | name: json_annotation 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.4.0" 147 | matcher: 148 | dependency: transitive 149 | description: 150 | name: matcher 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.12.5" 154 | meta: 155 | dependency: transitive 156 | description: 157 | name: meta 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "1.1.7" 161 | path: 162 | dependency: transitive 163 | description: 164 | name: path 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "1.6.4" 168 | path_provider: 169 | dependency: "direct main" 170 | description: 171 | name: path_provider 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.1.2" 175 | pedantic: 176 | dependency: transitive 177 | description: 178 | name: pedantic 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "1.8.0+1" 182 | permission_handler: 183 | dependency: "direct main" 184 | description: 185 | name: permission_handler 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "3.1.0" 189 | petitparser: 190 | dependency: transitive 191 | description: 192 | name: petitparser 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "2.4.0" 196 | pref_dessert: 197 | dependency: "direct main" 198 | description: 199 | name: pref_dessert 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "0.3.0" 203 | provider: 204 | dependency: "direct main" 205 | description: 206 | name: provider 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "3.0.0+1" 210 | quiver: 211 | dependency: transitive 212 | description: 213 | name: quiver 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "2.0.5" 217 | share: 218 | dependency: "direct main" 219 | description: 220 | name: share 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.6.2+1" 224 | shared_preferences: 225 | dependency: transitive 226 | description: 227 | name: shared_preferences 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "0.5.3+4" 231 | sky_engine: 232 | dependency: transitive 233 | description: flutter 234 | source: sdk 235 | version: "0.0.99" 236 | source_span: 237 | dependency: transitive 238 | description: 239 | name: source_span 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.5.5" 243 | sqflite: 244 | dependency: "direct main" 245 | description: 246 | name: sqflite 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.1.6+1" 250 | stack_trace: 251 | dependency: transitive 252 | description: 253 | name: stack_trace 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "1.9.3" 257 | stream_channel: 258 | dependency: transitive 259 | description: 260 | name: stream_channel 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "2.0.0" 264 | string_scanner: 265 | dependency: transitive 266 | description: 267 | name: string_scanner 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "1.0.5" 271 | synchronized: 272 | dependency: transitive 273 | description: 274 | name: synchronized 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.1.0+1" 278 | term_glyph: 279 | dependency: transitive 280 | description: 281 | name: term_glyph 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "1.1.0" 285 | test_api: 286 | dependency: transitive 287 | description: 288 | name: test_api 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "0.2.5" 292 | typed_data: 293 | dependency: transitive 294 | description: 295 | name: typed_data 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.1.6" 299 | url_launcher: 300 | dependency: "direct main" 301 | description: 302 | name: url_launcher 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "5.0.3" 306 | vector_math: 307 | dependency: transitive 308 | description: 309 | name: vector_math 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "2.0.8" 313 | xml: 314 | dependency: transitive 315 | description: 316 | name: xml 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "3.5.0" 320 | yaml: 321 | dependency: transitive 322 | description: 323 | name: yaml 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "2.1.15" 327 | sdks: 328 | dart: ">=2.5.0 <3.0.0" 329 | flutter: ">=1.6.0 <2.0.0" 330 | -------------------------------------------------------------------------------- /lib/screens/Bookmarks.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:beats/screens/Player.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:beats/models/SongsModel.dart'; 7 | import 'package:beats/models/BookmarkModel.dart'; 8 | import '../custom_icons.dart'; 9 | import 'MusicLibrary.dart'; 10 | import 'package:beats/Animations/transitions.dart'; 11 | 12 | class Bookmarks extends StatelessWidget { 13 | SongsModel model; 14 | 15 | bool isPlayed = false; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | model = Provider.of(context); 20 | return Consumer( 21 | builder: (context, bm, _) => WillPopScope( 22 | child: Scaffold( 23 | backgroundColor: Theme.of(context).backgroundColor, 24 | body: Stack( 25 | children: [ 26 | (bm.bookmarks == null) 27 | ? Center( 28 | child: CircularProgressIndicator(), 29 | ) 30 | : (bm.bookmarks.length == 0 || bm.bookmarks.length == null) 31 | ? Center( 32 | child: Text( 33 | "No Favourites", 34 | style: Theme.of(context).textTheme.display1, 35 | )) 36 | : Container( 37 | height: height * 0.2, 38 | width: width, 39 | child: Align( 40 | alignment: Alignment.center, 41 | child: Row( 42 | mainAxisAlignment: MainAxisAlignment.center, 43 | children: [ 44 | Padding( 45 | padding: const EdgeInsets.all(8.0), 46 | child: Icon( 47 | Icons.favorite_border, 48 | color: Colors.redAccent, 49 | ), 50 | ), 51 | Text("Liked Songs", 52 | style: TextStyle( 53 | color: Colors.white, fontSize: 30.0)), 54 | ], 55 | ), 56 | ), 57 | // Add box decoration 58 | decoration: BoxDecoration( 59 | // Box decoration takes a gradient 60 | gradient: LinearGradient( 61 | // Where the linear gradient begins and ends 62 | begin: Alignment.topRight, 63 | end: Alignment.bottomLeft, 64 | // Add one stop for each color. Stops should increase from 0 to 1 65 | stops: [0.1, 0.5, 0.7, 0.9], 66 | colors: [ 67 | Colors.lightBlue, 68 | Colors.blue, 69 | Colors.blueAccent, 70 | Colors.blue, 71 | ], 72 | ), 73 | )), 74 | Padding( 75 | padding: EdgeInsets.only(top: height * 0.2), 76 | child: ListView.builder( 77 | itemCount: bm.bookmarks.length, 78 | itemBuilder: (context, pos) { 79 | return Padding( 80 | padding: const EdgeInsets.only(top: 20.0, left: 10.0), 81 | child: ListTile( 82 | onTap: () { 83 | model.player.stop(); 84 | model.playlist = true; 85 | model.playlistSongs = bm.bookmarks; 86 | model.currentSong = bm.bookmarks[pos]; 87 | 88 | model.play(); 89 | }, 90 | leading: CircleAvatar(child: getImage(bm, pos)), 91 | title: Text( 92 | bm.bookmarks[pos].title, 93 | maxLines: 1, 94 | style: TextStyle( 95 | fontSize: 15, 96 | fontWeight: FontWeight.bold, 97 | color: 98 | Theme.of(context).textTheme.display1.color), 99 | ), 100 | subtitle: Padding( 101 | padding: const EdgeInsets.all(8.0), 102 | child: Text( 103 | bm.bookmarks[pos].artist, 104 | maxLines: 1, 105 | style: TextStyle( 106 | fontSize: 12, 107 | color: 108 | Theme.of(context).textTheme.display1.color), 109 | ), 110 | ), 111 | ), 112 | ); 113 | }, 114 | ), 115 | ), 116 | //showStatus(model , context) 117 | ], 118 | ), 119 | ), 120 | onWillPop: () {}, 121 | ), 122 | ); 123 | } 124 | 125 | getImage(bm, pos) { 126 | if (bm.bookmarks[pos].albumArt != null) { 127 | return ClipRRect( 128 | borderRadius: BorderRadius.circular(20), 129 | child: 130 | Image.file(File.fromUri(Uri.parse(bm.bookmarks[pos].albumArt)))); 131 | } else { 132 | return Icon(Icons.music_note); 133 | } 134 | } 135 | 136 | showStatus(model, context) { 137 | if (model.currentSong != null) { 138 | return Container( 139 | decoration: BoxDecoration( 140 | color: Theme.of(context).backgroundColor, 141 | border: Border( 142 | top: BorderSide( 143 | color: Theme.of(context).textTheme.display1.color, 144 | ), 145 | )), 146 | height: height * 0.06, 147 | width: width, 148 | child: ListView.builder( 149 | scrollDirection: Axis.horizontal, 150 | itemCount: 1, 151 | itemBuilder: (context, pos) { 152 | return GestureDetector( 153 | onTap: () { 154 | Navigator.push(context, Scale(page: PlayBackPage())); 155 | }, 156 | child: Stack( 157 | children: [ 158 | Row( 159 | children: [ 160 | IconButton( 161 | color: Theme.of(context).textTheme.display1.color, 162 | icon: Icon(Icons.arrow_drop_up), 163 | onPressed: () { 164 | Navigator.push(context, Scale(page: PlayBackPage())); 165 | }, 166 | ), 167 | Container( 168 | width: width * 0.75, 169 | child: Padding( 170 | padding: EdgeInsets.only(left: 20.0), 171 | child: Text( 172 | model.currentSong.title, 173 | style: Theme.of(context).textTheme.display2, 174 | maxLines: 1, 175 | ), 176 | ), 177 | ), 178 | Padding( 179 | padding: EdgeInsets.only(right: 20), 180 | child: IconButton( 181 | icon: model.currentState == PlayerState.PAUSED || 182 | model.currentState == PlayerState.STOPPED 183 | ? Icon( 184 | CustomIcons.play, 185 | color: Theme.of(context) 186 | .textTheme 187 | .display1 188 | .color, 189 | size: 20.0, 190 | ) 191 | : Icon( 192 | CustomIcons.pause, 193 | color: Theme.of(context) 194 | .textTheme 195 | .display1 196 | .color, 197 | size: 20.0, 198 | ), 199 | onPressed: () { 200 | if (model.currentState == PlayerState.PAUSED || 201 | model.currentState == PlayerState.STOPPED) { 202 | model.play(); 203 | } else { 204 | model.pause(); 205 | } 206 | }, 207 | ), 208 | ), 209 | ], 210 | ), 211 | ], 212 | ), 213 | ); 214 | }, 215 | ), 216 | ); 217 | } else {} 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /lib/screens/PlayList.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:beats/models/PlaylistRepo.dart'; 4 | import 'package:beats/models/SongsModel.dart'; 5 | import 'package:beats/models/PlayListHelper.dart'; 6 | 7 | import 'package:flute_music_player/flute_music_player.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 10 | import 'package:provider/provider.dart'; 11 | import '../custom_icons.dart'; 12 | import 'MusicLibrary.dart'; 13 | 14 | class PLayListScreen extends StatefulWidget { 15 | @override 16 | _PLayListScreenState createState() => _PLayListScreenState(); 17 | } 18 | 19 | class _PLayListScreenState extends State { 20 | PlaylistRepo playlistRepo; 21 | SongsModel model; 22 | String name; 23 | TextEditingController editingController; 24 | List songs; 25 | 26 | 27 | 28 | @override 29 | void didChangeDependencies() { 30 | playlistRepo = Provider.of(context); 31 | name = playlistRepo.playlist[playlistRepo.selected]; 32 | initData(); 33 | model = Provider.of(context); 34 | super.didChangeDependencies(); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | backgroundColor: Theme.of(context).backgroundColor, 41 | body: NestedScrollView( 42 | headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { 43 | return [ 44 | SliverAppBar( 45 | automaticallyImplyLeading: false, 46 | backgroundColor: Theme.of(context).backgroundColor, 47 | expandedHeight: height * 0.25, 48 | floating: true, 49 | pinned: false, 50 | snap: false, 51 | flexibleSpace: Container( 52 | height: 200, 53 | color: Colors.blue, 54 | child: Stack(children: [ 55 | Padding( 56 | padding: EdgeInsets.only( 57 | top: height * 0.01, left: width * 0.034), 58 | child: SizedBox( 59 | width: 42.0, 60 | height: 42.0, 61 | child: IconButton( 62 | iconSize: 35.0, 63 | icon: Icon( 64 | CustomIcons.arrow_circle_o_left, 65 | color: Colors.white, 66 | ), 67 | onPressed: () { 68 | Navigator.pop(context); 69 | }, 70 | ), 71 | )), 72 | Align( 73 | alignment: Alignment.center, 74 | child: Padding( 75 | padding: EdgeInsets.only(top: height * 0.02), 76 | child: Text( 77 | name, 78 | style: 79 | TextStyle(fontSize: 40.0, color: Colors.white), 80 | ), 81 | ), 82 | ), 83 | ]), 84 | )), 85 | ]; 86 | }, 87 | body: (songs != null) 88 | ? (songs.length != 0) 89 | ? Stack(children: [ 90 | ListView.builder( 91 | itemCount: songs.length, 92 | itemBuilder: (context, pos) { 93 | return Padding( 94 | padding: 95 | const EdgeInsets.only(top: 0.0, left: 10.0), 96 | child: ListTile( 97 | trailing: IconButton( 98 | icon: Icon( 99 | Icons.delete_outline, 100 | color: Colors.grey, 101 | ), 102 | onPressed: () async { 103 | model.player.stop(); 104 | await PlaylistHelper(name) 105 | .deleteSong(songs[pos]); 106 | initData(); 107 | }, 108 | ), 109 | onTap: () { 110 | //isPlayed = true; 111 | model.player.stop(); 112 | model.playlist = true; 113 | model.playlistSongs = songs; 114 | model.currentSong = songs[pos]; 115 | 116 | model.play(); 117 | }, 118 | leading: CircleAvatar(child: getImage(pos)), 119 | title: Text( 120 | songs[pos].title, 121 | maxLines: 1, 122 | style: Theme.of(context).textTheme.display3, 123 | ), 124 | subtitle: Padding( 125 | padding: const EdgeInsets.all(8.0), 126 | child: Text( 127 | songs[pos].artist, 128 | maxLines: 1, 129 | style: Theme.of(context).textTheme.display2, 130 | ), 131 | ), 132 | ), 133 | ); 134 | }, 135 | ), 136 | Align( 137 | alignment: Alignment.bottomRight, 138 | child: showStatus(), 139 | ) 140 | ]) 141 | : Center( 142 | child: Text( 143 | "No Songs", 144 | style: Theme.of(context).textTheme.display2, 145 | ), 146 | ) 147 | : Center( 148 | child: Text( 149 | "Loading...", 150 | style: Theme.of(context).textTheme.display2, 151 | ), 152 | )), 153 | ); 154 | } 155 | 156 | void initData() async { 157 | var helper = PlaylistHelper(name); 158 | songs = await helper.getSongs(); 159 | setState(() {}); 160 | } 161 | 162 | getImage(pos) { 163 | if (songs[pos].albumArt != null) { 164 | return ClipRRect( 165 | borderRadius: BorderRadius.circular(20), 166 | child: Image.file(File.fromUri(Uri.parse(songs[pos].albumArt)))); 167 | } else { 168 | return Icon(Icons.music_note); 169 | } 170 | } 171 | 172 | showStatus() { 173 | if (model.currentSong != null) { 174 | return Container( 175 | decoration: BoxDecoration( 176 | color: Colors.black, 177 | border: Border.all(color: Colors.greenAccent), 178 | borderRadius: BorderRadius.only( 179 | topLeft: Radius.circular(40.0), 180 | topRight: Radius.circular(10.0), 181 | bottomRight: Radius.elliptical(10, 4)), 182 | ), 183 | child: Padding( 184 | padding: const EdgeInsets.all(4.0), 185 | child: ListTile( 186 | leading: CircleAvatar( 187 | child: ClipRRect( 188 | borderRadius: BorderRadius.circular(40.0), 189 | child: (model.currentSong.albumArt != null) 190 | ? Image.file( 191 | File.fromUri(Uri.parse(model.currentSong.albumArt)), 192 | width: 100, 193 | height: 100, 194 | ) 195 | : Image.asset("assets/headphone.png"), 196 | )), 197 | title: Text( 198 | model.currentSong.title, 199 | maxLines: 1, 200 | style: TextStyle(color: Colors.white, fontSize: 11.0), 201 | ), 202 | subtitle: Padding( 203 | padding: const EdgeInsets.only(left: 0, top: 5.0, bottom: 10.0), 204 | child: Text( 205 | model.currentSong.artist, 206 | maxLines: 1, 207 | style: TextStyle( 208 | fontFamily: 'Sans', color: Colors.white, fontSize: 11.0), 209 | ), 210 | ), 211 | trailing: Padding( 212 | padding: const EdgeInsets.all(8.0), 213 | child: InkWell( 214 | onTap: () { 215 | if (model.currentState == PlayerState.PAUSED || 216 | model.currentState == PlayerState.STOPPED) { 217 | model.play(); 218 | } else { 219 | model.pause(); 220 | } 221 | }, 222 | child: Container( 223 | height: 30, 224 | width: 30, 225 | child: FloatingActionButton( 226 | child: (model.currentState == PlayerState.PAUSED || 227 | model.currentState == PlayerState.STOPPED) 228 | ? Icon( 229 | CustomIcons.play, 230 | size: 20.0, 231 | ) 232 | : Icon( 233 | CustomIcons.pause, 234 | size: 20.0, 235 | ), 236 | ), 237 | )), 238 | ), 239 | ), 240 | ), 241 | height: height * 0.1, 242 | width: width * 0.62, 243 | ); 244 | } else {} 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /lib/screens/Settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/Animations/transitions.dart'; 2 | import 'package:beats/Models/Username.dart'; 3 | import 'package:beats/models/ThemeModel.dart'; 4 | import 'package:flutter/cupertino.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_media_notification/flutter_media_notification.dart'; 7 | import 'package:provider/provider.dart'; 8 | import '../custom_icons.dart'; 9 | import 'package:beats/models/SongsModel.dart'; 10 | import 'MusicLibrary.dart'; 11 | import 'SetttingsSubScreens/Theme.dart'; 12 | import 'SetttingsSubScreens/PlayBack.dart'; 13 | import 'SetttingsSubScreens/About_Us.dart'; 14 | import 'package:share/share.dart'; 15 | 16 | class SettingsScreen extends StatefulWidget { 17 | @override 18 | _SettingsScreenState createState() => _SettingsScreenState(); 19 | } 20 | 21 | class _SettingsScreenState extends State { 22 | Username username; 23 | final subtitles = [ 24 | 'Customize The Look and Accent Of The App', 25 | "Change The Controls Of The Playing Screen", 26 | "Know More About Us", 27 | ]; 28 | final titles = [ 29 | 'Look ', 30 | 'Playback Screen', 31 | 'About Us', 32 | ]; 33 | final icons = [ 34 | CustomIcons.paint_brush, 35 | CustomIcons.music, 36 | CustomIcons.info_circle, 37 | ]; 38 | ThemeChanger themeChanger; 39 | TextEditingController text = new TextEditingController(); 40 | bool err = false; 41 | SongsModel model; 42 | 43 | @override 44 | void initState() { 45 | MediaNotification.setListener('next', () { 46 | setState(() { 47 | model.player.stop(); 48 | model.next(); 49 | MediaNotification.showNotification( 50 | title: model.currentSong.title, author: model.currentSong.artist); 51 | model.play(); 52 | }); 53 | }); 54 | 55 | MediaNotification.setListener('prev', () { 56 | setState(() { 57 | model.player.stop(); 58 | model.previous(); 59 | MediaNotification.showNotification( 60 | title: model.currentSong.title, author: model.currentSong.artist); 61 | model.play(); 62 | }); 63 | }); 64 | 65 | MediaNotification.setListener('pause', () { 66 | setState(() { 67 | model.pause(); 68 | }); 69 | }); 70 | MediaNotification.setListener('play', () { 71 | setState(() { 72 | model.play(); 73 | }); 74 | }); 75 | 76 | super.initState(); 77 | } 78 | 79 | @override 80 | Widget build(BuildContext context) { 81 | model = Provider.of(context); 82 | username = Provider.of(context); 83 | themeChanger = Provider.of(context); 84 | return WillPopScope( 85 | child: Scaffold( 86 | resizeToAvoidBottomInset: false, 87 | backgroundColor: Theme.of(context).backgroundColor, 88 | body: Stack( 89 | children: [ 90 | AppBar( 91 | leading: Padding( 92 | padding: 93 | EdgeInsets.only(top: height * 0.012, left: width * 0.03), 94 | child: IconButton( 95 | iconSize: 35.0, 96 | icon: Icon( 97 | CustomIcons.share_alt, 98 | color: Colors.grey, 99 | ), 100 | onPressed: () { 101 | Share.share( 102 | 'https://play.google.com/store/apps/details?id=in.selvasoft.beats'); 103 | }, 104 | ), 105 | ), 106 | actions: [ 107 | Padding( 108 | padding: EdgeInsets.only( 109 | top: height * 0.012, left: width * 0.03), 110 | child: IconButton( 111 | iconSize: 35.0, 112 | icon: Icon( 113 | CustomIcons.user, 114 | color: Colors.grey, 115 | ), 116 | onPressed: () { 117 | _displayDialog(context); 118 | }, 119 | ), 120 | ) 121 | ], 122 | backgroundColor: Theme.of(context).backgroundColor, 123 | centerTitle: true, 124 | title: Padding( 125 | padding: EdgeInsets.only(top: height * 0.022), 126 | child: Text("Settings", 127 | style: Theme.of(context).textTheme.display1), 128 | )), 129 | SingleChildScrollView( 130 | child: Column( 131 | children: [], 132 | ), 133 | ), 134 | Padding( 135 | padding: EdgeInsets.only(top: 100.0), 136 | child: Container( 137 | child: ListView.builder( 138 | itemCount: titles.length, 139 | itemBuilder: (BuildContext context, int index) { 140 | return Padding( 141 | padding: const EdgeInsets.all(10.0), 142 | child: Card( 143 | shape: RoundedRectangleBorder( 144 | borderRadius: BorderRadius.all(Radius.circular(20)), 145 | side: BorderSide( 146 | width: 0.45, color: themeChanger.accentColor)), 147 | color: Theme.of(context).cardColor, 148 | elevation: 5.0, 149 | child: Container( 150 | child: Padding( 151 | padding: const EdgeInsets.all(10.0), 152 | child: ListTile( 153 | onTap: () { 154 | switch (index) { 155 | case 0: 156 | Navigator.push( 157 | context, 158 | EnterExitRoute( 159 | exitPage: SettingsScreen(), 160 | enterPage: Themes())); 161 | break; 162 | case 1: 163 | Navigator.push( 164 | context, 165 | EnterExitRoute( 166 | exitPage: SettingsScreen(), 167 | enterPage: PlayBack())); 168 | break; 169 | case 2: 170 | Navigator.push( 171 | context, 172 | EnterExitRoute( 173 | exitPage: SettingsScreen(), 174 | enterPage: AboutUs())); 175 | break; 176 | } 177 | }, 178 | leading: Padding( 179 | padding: const EdgeInsets.only(top: 10.0), 180 | child: Icon(icons[index], color: Colors.grey), 181 | ), 182 | title: Text( 183 | titles[index], 184 | style: Theme.of(context).textTheme.display3, 185 | ), 186 | subtitle: Padding( 187 | padding: const EdgeInsets.only(top: 16.0), 188 | child: Text( 189 | subtitles[index], 190 | style: TextStyle( 191 | fontSize: 14, 192 | color: Theme.of(context) 193 | .textTheme 194 | .display1 195 | .color), 196 | ), 197 | ), 198 | ), 199 | ), 200 | ), 201 | ), 202 | ); 203 | }, 204 | ), 205 | ), 206 | ) 207 | ], 208 | ), 209 | ), 210 | onWillPop: () { 211 | return null; 212 | }, 213 | ); 214 | } 215 | 216 | _displayDialog(BuildContext context) async { 217 | return showDialog( 218 | context: context, 219 | builder: (context) { 220 | return Padding( 221 | padding: const EdgeInsets.all(8.0), 222 | child: AlertDialog( 223 | shape: Border.all(color: Colors.greenAccent), 224 | backgroundColor: Theme.of(context).backgroundColor, 225 | title: Text( 226 | 'Enter your name!', 227 | style: Theme.of(context).textTheme.display2, 228 | ), 229 | content: TextFormField( 230 | maxLength: 10, 231 | controller: text, 232 | decoration: InputDecoration( 233 | errorText: err ? "Whats in a name?" : null, 234 | errorStyle: Theme.of(context).textTheme.display2, 235 | labelText: "Enter Name", 236 | labelStyle: Theme.of(context).textTheme.display2, 237 | border: OutlineInputBorder( 238 | borderRadius: BorderRadius.circular(10))), 239 | ), 240 | actions: [ 241 | new FlatButton( 242 | child: new Text( 243 | 'Set', 244 | style: Theme.of(context).textTheme.display2, 245 | ), 246 | onPressed: () { 247 | validate(context); 248 | }, 249 | ) 250 | ], 251 | ), 252 | ); 253 | }); 254 | } 255 | 256 | void validate(context) { 257 | setState(() { 258 | text.text.isEmpty ? err = true : err = false; 259 | }); 260 | if (text.text.isNotEmpty) { 261 | username.setName(text.text.toString()); 262 | text.clear(); 263 | Navigator.of(context).pop(); 264 | } else {} 265 | } 266 | } 267 | -------------------------------------------------------------------------------- /lib/screens/SetttingsSubScreens/About_Us.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/models/SongsModel.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | import '../../custom_icons.dart'; 5 | import 'package:url_launcher/url_launcher.dart'; 6 | import '../MusicLibrary.dart'; 7 | 8 | class AboutUs extends StatefulWidget { 9 | @override 10 | _AboutUsState createState() => _AboutUsState(); 11 | } 12 | 13 | class _AboutUsState extends State { 14 | SongsModel model; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | model = Provider.of(context); 19 | return Scaffold( 20 | body: Stack( 21 | children: [ 22 | AppBar( 23 | leading: IconButton( 24 | iconSize: 25.0, 25 | icon: Icon( 26 | Icons.arrow_back, 27 | color: Colors.grey, 28 | ), 29 | onPressed: () { 30 | Navigator.pop(context); 31 | }, 32 | ), 33 | backgroundColor: Theme.of(context).backgroundColor, 34 | centerTitle: false, 35 | title: Text("About", style: Theme.of(context).textTheme.display1), 36 | ), 37 | Padding( 38 | padding: EdgeInsets.only(top: height * 0.07), 39 | child: SingleChildScrollView( 40 | child: Column( 41 | children: [ 42 | Align( 43 | child: Padding( 44 | padding: EdgeInsets.only(top: height * 0.03), 45 | child: Card( 46 | elevation: 20.0, 47 | child: Container( 48 | height: height * 0.2, 49 | width: width * 0.9, 50 | decoration: const BoxDecoration( 51 | gradient: LinearGradient( 52 | colors: [ 53 | Color(0xFF0D47A1), 54 | Color(0xFF1976D2), 55 | Color(0xFF42A5F5), 56 | ], 57 | ), 58 | borderRadius: 59 | BorderRadius.all(Radius.circular(10.0))), 60 | child: Stack( 61 | children: [ 62 | Positioned( 63 | left: width * 0.12, 64 | top: height * 0.065, 65 | child: CircleAvatar( 66 | child: Icon(CustomIcons.user), 67 | ), 68 | ), 69 | Positioned( 70 | left: width * 0.3, 71 | top: height * 0.05, 72 | child: Text.rich(TextSpan( 73 | text: "Selva,\n", 74 | style: TextStyle( 75 | color: Colors.white, 76 | fontSize: 25, 77 | ), 78 | children: [ 79 | new TextSpan( 80 | text: 'Lead Developer', 81 | style: TextStyle( 82 | color: Colors.white, 83 | fontSize: 17)) 84 | ]))), 85 | Positioned( 86 | left: width * 0.27, 87 | top: height * 0.135, 88 | child: IconButton( 89 | color: Colors.transparent, 90 | icon: Icon( 91 | CustomIcons.paper_plane, 92 | color: Colors.white, 93 | ), 94 | onPressed: _launchTg, 95 | ), 96 | ), 97 | ], 98 | ), 99 | ), 100 | ), 101 | ), 102 | ), 103 | Align( 104 | child: Padding( 105 | padding: EdgeInsets.only(top: height * 0.03), 106 | child: Card( 107 | elevation: 15.0, 108 | child: Container( 109 | height: height * 0.2, 110 | width: width * 0.9, 111 | decoration: const BoxDecoration( 112 | gradient: LinearGradient( 113 | colors: [ 114 | Color(0xff007991), 115 | Color(0xFF78ffd6), 116 | ], 117 | ), 118 | borderRadius: 119 | BorderRadius.all(Radius.circular(10.0))), 120 | child: Stack( 121 | children: [ 122 | Positioned( 123 | left: width * 0.12, 124 | top: height * 0.065, 125 | child: CircleAvatar( 126 | backgroundColor: Colors.green, 127 | child: Icon(CustomIcons.user, 128 | color: Colors.white), 129 | ), 130 | ), 131 | Positioned( 132 | left: width * 0.3, 133 | top: height * 0.05, 134 | child: Text.rich(TextSpan( 135 | text: "OjasK,\n", 136 | style: TextStyle( 137 | color: Colors.white, 138 | fontSize: 25, 139 | ), 140 | children: [ 141 | new TextSpan( 142 | text: 'Lead Developer', 143 | style: TextStyle( 144 | color: Colors.white, 145 | fontSize: 17)) 146 | ]))), 147 | Positioned( 148 | left: width * 0.27, 149 | top: height * 0.135, 150 | child: IconButton( 151 | color: Colors.transparent, 152 | icon: Icon( 153 | CustomIcons.instagram, 154 | color: Colors.white, 155 | ), 156 | onPressed: _launchInsta, 157 | ), 158 | ), 159 | Positioned( 160 | left: width * 0.35, 161 | top: height * 0.135, 162 | child: IconButton( 163 | color: Colors.transparent, 164 | icon: Icon( 165 | CustomIcons.google, 166 | color: Colors.white, 167 | ), 168 | onPressed: _launchGmail, 169 | ), 170 | ), 171 | ], 172 | ), 173 | ), 174 | ), 175 | ), 176 | ), 177 | Align( 178 | child: Padding( 179 | padding: EdgeInsets.only(top: height * 0.03), 180 | child: Card( 181 | elevation: 10.0, 182 | child: Container( 183 | height: height * 0.3, 184 | width: width * 0.9, 185 | decoration: const BoxDecoration( 186 | gradient: LinearGradient( 187 | colors: [ 188 | Color(0xffFF5F6D), 189 | Color(0xFFFFC371), 190 | ], 191 | ), 192 | borderRadius: 193 | BorderRadius.all(Radius.circular(10.0))), 194 | child: Column( 195 | children: [ 196 | Padding( 197 | padding: const EdgeInsets.all(8.0), 198 | child: Text( 199 | "Special Thanks To:", 200 | style: TextStyle( 201 | color: Colors.white, fontSize: 20), 202 | ), 203 | ), 204 | Padding( 205 | padding: EdgeInsets.only(top: height * 0.02), 206 | child: Text( 207 | "1. Pawan For The Flute Plugin\n\n2. Launcher Icon Made by Freepik from\n www.flaticon.com", 208 | textAlign: TextAlign.start, 209 | style: TextStyle( 210 | color: Colors.white, fontSize: 16), 211 | ), 212 | ), 213 | Padding( 214 | padding: EdgeInsets.only(top: height * 0.02), 215 | child: Text( 216 | "3.The Designer Behind the Images Used", 217 | textAlign: TextAlign.start, 218 | style: TextStyle( 219 | color: Colors.white, fontSize: 16), 220 | ), 221 | ), 222 | ], 223 | ), 224 | ), 225 | ), 226 | ), 227 | ), 228 | ], 229 | ), 230 | )) 231 | ], 232 | ), 233 | ); 234 | } 235 | } 236 | 237 | _launchInsta() async { 238 | const uri = 'https://www.instagram.com/ojask002/'; 239 | if (await canLaunch(uri)) { 240 | await launch(uri); 241 | } else { 242 | // iOS 243 | const uri = 'https://www.instagram.com/ojask002/'; 244 | if (await canLaunch(uri)) { 245 | await launch(uri); 246 | } else { 247 | throw 'Could not launch $uri'; 248 | } 249 | } 250 | } 251 | 252 | _launchTg() async { 253 | const uri = 'https://selvasoft.in/'; 254 | if (await canLaunch(uri)) { 255 | await launch(uri); 256 | } else { 257 | // iOS 258 | const uri = 'https://selvasoft.in/'; 259 | if (await canLaunch(uri)) { 260 | await launch(uri); 261 | } else { 262 | throw 'Could not launch $uri'; 263 | } 264 | } 265 | } 266 | 267 | _launchGmail() async { 268 | const uri = 'mailto:?subject=Regarding Beats&body='; 269 | if (await canLaunch(uri)) { 270 | await launch(uri); 271 | } else { 272 | // iOS 273 | const uri = 'https://mail.google.com/'; 274 | if (await canLaunch(uri)) { 275 | await launch(uri); 276 | } else { 277 | throw 'Could not launch $uri'; 278 | } 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /lib/screens/MusicLibrary.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/Animations/transitions.dart'; 2 | import 'package:beats/Models/PlayListHelper.dart'; 3 | import 'package:beats/models/PlaylistRepo.dart'; 4 | import 'package:beats/models/ThemeModel.dart'; 5 | import 'package:beats/models/BookmarkModel.dart'; 6 | import 'package:beats/models/const.dart'; 7 | import 'package:flute_music_player/flute_music_player.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'dart:io'; 10 | import 'package:beats/models/SongsModel.dart'; 11 | import '../custom_icons.dart'; 12 | import 'package:provider/provider.dart'; 13 | import 'Player.dart'; 14 | 15 | double height, width; 16 | 17 | class Library extends StatelessWidget { 18 | TextEditingController editingController; 19 | 20 | SongsModel model; 21 | 22 | BookmarkModel b; 23 | 24 | ThemeChanger themeChanger; 25 | 26 | TextEditingController txt = TextEditingController(); 27 | 28 | bool error = false; 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | model = Provider.of(context); 33 | b = Provider.of(context); 34 | height = MediaQuery.of(context).size.height; 35 | width = MediaQuery.of(context).size.width; 36 | themeChanger = Provider.of(context); 37 | return WillPopScope( 38 | child: Scaffold( 39 | resizeToAvoidBottomInset: false, 40 | backgroundColor: Theme.of(context).backgroundColor, 41 | body: (model.songs == null) 42 | ? Center( 43 | child: Text( 44 | "No Songs", 45 | style: Theme.of(context).textTheme.display1, 46 | ), 47 | ) 48 | : NestedScrollView( 49 | headerSliverBuilder: (context, innerBoxIsScrolled) => [ 50 | SliverOverlapAbsorber( 51 | child: SliverSafeArea( 52 | top: false, 53 | sliver: SliverAppBar( 54 | actions: [ 55 | Padding( 56 | padding: const EdgeInsets.only(right: 20), 57 | child: IconButton( 58 | icon: Icon(Icons.search, 59 | color: Theme.of(context) 60 | .textTheme 61 | .display1 62 | .color), 63 | onPressed: () { 64 | showSearch( 65 | context: context, 66 | delegate: Search()); 67 | }, 68 | ), 69 | ), 70 | ], 71 | backgroundColor: 72 | Theme.of(context).backgroundColor, 73 | expandedHeight: height * 0.11, 74 | pinned: true, 75 | flexibleSpace: Align( 76 | alignment: Alignment.centerLeft, 77 | child: Padding( 78 | padding: 79 | EdgeInsets.only(left: width * 0.06), 80 | child: Container( 81 | child: Stack( 82 | children: [ 83 | Text( 84 | "Songs", 85 | style: TextStyle( 86 | fontWeight: FontWeight.bold, 87 | fontSize: 30, 88 | color: Theme.of(context) 89 | .textTheme 90 | .display1 91 | .color), 92 | ), 93 | ], 94 | ), 95 | ), 96 | ), 97 | ), 98 | ), 99 | ), 100 | handle: 101 | NestedScrollView.sliverOverlapAbsorberHandleFor( 102 | context)) 103 | ], 104 | body: Stack( 105 | children: [ 106 | Column( 107 | children: [getLoading(model)], 108 | ), 109 | Align( 110 | alignment: Alignment.bottomLeft, 111 | child: showStatus(model, context), 112 | ) 113 | ], 114 | ))), 115 | onWillPop: () {}, 116 | ); 117 | } 118 | 119 | getLoading(SongsModel model) { 120 | if (model.songs.length == 0) { 121 | return Expanded( 122 | child: Center( 123 | child: CircularProgressIndicator(), 124 | )); 125 | } else { 126 | return Expanded( 127 | child: ListView.builder( 128 | itemCount: model.songs.length, 129 | itemBuilder: (context, pos) { 130 | return Consumer(builder: (context, repo, _) { 131 | return ListTile( 132 | trailing: PopupMenuButton( 133 | icon: Icon( 134 | Icons.more_vert, 135 | color: Colors.grey, 136 | ), 137 | onSelected: (String choice) async { 138 | print("debug " + choice); 139 | if (choice == Constants.pl) { 140 | showDialog( 141 | context: context, 142 | builder: (context) { 143 | return SimpleDialog( 144 | shape: RoundedRectangleBorder( 145 | side: BorderSide(), 146 | borderRadius: 147 | BorderRadius.all(Radius.circular(30.0)), 148 | ), 149 | backgroundColor: 150 | Theme.of(context).backgroundColor, 151 | children: [ 152 | Row( 153 | mainAxisAlignment: 154 | MainAxisAlignment.spaceEvenly, 155 | children: [ 156 | Padding( 157 | padding: const EdgeInsets.all(8.0), 158 | child: Text( 159 | "Add to Playlist", 160 | style: Theme.of(context) 161 | .textTheme 162 | .display1, 163 | ), 164 | ), 165 | ], 166 | ), 167 | Container( 168 | width: double.maxFinite, 169 | child: (repo.playlist.length != 0) 170 | ? ListView.builder( 171 | shrinkWrap: true, 172 | itemCount: repo.playlist.length, 173 | itemBuilder: (context, index) { 174 | return Padding( 175 | padding: 176 | EdgeInsets.only(left: 10.0), 177 | child: ListTile( 178 | onTap: () { 179 | PlaylistHelper( 180 | repo.playlist[index]) 181 | .add(model.songs[pos]); 182 | Navigator.pop(context); 183 | }, 184 | title: Text( 185 | repo.playlist[index], 186 | style: Theme.of(context) 187 | .textTheme 188 | .display2, 189 | ), 190 | ), 191 | ); 192 | }, 193 | ) 194 | : Center( 195 | child: Text("No Playlist"), 196 | ), 197 | ) 198 | ], 199 | ); 200 | }); 201 | } // else if (choice == Constants.bm) { 202 | // if (!b.alreadyExists(model.songs[pos])) { 203 | // b.add(model.songs[pos]); 204 | // } else { 205 | // b.remove(model.songs[pos]); 206 | // } 207 | //} else if (choice == Constants.de) { 208 | 209 | // model.fetchSongs(); 210 | // }else if(choice == Constants.re){ 211 | // Directory x = await getExternalStorageDirectory(); 212 | // await File("${x.path}../../").rename(x.path); 213 | //} 214 | }, 215 | itemBuilder: (BuildContext context) { 216 | return Constants.choices.map((String choice) { 217 | return PopupMenuItem( 218 | value: choice, 219 | child: Padding( 220 | padding: const EdgeInsets.all(8.0), 221 | child: Text( 222 | choice, 223 | style: Theme.of(context).textTheme.display2, 224 | ), 225 | ), 226 | ); 227 | }).toList(); 228 | }, 229 | ), 230 | onTap: () async { 231 | model.player.stop(); 232 | model.playlist = false; 233 | model.currentSong = model.songs[pos]; 234 | 235 | 236 | //Reset the list. So we can change to next song. 237 | model.play(); 238 | }, 239 | leading: CircleAvatar(child: getImage(model, pos)), 240 | title: Text( 241 | model.songs[pos].title, 242 | maxLines: 1, 243 | style: TextStyle( 244 | fontSize: 15, 245 | fontWeight: FontWeight.w700, 246 | fontFamily: 'Sans'), 247 | ), 248 | subtitle: Padding( 249 | padding: const EdgeInsets.only(top: 10.0), 250 | child: Text( 251 | model.songs[pos].artist, 252 | maxLines: 1, 253 | style: TextStyle( 254 | color: Theme.of(context).textTheme.display1.color, 255 | fontSize: 12, 256 | fontFamily: 'Sans'), 257 | ), 258 | ), 259 | ); 260 | }); 261 | }, 262 | ), 263 | ); 264 | } 265 | } 266 | 267 | getImage(model, pos) { 268 | if (model.songs[pos].albumArt != null) { 269 | return ClipRRect( 270 | borderRadius: BorderRadius.circular(20), 271 | child: 272 | Image.file(File.fromUri(Uri.parse(model.songs[pos].albumArt)))); 273 | } else { 274 | return Container( 275 | child: IconButton( 276 | onPressed: null, 277 | icon: Icon( 278 | Icons.music_note, 279 | color: Colors.white, 280 | ), 281 | ), 282 | decoration: BoxDecoration( 283 | borderRadius: BorderRadius.circular(70), 284 | // Box decoration takes a gradient 285 | gradient: LinearGradient( 286 | colors: [ 287 | themeChanger.accentColor, 288 | Color(0xFF1976D2), 289 | Color(0xFF42A5F5), 290 | ], 291 | ), 292 | )); 293 | } 294 | } 295 | 296 | push(context) { 297 | Navigator.push(context, SlideRightRoute(page: PlayBackPage())); 298 | } 299 | 300 | showStatus(model, BuildContext context) { 301 | if (model.currentSong != null) { 302 | return Container( 303 | decoration: BoxDecoration( 304 | color: Theme.of(context).backgroundColor, 305 | border: Border( 306 | top: BorderSide( 307 | color: Theme.of(context).textTheme.display1.color, 308 | ), 309 | )), 310 | height: height * 0.06, 311 | width: width, 312 | child: ListView.builder( 313 | scrollDirection: Axis.horizontal, 314 | itemCount: 1, 315 | itemBuilder: (context, pos) { 316 | return GestureDetector( 317 | onTap: () { 318 | Navigator.push(context, Scale(page: PlayBackPage())); 319 | }, 320 | child: Stack( 321 | children: [ 322 | Row( 323 | children: [ 324 | IconButton( 325 | color: Theme.of(context).textTheme.display1.color, 326 | icon: Icon(Icons.arrow_drop_up), 327 | onPressed: () { 328 | Navigator.push(context, Scale(page: PlayBackPage())); 329 | }, 330 | ), 331 | Container( 332 | width: width * 0.75, 333 | child: Padding( 334 | padding: EdgeInsets.only(left: 20.0), 335 | child: Text( 336 | model.currentSong.title, 337 | style: Theme.of(context).textTheme.display2, 338 | maxLines: 1, 339 | ), 340 | ), 341 | ), 342 | Padding( 343 | padding: EdgeInsets.only(right: 20), 344 | child: IconButton( 345 | icon: model.currentState == PlayerState.PAUSED || 346 | model.currentState == PlayerState.STOPPED 347 | ? Icon( 348 | CustomIcons.play, 349 | color: Theme.of(context) 350 | .textTheme 351 | .display1 352 | .color, 353 | size: 20.0, 354 | ) 355 | : Icon( 356 | CustomIcons.pause, 357 | color: Theme.of(context) 358 | .textTheme 359 | .display1 360 | .color, 361 | size: 20.0, 362 | ), 363 | onPressed: () { 364 | if (model.currentState == PlayerState.PAUSED || 365 | model.currentState == PlayerState.STOPPED) { 366 | model.play(); 367 | 368 | 369 | } else { 370 | 371 | model.pause(); 372 | } 373 | }, 374 | ), 375 | ), 376 | ], 377 | ), 378 | ], 379 | ), 380 | ); 381 | }, 382 | ), 383 | ); 384 | } else {} 385 | } 386 | } 387 | 388 | class Search extends SearchDelegate { 389 | SongsModel model; 390 | @override 391 | List buildActions(BuildContext context) { 392 | // actions 393 | return [ 394 | IconButton( 395 | onPressed: () { 396 | query = ""; 397 | }, 398 | icon: Icon( 399 | Icons.clear, 400 | color: Colors.grey, 401 | ), 402 | ) 403 | ]; 404 | } 405 | 406 | @override 407 | Widget buildLeading(BuildContext context) { 408 | // Leading 409 | return IconButton( 410 | onPressed: () { 411 | close(context, null); 412 | }, 413 | icon: Icon( 414 | Icons.arrow_back, 415 | color: Colors.grey, 416 | )); 417 | } 418 | 419 | @override 420 | Widget buildResults(BuildContext context) { 421 | // show results 422 | return null; 423 | } 424 | 425 | @override 426 | Widget buildSuggestions(BuildContext context) { 427 | model = Provider.of(context); 428 | List dummy = []; 429 | List recents = []; 430 | for (int i = 0; i < model.songs.length; i++) { 431 | dummy.add(model.songs[i]); 432 | } 433 | //for (int i = 0; i < 4; i++) { 434 | // recents.add(model.songs[i].title); 435 | //} 436 | var suggestion = query.isEmpty 437 | ? recents 438 | : dummy 439 | .where((p) => p.title.toLowerCase().startsWith(query.toLowerCase())) 440 | .toList(); 441 | // hint when searches 442 | return ListView.builder( 443 | itemCount: suggestion.length, 444 | itemBuilder: (BuildContext context, int index) { 445 | return Padding( 446 | padding: const EdgeInsets.all(8.0), 447 | child: ListTile( 448 | onTap: () { 449 | model.player.stop(); 450 | model.playURI(suggestion[index].uri); 451 | model.playlist = false; 452 | close(context, null); 453 | }, 454 | title: Text.rich( 455 | TextSpan( 456 | text: suggestion[index].title + "\n", 457 | style: TextStyle( 458 | color: Colors.black, 459 | fontWeight: FontWeight.w800, 460 | fontSize: 19, 461 | ), 462 | children: [ 463 | new TextSpan( 464 | text: suggestion[index].artist, 465 | style: TextStyle( 466 | color: Colors.black, 467 | fontSize: 17, 468 | fontWeight: FontWeight.w100)) 469 | ]), 470 | style: TextStyle(color: Colors.black, fontSize: 18), 471 | ), 472 | leading: CircleAvatar(child: Icon(Icons.music_note)), 473 | ), 474 | ); 475 | }, 476 | ); 477 | } 478 | } 479 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.beats; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.example.beats; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.beats; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /lib/screens/HomeScreen.dart: -------------------------------------------------------------------------------- 1 | import 'package:beats/Models/Username.dart'; 2 | import 'package:beats/models/PlayListHelper.dart'; 3 | import 'package:beats/screens/Recents.dart'; 4 | import 'package:beats/models/PlaylistRepo.dart'; 5 | //import 'package:beats/Models/playlist_repo.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:provider/provider.dart'; 8 | import 'MusicLibrary.dart'; 9 | import 'PlayList.dart'; 10 | 11 | class HomeScreen extends StatefulWidget { 12 | @override 13 | _HomeScreenState createState() => _HomeScreenState(); 14 | } 15 | 16 | class _HomeScreenState extends State { 17 | Username username; 18 | TextEditingController txt = TextEditingController(); 19 | bool error = false; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | username = Provider.of(context); 24 | return WillPopScope( 25 | child: Scaffold( 26 | resizeToAvoidBottomInset: false, 27 | backgroundColor: Theme.of(context).backgroundColor, 28 | body: Column( 29 | children: [ 30 | Container( 31 | height: height * 0.25, 32 | child: Stack( 33 | children: [ 34 | Column( 35 | children: [ 36 | Padding( 37 | padding: EdgeInsets.only( 38 | top: height * 0.08, left: width * 0.1), 39 | child: Text( 40 | username.getName() + ",", 41 | style: Theme.of(context).textTheme.headline, 42 | ), 43 | ), 44 | Padding( 45 | padding: EdgeInsets.only( 46 | top: height * 0.005, left: width * 0.1), 47 | child: Text("Welcome", 48 | style: Theme.of(context).textTheme.subhead), 49 | ), 50 | ], 51 | ), 52 | Align( 53 | alignment: Alignment.topRight, 54 | child: Image.asset("assets/headphone.png")) 55 | ], 56 | ), 57 | ), 58 | Padding( 59 | padding: EdgeInsets.only(top: height * 0.04), 60 | child: SizedBox( 61 | height: height * 0.27, 62 | child: Consumer( 63 | builder: (context, playlistRepo, _) => ListView.builder( 64 | itemCount: playlistRepo.playlist.length + 1, 65 | itemBuilder: (context, pos) { 66 | var padd = (pos == 0) ? width * 0.08 : 5.0; 67 | if (pos == (playlistRepo.playlist.length)) { 68 | return GestureDetector( 69 | onTap: () { 70 | showDialog( 71 | context: context, 72 | builder: (context) { 73 | return Padding( 74 | padding: const EdgeInsets.all(8.0), 75 | child: AlertDialog( 76 | backgroundColor: 77 | Theme.of(context).backgroundColor, 78 | shape: RoundedRectangleBorder( 79 | side: BorderSide(), 80 | borderRadius: BorderRadius.all( 81 | Radius.circular(30.0)), 82 | ), 83 | contentPadding: EdgeInsets.only(top: 10.0), 84 | content: Container( 85 | width: 200.0, 86 | child: Column( 87 | mainAxisAlignment: 88 | MainAxisAlignment.start, 89 | crossAxisAlignment: 90 | CrossAxisAlignment.stretch, 91 | mainAxisSize: MainAxisSize.min, 92 | children: [ 93 | Row( 94 | mainAxisAlignment: 95 | MainAxisAlignment.spaceEvenly, 96 | mainAxisSize: MainAxisSize.min, 97 | children: [ 98 | Text( 99 | "New Playlist", 100 | style: TextStyle( 101 | fontSize: 24.0, 102 | fontFamily: 'Sans'), 103 | ), 104 | ], 105 | ), 106 | SizedBox( 107 | height: 5.0, 108 | ), 109 | Divider( 110 | color: Colors.grey, 111 | height: 4.0, 112 | ), 113 | Padding( 114 | padding: EdgeInsets.only( 115 | left: 30.0, 116 | right: 30.0, 117 | top: 30.0, 118 | bottom: 30.0), 119 | child: TextFormField( 120 | controller: txt, 121 | decoration: InputDecoration( 122 | disabledBorder: 123 | OutlineInputBorder( 124 | borderSide: BorderSide( 125 | color: Colors 126 | .greenAccent)), 127 | enabledBorder: 128 | OutlineInputBorder( 129 | borderSide: BorderSide( 130 | color: Colors 131 | .greenAccent)), 132 | errorText: error 133 | ? "Name cant be null" 134 | : null, 135 | errorStyle: Theme.of(context) 136 | .textTheme 137 | .display2, 138 | labelText: "Enter Name", 139 | labelStyle: Theme.of(context) 140 | .textTheme 141 | .display2, 142 | border: OutlineInputBorder( 143 | borderRadius: 144 | BorderRadius.circular( 145 | 4))), 146 | ), 147 | ), 148 | InkWell( 149 | onTap: () { 150 | validate(context, playlistRepo); 151 | }, 152 | child: Container( 153 | padding: EdgeInsets.only( 154 | top: 10.0, bottom: 20.0), 155 | decoration: BoxDecoration( 156 | color: Colors.blue, 157 | borderRadius: BorderRadius.only( 158 | bottomLeft: 159 | Radius.circular(32.0), 160 | bottomRight: 161 | Radius.circular(32.0)), 162 | ), 163 | child: Text( 164 | "Create!", 165 | style: TextStyle( 166 | fontFamily: 'Sans', 167 | color: Colors.white), 168 | textAlign: TextAlign.center, 169 | ), 170 | ), 171 | ), 172 | ], 173 | ), 174 | ), 175 | ), 176 | ); 177 | }, 178 | ); 179 | }, 180 | child: Card( 181 | margin: EdgeInsets.only(left: padd, right: 5.0), 182 | elevation: 5, 183 | shape: RoundedRectangleBorder( 184 | side: BorderSide(color: Colors.greenAccent), 185 | borderRadius: BorderRadius.circular(20)), 186 | child: ClipRRect( 187 | borderRadius: BorderRadius.circular(20), 188 | child: Container( 189 | width: width * 0.4, 190 | child: Center( 191 | child: Icon( 192 | Icons.add, 193 | size: 25, 194 | )))), 195 | ), 196 | ); 197 | } else { 198 | return Card( 199 | margin: EdgeInsets.only(left: padd, right: 5.0), 200 | elevation: 20, 201 | shape: RoundedRectangleBorder( 202 | borderRadius: BorderRadius.circular(20)), 203 | child: GestureDetector( 204 | onTap: () { 205 | playlistRepo.selected = pos; 206 | Navigator.of(context).push(new MaterialPageRoute( 207 | builder: (context) => new PLayListScreen())); 208 | }, 209 | child: ClipRRect( 210 | borderRadius: BorderRadius.circular(20), 211 | child: Container( 212 | width: width * 0.4, 213 | decoration: BoxDecoration( 214 | // Box decoration takes a gradient 215 | gradient: LinearGradient( 216 | // Where the linear gradient begins and ends 217 | begin: Alignment.topRight, 218 | end: Alignment.bottomLeft, 219 | // Add one stop for each color. Stops should increase from 0 to 1 220 | stops: [0.1, 0.5, 0.7, 0.9], 221 | colors: pos % 2 == 0 222 | ? [ 223 | Colors.lightBlue, 224 | Colors.blue, 225 | Colors.blueAccent, 226 | Colors.blue, 227 | ] 228 | : [ 229 | Colors.pinkAccent, 230 | Colors.pink, 231 | Colors.pinkAccent, 232 | Colors.pink, 233 | ], 234 | ), 235 | ), 236 | child: Stack(children: [ 237 | Align( 238 | alignment: Alignment.topRight, 239 | child: Padding( 240 | padding: 241 | const EdgeInsets.only(top: 8.0), 242 | child: IconButton( 243 | icon: Icon( 244 | Icons.delete_outline, 245 | size: 17, 246 | color: Colors.white, 247 | ), 248 | onPressed: () async { 249 | PlaylistHelper temp = 250 | await PlaylistHelper( 251 | playlistRepo.playlist[pos]); 252 | temp.deletePlaylist(); 253 | playlistRepo.delete( 254 | playlistRepo.playlist[pos]); 255 | //playlistRepo.init(); 256 | }, 257 | ), 258 | ), 259 | ), 260 | Align( 261 | alignment: Alignment.topRight, 262 | child: Padding( 263 | padding: const EdgeInsets.only( 264 | right: 30.0, top: 8.0), 265 | child: IconButton( 266 | icon: Icon( 267 | Icons.edit, 268 | size: 17, 269 | color: Colors.white, 270 | ), 271 | onPressed: () { 272 | showDialog( 273 | context: context, 274 | builder: (context) { 275 | return Padding( 276 | padding: 277 | const EdgeInsets.all(8.0), 278 | child: AlertDialog( 279 | backgroundColor: 280 | Theme.of(context) 281 | .backgroundColor, 282 | shape: 283 | RoundedRectangleBorder( 284 | side: BorderSide(), 285 | borderRadius: 286 | BorderRadius.all( 287 | Radius.circular( 288 | 30.0)), 289 | ), 290 | contentPadding: 291 | EdgeInsets.only( 292 | top: 10.0), 293 | content: Container( 294 | width: 200.0, 295 | child: Column( 296 | mainAxisAlignment: 297 | MainAxisAlignment 298 | .start, 299 | crossAxisAlignment: 300 | CrossAxisAlignment 301 | .stretch, 302 | mainAxisSize: 303 | MainAxisSize.min, 304 | children: [ 305 | Row( 306 | mainAxisAlignment: 307 | MainAxisAlignment 308 | .spaceEvenly, 309 | mainAxisSize: 310 | MainAxisSize 311 | .min, 312 | children: [ 313 | Text( 314 | "Edit", 315 | style: TextStyle( 316 | fontSize: 317 | 24.0, 318 | fontFamily: 319 | 'Sans'), 320 | ), 321 | ], 322 | ), 323 | SizedBox( 324 | height: 5.0, 325 | ), 326 | Divider( 327 | color: Colors.grey, 328 | height: 4.0, 329 | ), 330 | Padding( 331 | padding: 332 | EdgeInsets.only( 333 | left: 30.0, 334 | right: 30.0, 335 | top: 30.0, 336 | bottom: 337 | 30.0), 338 | child: 339 | TextFormField( 340 | controller: txt, 341 | decoration: InputDecoration( 342 | disabledBorder: OutlineInputBorder( 343 | borderSide: BorderSide( 344 | color: Colors 345 | .greenAccent)), 346 | enabledBorder: OutlineInputBorder( 347 | borderSide: BorderSide( 348 | color: Colors 349 | .greenAccent)), 350 | errorText: error 351 | ? "Name cant be null" 352 | : null, 353 | errorStyle: Theme.of( 354 | context) 355 | .textTheme 356 | .display2, 357 | labelText: 358 | "Enter Name", 359 | labelStyle: Theme.of( 360 | context) 361 | .textTheme 362 | .display2, 363 | border: OutlineInputBorder( 364 | borderRadius: 365 | BorderRadius.circular( 366 | 4))), 367 | ), 368 | ), 369 | InkWell( 370 | onTap: () async { 371 | await PlaylistHelper( 372 | playlistRepo 373 | .playlist[ 374 | pos]) 375 | .rename( 376 | txt.text); 377 | setState(() { 378 | playlistRepo.playlist[ 379 | pos] = 380 | txt.text; 381 | //PlaylistHelper(playlistRepo.playlist[pos]).rename(txt.text); 382 | playlistRepo 383 | .push(); 384 | Navigator.pop( 385 | context); 386 | }); 387 | }, 388 | child: Container( 389 | padding: EdgeInsets 390 | .only( 391 | top: 10.0, 392 | bottom: 393 | 20.0), 394 | decoration: 395 | BoxDecoration( 396 | color: 397 | Colors.blue, 398 | borderRadius: BorderRadius.only( 399 | bottomLeft: 400 | Radius.circular( 401 | 32.0), 402 | bottomRight: 403 | Radius.circular( 404 | 32.0)), 405 | ), 406 | child: Text( 407 | "Done", 408 | style: TextStyle( 409 | fontFamily: 410 | 'Sans', 411 | color: Colors 412 | .white), 413 | textAlign: 414 | TextAlign 415 | .center, 416 | ), 417 | ), 418 | ), 419 | ], 420 | ), 421 | ), 422 | ), 423 | ); 424 | }, 425 | ); 426 | }, 427 | ), 428 | ), 429 | ), 430 | Center( 431 | child: Text(playlistRepo.playlist[pos], 432 | style: 433 | TextStyle(color: Colors.white))) 434 | ]), 435 | )), 436 | ), 437 | ); 438 | } 439 | }, 440 | scrollDirection: Axis.horizontal, 441 | ), 442 | ), 443 | )), 444 | Padding( 445 | padding: EdgeInsets.only(top: height * 0.06), 446 | child: Align( 447 | alignment: Alignment.center, 448 | child: Text( 449 | "Recently Played", 450 | style: Theme.of(context).textTheme.display1, 451 | ), 452 | ), 453 | ), 454 | Expanded( 455 | child: LastPlayed(), 456 | ) 457 | ], 458 | ), 459 | ), onWillPop: () {}, 460 | ); 461 | } 462 | 463 | void validate(context, repo) { 464 | setState(() { 465 | txt.text.toString().isEmpty ? error = true : error = false; 466 | }); 467 | if (txt.text.toString().isNotEmpty) { 468 | repo.add(txt.text); 469 | txt.clear(); 470 | Navigator.of(context).pop(); 471 | } else {} 472 | } 473 | } 474 | --------------------------------------------------------------------------------