@ -1,13 +0,0 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
@ -1,71 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.justmusic"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.justmusic">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
@ -1,34 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.justmusic">
|
||||
<application
|
||||
android:label="justmusic"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
</manifest>
|
@ -1,6 +0,0 @@
|
||||
package com.example.justmusic
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
Before Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,8 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.justmusic">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
@ -1,31 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
@ -1,5 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
@ -1,11 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,71 @@
|
||||
import 'package:flutter/Material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:justmusic/components/play_button_component.dart';
|
||||
import 'package:justmusic/values/constants.dart';
|
||||
|
||||
class MusicListComponent extends StatelessWidget {
|
||||
const MusicListComponent({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(bottom: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
const ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
child: Image(
|
||||
image: AssetImage("assets/images/exemple_cover.png"),
|
||||
width: 60,
|
||||
height: 60,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
flex: 10,
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
direction: Axis.vertical,
|
||||
runSpacing: 3,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Wrap(
|
||||
verticalDirection: VerticalDirection.up,
|
||||
spacing: 5,
|
||||
runSpacing: 8,
|
||||
runAlignment: WrapAlignment.end,
|
||||
alignment: WrapAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"A.C. Milan",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
Icon(
|
||||
Icons.explicit,
|
||||
color: Colors.grey.withOpacity(0.7),
|
||||
size: 17,
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"Booba",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: GoogleFonts.plusJakartaSans(
|
||||
color: Colors.grey, fontWeight: FontWeight.w400),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
PlayButtonComponent()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:flutter/Material.dart';
|
||||
import 'package:flutter_animated_play_button/flutter_animated_play_button.dart';
|
||||
import 'package:ionicons/ionicons.dart';
|
||||
import 'package:justmusic/values/constants.dart';
|
||||
|
||||
class PlayButtonComponent extends StatefulWidget {
|
||||
const PlayButtonComponent({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<PlayButtonComponent> createState() => _PlayButtonComponentState();
|
||||
}
|
||||
|
||||
class _PlayButtonComponentState extends State<PlayButtonComponent> {
|
||||
bool isPlaying = true;
|
||||
final player = AudioPlayer();
|
||||
void switchStatePlaying() {
|
||||
setState(() {
|
||||
isPlaying = !isPlaying;
|
||||
});
|
||||
stopSong();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
player.onPlayerComplete.listen((event) {
|
||||
switchStatePlaying();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!isPlaying) {
|
||||
playSong();
|
||||
} else {}
|
||||
return isPlaying
|
||||
? GestureDetector(
|
||||
onTap: switchStatePlaying,
|
||||
child: Icon(
|
||||
Ionicons.play_circle_outline,
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
size: 30,
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: switchStatePlaying,
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: AnimatedPlayButton(
|
||||
stopped: false,
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
onPressed: () {},
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> playSong() async {
|
||||
await player.play(UrlSource(
|
||||
'https://p.scdn.co/mp3-preview/d38052978a79adced2187cd8b6497bb10bedc452?cid=eb2aab666a43490f82eef0bb064d363f'));
|
||||
}
|
||||
|
||||
Future<void> stopSong() async {
|
||||
await player.stop();
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/Material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../components/music_list_component.dart';
|
||||
import '../values/constants.dart';
|
||||
|
||||
class SearchSongScreen extends StatefulWidget {
|
||||
const SearchSongScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SearchSongScreen> createState() => _SearchSongScreenState();
|
||||
}
|
||||
|
||||
class _SearchSongScreenState extends State<SearchSongScreen> {
|
||||
Future<void> resetFullScreen() async {
|
||||
await SystemChannels.platform.invokeMethod<void>(
|
||||
'SystemChrome.restoreSystemUIOverlays',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double screenHeight = MediaQuery.of(context).size.height;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
resetFullScreen();
|
||||
}
|
||||
},
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 25.0,
|
||||
sigmaY: 25.0,
|
||||
),
|
||||
child: Container(
|
||||
color: bgAppBar.withOpacity(0.5),
|
||||
height: screenHeight - 50,
|
||||
padding: const EdgeInsets.only(
|
||||
top: 10, left: defaultPadding, right: defaultPadding),
|
||||
child: Column(
|
||||
children: [
|
||||
Align(
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 5,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(20))),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
child: SizedBox(
|
||||
height: 40,
|
||||
child: TextFormField(
|
||||
keyboardAppearance: Brightness.dark,
|
||||
onEditingComplete: resetFullScreen,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'TODO';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
cursorColor: Colors.white,
|
||||
keyboardType: TextInputType.text,
|
||||
style: GoogleFonts.plusJakartaSans(color: grayText),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(
|
||||
Icons.search,
|
||||
color: grayColor,
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 1, color: grayColor),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10))),
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: defaultPadding,
|
||||
right: defaultPadding),
|
||||
fillColor: searchBarColor,
|
||||
filled: true,
|
||||
focusColor: grayText,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 1, color: grayColor),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10))),
|
||||
hintText: 'Chercher un son',
|
||||
hintStyle:
|
||||
GoogleFonts.plusJakartaSans(color: grayColor)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollBehavior().copyWith(scrollbars: false),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: const [
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
MusicListComponent(),
|
||||
],
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|