Skip to content

Commit

Permalink
Merge pull request #5 from ente-io/dart_fix
Browse files Browse the repository at this point in the history
Remove dependency from path provider
  • Loading branch information
ua741 authored Nov 22, 2024
2 parents db7ceff + 19dda20 commit ddf5eba
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 158 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Flutter CI
name: Flutter/Dart CI

on:
push:
branches:
Expand All @@ -8,30 +9,45 @@ on:
- main

env:
flutter_version: "3.7.x"
flutter_version: "3.19.x" # Latest stable Flutter version
java_version: "12.x"

jobs:
flutter_test:
build:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.java_version }}

- name: Cache Flutter dependencies
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- uses: subosito/flutter-action@v1

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'

- name: Install dependencies
run: flutter pub get

- name: Install example dependencies
working-directory: ./example
run: flutter pub get

- name: Run Formatter
run: flutter format --dry-run . --set-exit-if-changed
- name: Run Linter
run: flutter analyze
run: dart format --output=none --set-exit-if-changed .

- name: Run Analyzer
run: dart analyze --fatal-infos

- name: Run tests
run: flutter test # This will run tests in both the main package and example
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.0.0
* Removed flutter dependency.

### Breaking Changes
- **getMotionVideoFile**: Now requires explicit destination Directory as first parameter (previously used system temp dir)


## 0.0.6
* Fixed invalid motion photo detection for Motion photo Top Shot.

Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:flutter_lints/flutter.yaml
include: package:lints/recommended.yaml

analyzer:
errors:
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
15 changes: 8 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ PODS:
- SwiftyGif (5.4.4)
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

SPEC REPOS:
trunk:
Expand All @@ -65,18 +66,18 @@ EXTERNAL SOURCES:
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.12.1
COCOAPODS: 1.16.2
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -343,7 +343,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -420,7 +420,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -469,7 +469,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 3 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:motion_photos/motion_photos.dart';
import 'package:path_provider/path_provider.dart';
import 'package:video_player/video_player.dart';

void main() {
Expand Down Expand Up @@ -73,7 +74,8 @@ class _MyHomePageState extends State<MyHomePage> {
Future<Widget> _playVideo() async {
if (isPicked && (_isMotionPhoto ?? false)) {
try {
File file = await motionPhotos.getMotionVideoFile();
File file = await motionPhotos
.getMotionVideoFile(await getTemporaryDirectory());
_controller = VideoPlayerController.file(file);
_controller.initialize();
_controller.setLooping(true);
Expand Down
Loading

0 comments on commit ddf5eba

Please sign in to comment.