Skip to content

Commit

Permalink
fix: Build Issues. Bumped MinSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
khaled-0 committed Oct 20, 2024
1 parent e0cd710 commit c854498
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 14 deletions.
11 changes: 2 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

android {
namespace = "tubesync.app"
compileSdk = flutter.compileSdkVersion
ndkVersion = "25.1.8937393" //flutter.ndkVersion
ndkVersion = "25.1.8937393"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -21,13 +20,8 @@ android {

defaultConfig {
applicationId = "tubesync.app"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion

// https://stackoverflow.com/questions/67974978/android-execute-binary-from-application
// This app will never be on Google Play anyway
//noinspection ExpiredTargetSdkVersion
minSdk = 23
targetSdk = flutter.targetSdkVersion

versionCode = flutter.versionCode
Expand All @@ -37,7 +31,6 @@ android {
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
}
}
Expand Down
11 changes: 11 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ allprojects {
}

rootProject.buildDir = "../build"

// FIX for Flutter 3.24
subprojects {
afterEvaluate {
android {
compileSdkVersion 34
}
}
}


subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
Expand Down
6 changes: 5 additions & 1 deletion lib/app/home/library_tab.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:isar/isar.dart';
import 'package:provider/provider.dart';
import 'package:tube_sync/app/playlist/import_playlist_dialog.dart';
import 'package:tube_sync/app/playlist/playlist_entry_builder.dart';
Expand All @@ -24,7 +25,10 @@ class LibraryTab extends StatelessWidget {
final playlist = library.entries[index];
return PlaylistEntryBuilder(playlist, onTap: () {
notifier.value = ChangeNotifierProvider<PlaylistProvider>(
create: (_) => PlaylistProvider(playlist),
create: (_) => PlaylistProvider(
context.read<Isar>(),
playlist,
),
child: PlaylistTab(notifier: notifier),
);
});
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ void main() async {
dragDevices: PointerDeviceKind.values.toSet(),
),
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
useMaterial3: true,
),
darkTheme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.deepPurple,
seedColor: Colors.red,
brightness: Brightness.dark,
),
useMaterial3: true,
Expand Down
1 change: 1 addition & 0 deletions lib/model/media.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Media {

final Thumbnails thumbnail;

@ignore
Duration? get duration =>
durationMs == null ? null : Duration(milliseconds: durationMs!);

Expand Down
4 changes: 4 additions & 0 deletions lib/model/playlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ class Playlist {
final Thumbnails thumbnail;
final int videoCount;

final List<String> videoIds;

Playlist(
this.id,
this.title,
this.author,
this.thumbnail,
this.videoCount,
this.description,
this.videoIds,
);

factory Playlist.fromYTPlaylist(yt.Playlist playlist) => Playlist(
Expand All @@ -32,6 +35,7 @@ class Playlist {
Thumbnails.fromYTThumbnails(playlist.thumbnails),
playlist.videoCount ?? -1,
playlist.description.isNotEmpty ? playlist.description : null,
List.empty(growable: true),
);

@override
Expand Down
Loading

0 comments on commit c854498

Please sign in to comment.