Compare commits
7 Commits
v1.1.13+43
...
v1.1.19+49
Author | SHA1 | Date | |
---|---|---|---|
a4d50289c2 | |||
82fb23dbfd | |||
13f957f016 | |||
707f14c5fb | |||
493422e724 | |||
3b95d128e1 | |||
57636c5de6 |
@ -3,7 +3,7 @@ name: Flutter Schmutter
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -52,5 +52,10 @@ jobs:
|
|||||||
build/app/outputs/flutter-apk/app-release.apk
|
build/app/outputs/flutter-apk/app-release.apk
|
||||||
token: '${{secrets.RELEASE_TOKEN}}'
|
token: '${{secrets.RELEASE_TOKEN}}'
|
||||||
|
|
||||||
- name: trigger fdroid puller
|
- name: upload apk to f-droid server
|
||||||
run: curl https://flumm.io/pullfdroid.php?token=${{secrets.PULLER_TOKEN}}
|
run: |
|
||||||
|
BUILD_NUMBER=$(grep '^version:' pubspec.yaml | sed 's/.*+//')
|
||||||
|
curl -X POST "https://flumm.io/pullfdroid.php" \
|
||||||
|
-F "token=${{ secrets.PULLER_TOKEN }}" \
|
||||||
|
-F "apk=@build/app/outputs/flutter-apk/app-release.apk" \
|
||||||
|
-F "build=$BUILD_NUMBER"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<application
|
<application
|
||||||
android:label="f0ckapp"
|
android:label="f0ck"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:enableOnBackInvokedCallback="true">
|
android:enableOnBackInvokedCallback="true">
|
||||||
|
@ -1,5 +1,69 @@
|
|||||||
package com.f0ck.f0ckapp
|
package com.f0ck.f0ckapp
|
||||||
|
|
||||||
|
import android.content.ContentValues
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Environment
|
||||||
|
import android.provider.MediaStore
|
||||||
|
import androidx.annotation.NonNull
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
class MainActivity : FlutterActivity()
|
class MainActivity : FlutterActivity() {
|
||||||
|
private val CHANNEL = "MediaShit"
|
||||||
|
|
||||||
|
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine): Unit {
|
||||||
|
super.configureFlutterEngine(flutterEngine)
|
||||||
|
|
||||||
|
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler {
|
||||||
|
call,
|
||||||
|
result ->
|
||||||
|
if (call.method == "saveFile") {
|
||||||
|
val filePath = call.argument<String>("filePath")
|
||||||
|
val fileName = call.argument<String>("fileName")
|
||||||
|
val subDir = call.argument<String?>("subDir")
|
||||||
|
|
||||||
|
if (filePath == null || fileName == null)
|
||||||
|
result.error("SAVE_FAILED", "file not found", null)
|
||||||
|
|
||||||
|
if (!saveFileUsingMediaStore(applicationContext, filePath!!, fileName!!, subDir))
|
||||||
|
result.error("COPY_FAILED", "Datei konnte nicht gespeichert werden", null)
|
||||||
|
result.success(true)
|
||||||
|
} else result.notImplemented()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun saveFileUsingMediaStore(
|
||||||
|
context: Context,
|
||||||
|
filePath: String,
|
||||||
|
fileName: String,
|
||||||
|
subDir: String?
|
||||||
|
|
||||||
|
): Boolean {
|
||||||
|
val srcFile = File(filePath)
|
||||||
|
if (!srcFile.exists()) return false
|
||||||
|
|
||||||
|
val values =
|
||||||
|
ContentValues().apply {
|
||||||
|
put(MediaStore.MediaColumns.DISPLAY_NAME, fileName)
|
||||||
|
put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS + "/" + (subDir ?: "f0ck"))
|
||||||
|
put(MediaStore.MediaColumns.IS_PENDING, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
val resolver = context.contentResolver
|
||||||
|
val collection = MediaStore.Downloads.EXTERNAL_CONTENT_URI
|
||||||
|
val uri = resolver.insert(collection, values) ?: return false
|
||||||
|
|
||||||
|
resolver.openOutputStream(uri).use { out ->
|
||||||
|
FileInputStream(srcFile).use { input -> input.copyTo(out!!, 4096) }
|
||||||
|
}
|
||||||
|
|
||||||
|
values.clear()
|
||||||
|
values.put(MediaStore.MediaColumns.IS_PENDING, 0)
|
||||||
|
resolver.update(uri, values, null, null)
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:f0ckapp/screens/fullscreen_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:downloadsfolder/downloadsfolder.dart' as blah;
|
|
||||||
|
|
||||||
import 'package:f0ckapp/models/mediaitem_model.dart';
|
import 'package:f0ckapp/models/mediaitem_model.dart';
|
||||||
import 'package:f0ckapp/widgets/video_widget.dart';
|
import 'package:f0ckapp/widgets/video_widget.dart';
|
||||||
@ -70,17 +72,17 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
Future<void> _downloadMedia() async {
|
Future<void> _downloadMedia() async {
|
||||||
final MediaState mediaState = ref.read(mediaProvider);
|
final MediaState mediaState = ref.read(mediaProvider);
|
||||||
final MediaItem currentItem = mediaState.mediaItems[_currentIndex];
|
final MediaItem currentItem = mediaState.mediaItems[_currentIndex];
|
||||||
final file = await DefaultCacheManager().getSingleFile(currentItem.mediaUrl);
|
final File file = await DefaultCacheManager().getSingleFile(currentItem.mediaUrl);
|
||||||
|
final MethodChannel methodChannel = const MethodChannel('MediaShit');
|
||||||
|
|
||||||
bool? success = await blah.copyFileIntoDownloadFolder(
|
bool? success = await methodChannel.invokeMethod<bool>('saveFile', {
|
||||||
'${file.dirname}/${file.basename}',
|
'filePath': file.path,
|
||||||
currentItem.mediaUrl.split('/').last
|
'fileName': currentItem.dest,
|
||||||
);
|
});
|
||||||
if (success == true) {
|
|
||||||
_showMsg('${file.basename} wurde irgendwie heruntergeladen. Viel Spaß bei der Suche');
|
success == true
|
||||||
} else {
|
? _showMsg('${currentItem.dest} wurde in Downloads/fApp neigespeichert.')
|
||||||
_showMsg('${file.basename} konnte nicht heruntergeladen werden.');
|
: _showMsg('${currentItem.dest} konnte nicht heruntergeladen werden.');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -132,7 +134,13 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.fullscreen),
|
icon: const Icon(Icons.fullscreen),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_showMsg('fullscreen ist wip');
|
final mediaState = ref.read(mediaProvider);
|
||||||
|
final currentItem = mediaState.mediaItems[_currentIndex];
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => FullScreenMediaView(item: currentItem),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
74
lib/screens/fullscreen_screen.dart
Normal file
74
lib/screens/fullscreen_screen.dart
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
|
||||||
|
import 'package:f0ckapp/models/mediaitem_model.dart';
|
||||||
|
import 'package:f0ckapp/widgets/video_widget.dart';
|
||||||
|
|
||||||
|
class FullScreenMediaView extends StatefulWidget {
|
||||||
|
final MediaItem item;
|
||||||
|
|
||||||
|
const FullScreenMediaView({super.key, required this.item});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State createState() => _FullScreenMediaViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FullScreenMediaViewState extends State<FullScreenMediaView> {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
|
||||||
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
|
child: widget.item.mime.startsWith('image')
|
||||||
|
? InteractiveViewer(
|
||||||
|
minScale: 1.0,
|
||||||
|
maxScale: 6.0,
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: widget.item.mediaUrl,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
placeholder: (context, url) =>
|
||||||
|
const Center(child: CircularProgressIndicator()),
|
||||||
|
errorWidget: (context, url, error) =>
|
||||||
|
const Icon(Icons.error),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox.expand(
|
||||||
|
child: VideoWidget(
|
||||||
|
details: widget.item,
|
||||||
|
isActive: true,
|
||||||
|
fullScreen: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SafeArea(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -13,8 +13,14 @@ import 'package:f0ckapp/providers/media_provider.dart';
|
|||||||
class VideoWidget extends ConsumerStatefulWidget {
|
class VideoWidget extends ConsumerStatefulWidget {
|
||||||
final MediaItem details;
|
final MediaItem details;
|
||||||
final bool isActive;
|
final bool isActive;
|
||||||
|
final bool fullScreen;
|
||||||
|
|
||||||
const VideoWidget({super.key, required this.details, required this.isActive});
|
const VideoWidget({
|
||||||
|
super.key,
|
||||||
|
required this.details,
|
||||||
|
required this.isActive,
|
||||||
|
this.fullScreen = false,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ConsumerState<VideoWidget> createState() => _VideoWidgetState();
|
ConsumerState<VideoWidget> createState() => _VideoWidgetState();
|
||||||
@ -90,6 +96,50 @@ class _VideoWidgetState extends ConsumerState<VideoWidget> {
|
|||||||
|
|
||||||
bool isAudio = widget.details.mime.startsWith('audio');
|
bool isAudio = widget.details.mime.startsWith('audio');
|
||||||
|
|
||||||
|
if (widget.fullScreen) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: _controller.value.isInitialized
|
||||||
|
? _controller.value.aspectRatio
|
||||||
|
: 9 / 16,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: _onTap,
|
||||||
|
child: isAudio
|
||||||
|
? CachedNetworkImage(
|
||||||
|
imageUrl: widget.details.coverUrl,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
placeholder: (context, url) =>
|
||||||
|
const CircularProgressIndicator(),
|
||||||
|
errorWidget: (context, url, error) => Image.asset(
|
||||||
|
'assets/images/music.webp',
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
width: double.infinity,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: _controller.value.isInitialized
|
||||||
|
? CachedVideoPlayerPlus(_controller)
|
||||||
|
: const Center(child: CircularProgressIndicator()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (_controller.value.isInitialized && _showControls)
|
||||||
|
Positioned.fill(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: _onTap,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.black.withValues(alpha: 0.5),
|
||||||
|
child: VideoControlsOverlay(
|
||||||
|
controller: _controller,
|
||||||
|
button: () => _onTap(ctrlButton: true),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@ -138,4 +188,5 @@ class _VideoWidgetState extends ConsumerState<VideoWidget> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
32
pubspec.lock
32
pubspec.lock
@ -105,30 +105,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.8"
|
version: "1.0.8"
|
||||||
dartx:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: dartx
|
|
||||||
sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
diacritic:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: diacritic
|
|
||||||
sha256: "12981945ec38931748836cd76f2b38773118d0baef3c68404bdfde9566147876"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.6"
|
|
||||||
downloadsfolder:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: downloadsfolder
|
|
||||||
sha256: "0e1bb7dd634d6231c0ac116c467da94507a07ed62239712ea0dead981d58b114"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -621,14 +597,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.6"
|
version: "0.7.6"
|
||||||
time:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: time
|
|
||||||
sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.1.5"
|
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: f0ckapp
|
name: f0ckapp
|
||||||
description: "A new Flutter project."
|
description: "f0ck schm0ck"
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.1.13+43
|
version: 1.1.19+49
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.9.0-100.2.beta
|
sdk: ^3.9.0-100.2.beta
|
||||||
@ -42,7 +42,6 @@ dependencies:
|
|||||||
flutter_secure_storage: ^9.2.4
|
flutter_secure_storage: ^9.2.4
|
||||||
flutter_riverpod: ^2.6.1
|
flutter_riverpod: ^2.6.1
|
||||||
go_router: ^15.1.3
|
go_router: ^15.1.3
|
||||||
downloadsfolder: ^1.2.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -13,7 +13,7 @@ import 'package:f0ckapp/main.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
// Build our app and trigger a frame.
|
// Build our app and trigger a frame.
|
||||||
await tester.pumpWidget(const F0ckApp());
|
await tester.pumpWidget(F0ckApp());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
Reference in New Issue
Block a user