Skip to content

Commit f6a8013

Browse files
committed
Resolved bugs for android 11+
1 parent c59044c commit f6a8013

File tree

58 files changed

+3375
-3192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3375
-3192
lines changed

BackupFileName.dump

Lines changed: 0 additions & 2651 deletions
This file was deleted.

android/app/build.gradle

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion flutter.compileSdkVersion
29+
compileSdkVersion 31
3030

31+
configurations.all {
32+
resolutionStrategy {
33+
force 'com.android.support:support-v4:27.1.0'
34+
}
35+
}
3136
compileOptions {
3237
sourceCompatibility JavaVersion.VERSION_1_8
3338
targetCompatibility JavaVersion.VERSION_1_8
@@ -43,20 +48,32 @@ android {
4348

4449
defaultConfig {
4550
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "com.example.spotify_clone"
47-
minSdkVersion flutter.minSdkVersion
48-
targetSdkVersion flutter.targetSdkVersion
51+
applicationId "com.example.musive"
52+
minSdkVersion 20
53+
targetSdkVersion 31
4954
versionCode flutterVersionCode.toInteger()
50-
versionName flutterVersionName
55+
versionName "1.0.1"
56+
multiDexEnabled true
5157
}
5258

5359
buildTypes {
5460
release {
5561
// TODO: Add your own signing config for the release build.
5662
// Signing with the debug keys for now, so `flutter run --release` works.
5763
signingConfig signingConfigs.debug
64+
debuggable true
65+
shrinkResources false
66+
minifyEnabled false
5867
}
5968
}
69+
splits {
70+
abi {
71+
enable true
72+
reset()
73+
include 'arm64-v8a'
74+
universalApk true
75+
}
76+
}
6077
}
6178

6279
flutter {

android/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.example.spotify_clone">
33
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
5+
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
6+
<uses-permission android:name="android.permission.WAKE_LOCK" />
7+
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
8+
<uses-permission android:name='android.requestLegacyExternalStorage="true"' />
49
<application
510
android:label="Musive"
611
android:name="${applicationName}"
12+
android:extractNativeLibs="true"
13+
android:usesCleartextTraffic="true"
714
android:icon="@mipmap/ic_launcher">
815
<activity
916
android:name=".MainActivity"
1017
android:exported="true"
1118
android:launchMode="singleTop"
12-
android:usesCleartextTraffic="true"
1319
android:theme="@style/LaunchTheme"
1420
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1521
android:hardwareAccelerated="true"

android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
// Generated file.
2+
//
23
// If you wish to remove Flutter's multidex support, delete this entire file.
4+
//
5+
// Modifications to this file should be done in a copy under a different name
6+
// as this file may be regenerated.
37

48
package io.flutter.app;
59

10+
import android.app.Application;
611
import android.content.Context;
712
import androidx.annotation.CallSuper;
813
import androidx.multidex.MultiDex;
914

1015
/**
11-
* Extension of {@link io.flutter.app.FlutterApplication}, adding multidex support.
16+
* Extension of {@link android.app.Application}, adding multidex support.
1217
*/
13-
public class FlutterMultiDexApplication extends FlutterApplication {
18+
public class FlutterMultiDexApplication extends Application {
1419
@Override
1520
@CallSuper
1621
protected void attachBaseContext(Context base) {

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.6.10'
33
repositories {
44
google()
55
mavenCentral()

lib/api/url.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const String baseUrl = '< Backend url >';
1+
const String baseUrl = 'cryptic-forest-99443.herokuapp.com';
22

33
const String basePath = '/api/v1';

lib/controllers/main_controller.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dart:async';
33
import 'package:assets_audio_player/assets_audio_player.dart';
44
import 'package:flutter/cupertino.dart';
55
import 'package:hive_flutter/hive_flutter.dart';
6-
import 'package:spotify_clone/models/song_model.dart';
6+
import '../models/song_model.dart';
77

88
class MainController extends ChangeNotifier {
99
var audios = <Audio>[
@@ -66,7 +66,7 @@ class MainController extends ChangeNotifier {
6666
return false;
6767
}));
6868
final recentSongs = getRecentlyPlayed();
69-
recentSongs.sort((a, b) => a["created"].compareTo(b["created"]));
69+
recentSongs.sort((a, b) => b["created"].compareTo(a["created"]));
7070
if (recentSongs.isNotEmpty) {
7171
audios.removeAt(0);
7272
}

lib/main.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:hive_flutter/adapters.dart';
33
import 'package:path_provider/path_provider.dart';
4-
import 'package:spotify_clone/screens/bottom_nav_bar/bottom_nav_bar.dart';
4+
import 'screens/bottom_nav_bar/bottom_nav_bar.dart';
55

66
Future<void> main() async {
77
WidgetsFlutterBinding.ensureInitialized();
@@ -21,7 +21,8 @@ class MyApp extends StatelessWidget {
2121
@override
2222
Widget build(BuildContext context) {
2323
return MaterialApp(
24-
title: 'Spotify Clone',
24+
title: 'Musive',
25+
debugShowCheckedModeBanner: false,
2526
theme: ThemeData(
2627
fontFamily: 'Proxima',
2728
canvasColor: Colors.transparent,
@@ -59,7 +60,7 @@ class MyApp extends StatelessWidget {
5960
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
6061
);
6162
},
62-
home: const App(),
63+
home: const BottomNavBarThree(),
6364
);
6465
}
6566
}

lib/repositories/get_artists_data.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'dart:convert';
22

3-
import 'package:spotify_clone/api/url.dart';
4-
import 'package:spotify_clone/methods/get_response.dart';
5-
import 'package:spotify_clone/models/song_model.dart';
6-
import 'package:spotify_clone/models/user_model.dart';
3+
import '../api/url.dart';
4+
import '../methods/get_response.dart';
5+
import '../models/song_model.dart';
6+
import '../models/user_model.dart';
77

88
class GetArtistsData {
99
Future<UserModel> getUserData(String id) async {

lib/repositories/get_genre_data.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import 'dart:convert';
22

33
import 'package:http/http.dart';
4-
import 'package:spotify_clone/api/url.dart';
5-
import 'package:spotify_clone/methods/get_response.dart';
6-
import 'package:spotify_clone/models/song_model.dart';
7-
import 'package:spotify_clone/models/user.dart';
4+
import '../api/url.dart';
5+
import '../methods/get_response.dart';
6+
import '../models/song_model.dart';
7+
import '../models/user.dart';
88

99
class GenreRepository {
1010
Future<List<User>> getUsers(String tag) async {

0 commit comments

Comments
 (0)