Skip to content

Commit

Permalink
Merge pull request #2 from ArbazShaikh077/master
Browse files Browse the repository at this point in the history
  • Loading branch information
o-ifeanyi authored Feb 19, 2023
2 parents 1b0097e + 5c7f088 commit c55b464
Show file tree
Hide file tree
Showing 15 changed files with 261 additions and 124 deletions.
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -46,9 +46,10 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.onuifeanyi.vybeplayer"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

signingConfigs {
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="Vybe player"
android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true">
Expand All @@ -21,6 +21,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported = "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
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.7.21'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

42 changes: 33 additions & 9 deletions lib/components/create_playList.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:musicPlayer/util/config.dart';
import 'package:musicPlayer/providers/playList_database.dart';
import 'package:musicPlayer/providers/mark_songs.dart';
Expand Down Expand Up @@ -112,12 +113,14 @@ class _CreatePlayListState extends State<CreatePlayList> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
maxLengthEnforcement:
MaxLengthEnforcement.enforced,
controller: inputFeild,
focusNode: focusNode,
maxLength: 14,
maxLengthEnforced: true,
keyboardType: TextInputType.name,
textCapitalization: TextCapitalization.sentences,
textCapitalization:
TextCapitalization.sentences,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
labelText: 'Name',
Expand All @@ -135,7 +138,7 @@ class _CreatePlayListState extends State<CreatePlayList> {
// create playlist is at index 0
return index > 0 &&
index < playlistDB.playList.length
? FlatButton(
? TextButton(
onPressed: () async {
widget.songs.forEach((song) async {
await playlistDB.addToPlaylist(
Expand Down Expand Up @@ -172,8 +175,15 @@ class _CreatePlayListState extends State<CreatePlayList> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () {
Navigator.pop(context);
},
Expand All @@ -183,16 +193,30 @@ class _CreatePlayListState extends State<CreatePlayList> {
),
),
createNew
? FlatButton(
textColor: Theme.of(context).accentColor,
? TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: createPlaylist,
child: Text(
'Create playlist',
style: textStyle,
),
)
: FlatButton(
textColor: Theme.of(context).accentColor,
: TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () {
setState(() {
createNew = true;
Expand Down
48 changes: 37 additions & 11 deletions lib/components/history_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HistoryBottomSheet extends StatelessWidget {
),
),
Spacer(),
FlatButton.icon(
TextButton.icon(
icon: Icon(Icons.clear_rounded),
onPressed: () async {
await showDialog(
Expand All @@ -58,13 +58,27 @@ class HistoryBottomSheet extends StatelessWidget {
),
),
actions: [
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () => Navigator.pop(context),
child: Text('No'),
),
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () async {
await controller.clearHistory();
Navigator.pop(context);
Expand Down Expand Up @@ -107,16 +121,28 @@ class HistoryBottomSheet extends StatelessWidget {
),
),
actions: [
FlatButton(
textColor:
Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () =>
Navigator.pop(context, false),
child: Text('No'),
),
FlatButton(
textColor:
Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary),
),
),
onPressed: () =>
Navigator.pop(context, true),
child: Text('Yes'),
Expand Down
17 changes: 13 additions & 4 deletions lib/components/identied_songinfo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,19 @@ class _IdentifiedSongState extends State<IdentifiedSong> {
controller.lyrics.isEmpty
? Center(
child: Center(
child: FlatButton(
splashColor:
Theme.of(context).accentColor.withOpacity(0.5),
padding: EdgeInsets.all(20),
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(
Theme.of(context)
.colorScheme
.secondary
.withOpacity(0.5)),
padding: MaterialStateProperty.all(
EdgeInsets.all(
20,
),
),
),
child: controller.isSearchingLyrics
? CircularProgressIndicator(strokeWidth: 2)
: Text(
Expand Down
36 changes: 29 additions & 7 deletions lib/components/library_bottom_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:musicPlayer/util/config.dart';
import 'package:musicPlayer/providers/playList_database.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -53,19 +54,26 @@ class LibraryBottomSheet extends StatelessWidget {
style: customTextStyle,
),
content: TextField(
maxLengthEnforcement: MaxLengthEnforcement.enforced,
focusNode: focusNode,
controller: editingController,
maxLength: 14,
maxLengthEnforced: true,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
labelText: 'New name',
),
onSubmitted: (_) => rename(playlistDB, context),
),
actions: [
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color:
Theme.of(context).colorScheme.secondary,
),
),
),
onPressed: () => rename(playlistDB, context),
child: Text(
'Done',
Expand All @@ -90,13 +98,27 @@ class LibraryBottomSheet extends StatelessWidget {
style: customTextStyle,
),
actions: [
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color:
Theme.of(context).colorScheme.secondary,
),
),
),
onPressed: () => Navigator.pop(context),
child: Text('Cancel'),
),
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color:
Theme.of(context).colorScheme.secondary,
),
),
),
onPressed: () async {
await playlistDB.deletePlaylist(playlistName);
playlistDB.showToast(
Expand Down
39 changes: 31 additions & 8 deletions lib/components/now_playing_display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ class _NowPlayingDisplay extends State<NowPlayingDisplay> {
color: Theme.of(context).textTheme.bodyText1.color)),
child: controller.lyrics.isEmpty
? Center(
child: FlatButton(
splashColor: Theme.of(context).accentColor.withOpacity(0.5),
padding: EdgeInsets.all(20),
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateProperty.all(
Theme.of(context)
.colorScheme
.secondary
.withOpacity(0.5),
),
padding: MaterialStateProperty.all(
EdgeInsets.all(20))),
child: _isLoading
? CircularProgressIndicator(strokeWidth: 2)
: Text('Get lyrics'),
Expand Down Expand Up @@ -119,15 +126,31 @@ class _NowPlayingDisplay extends State<NowPlayingDisplay> {
style: customTextStyle,
),
actions: [
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary,
),
),
),
onPressed: () => Navigator.pop(context),
child: Text(
'No',
),
),
FlatButton(
textColor: Theme.of(context).accentColor,
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(
color: Theme.of(context)
.colorScheme
.secondary,
),
),
),
onPressed: () async {
await controller.manageLyrics(
context: context,
Expand Down Expand Up @@ -179,4 +202,4 @@ class _NowPlayingDisplay extends State<NowPlayingDisplay> {
},
);
}
}
}
Loading

0 comments on commit c55b464

Please sign in to comment.