Skip to content

Commit

Permalink
Update to Dart 3
Browse files Browse the repository at this point in the history
  • Loading branch information
xxparthparekhxx committed Jan 27, 2024
1 parent f59097b commit 470cd03
Show file tree
Hide file tree
Showing 8 changed files with 349 additions and 256 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
30 changes: 15 additions & 15 deletions lib/providers/player_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,21 @@ class PlayerProvider with ChangeNotifier {

void stopPlaying() {
_playerState = PlayerStates.notPlaying;
_player?.dispose();

currentPlayingFuture = null;
_player = null;
_playerFileType = null;
_playerIndex = 0;
_playerQueue = [];
if (_player != null) {
_player?.dispose();
}
if (_player != null) {}
notifyListeners();
}

void startPlaying(List<Reference> refs, index) async {
if (_player != null) {
_player.dispose();
_player = null;
}
if (refs.isEmpty) {
return;
Expand All @@ -67,18 +68,17 @@ class PlayerProvider with ChangeNotifier {
_playerIndex = index;
notifyListeners();

for (_playerIndex; _playerIndex < refs.length; _playerIndex++) {
_playerState = PlayerStates.loading;
currentPlayingFuture = determinePlayerWithtFileType(
checkFileType(refs[_playerIndex].fullPath, refs[_playerIndex]),
refs[_playerIndex]);
_playerState = PlayerStates.loading;
currentPlayingFuture = determinePlayerWithtFileType(
checkFileType(refs[_playerIndex].fullPath, refs[_playerIndex]),
refs[_playerIndex]);

await currentPlayingFuture;

await currentPlayingFuture;
await _player?.dispose();
_player = null;
_playerState = PlayerStates.notPlaying;

await _player?.dispose();
_player = null;
notifyListeners();
}
notifyListeners();
}

Expand Down Expand Up @@ -132,8 +132,8 @@ class PlayerProvider with ChangeNotifier {

Future<void> videoPlayer(Reference ref) async {
_playerState = PlayerStates.loading;
_player = VideoPlayerController.network(
await ref.getDownloadURL(),
_player = VideoPlayerController.networkUrl(
Uri.parse(await ref.getDownloadURL()),
);
notifyListeners();

Expand Down
8 changes: 0 additions & 8 deletions lib/utils/importer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@ export 'package:opencloud/models/options.dart';
export 'package:opencloud/models/storage_meta.dart';
export 'package:shared_preferences/shared_preferences.dart';
export 'package:url_launcher/url_launcher_string.dart';
export 'package:firebase_storage/firebase_storage.dart';
export 'dart:async';
export 'package:firebase_core/firebase_core.dart';
export 'package:flutter/material.dart';
export 'package:opencloud/pages/auth/login.dart';
export 'package:opencloud/pages/project_control/add_project.dart';
export 'package:opencloud/providers/openprovider.dart';
export 'package:provider/provider.dart';
export 'package:just_audio/just_audio.dart';
export 'package:video_player/video_player.dart';
export 'package:opencloud/pages/project_control/add_project.dart';
export 'package:opencloud/pages/project_control/list_of_files.dart';
export 'package:file_picker/file_picker.dart';
export 'package:opencloud/pages/project_control/list_of_user_projects.dart';
Expand Down
6 changes: 4 additions & 2 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import firebase_core
import firebase_storage
import flutter_media_metadata
import just_audio
import path_provider_macos
import shared_preferences_macos
import path_provider_foundation
import shared_preferences_foundation
import syncfusion_pdfviewer_macos
import url_launcher_macos
import video_player_avfoundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
Expand All @@ -29,4 +30,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
}
Loading

0 comments on commit 470cd03

Please sign in to comment.