Compare commits
12 Commits
v1.1.11+41
...
v1.1.21+51
Author | SHA1 | Date | |
---|---|---|---|
7981436374 | |||
e38d2086b3 | |||
a4d50289c2 | |||
82fb23dbfd | |||
13f957f016 | |||
707f14c5fb | |||
493422e724 | |||
3b95d128e1 | |||
57636c5de6 | |||
f75299f0d4 | |||
03c6431eca | |||
5876c809a5 |
@ -3,7 +3,7 @@ name: Flutter Schmutter
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -51,3 +51,11 @@ jobs:
|
|||||||
files: |-
|
files: |-
|
||||||
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: upload apk to f-droid server
|
||||||
|
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"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<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">
|
||||||
@ -16,8 +15,7 @@
|
|||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:windowSoftInputMode="adjustResize"
|
android:windowSoftInputMode="adjustResize">
|
||||||
android:requestLegacyExternalStorage="true">
|
|
||||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
the Android process has started. This theme is visible to the user
|
the Android process has started. This theme is visible to the user
|
||||||
while the Flutter UI initializes. After that, this theme continues
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,7 +4,6 @@ import 'package:flutter/services.dart';
|
|||||||
|
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_downloader/flutter_downloader.dart';
|
|
||||||
|
|
||||||
import 'package:f0ckapp/screens/mediagrid_screen.dart';
|
import 'package:f0ckapp/screens/mediagrid_screen.dart';
|
||||||
import 'package:f0ckapp/screens/detailview_screen.dart';
|
import 'package:f0ckapp/screens/detailview_screen.dart';
|
||||||
@ -14,7 +13,6 @@ import 'package:f0ckapp/providers/theme_provider.dart';
|
|||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
await FlutterDownloader.initialize();
|
|
||||||
await AppVersion.init();
|
await AppVersion.init();
|
||||||
|
|
||||||
runApp(ProviderScope(child: F0ckApp()));
|
runApp(ProviderScope(child: F0ckApp()));
|
||||||
|
@ -3,12 +3,16 @@ class Suggestion {
|
|||||||
final int tagged;
|
final int tagged;
|
||||||
final double score;
|
final double score;
|
||||||
|
|
||||||
Suggestion({required this.tag, required this.tagged, required this.score});
|
Suggestion({
|
||||||
|
required this.tag,
|
||||||
|
required this.tagged,
|
||||||
|
required this.score,
|
||||||
|
});
|
||||||
|
|
||||||
factory Suggestion.fromJson(Map<String, dynamic> json) {
|
factory Suggestion.fromJson(Map<String, dynamic> json) {
|
||||||
return Suggestion(
|
return Suggestion(
|
||||||
tag: json['tag'].toString(),
|
tag: json['tag'].toString(),
|
||||||
tagged: int.tryParse(json['tagged'].toString()) ?? 0,
|
tagged: json['tagged'],
|
||||||
score: (json['score'] as num).toDouble(),
|
score: (json['score'] as num).toDouble(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,17 @@ class MediaNotifier extends StateNotifier<MediaState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<MediaItem> mergeMediaItems(
|
||||||
|
List<MediaItem> current,
|
||||||
|
List<MediaItem> incoming,
|
||||||
|
) {
|
||||||
|
final existingIds = current.map((item) => item.id).toSet();
|
||||||
|
final newItems = incoming
|
||||||
|
.where((item) => !existingIds.contains(item.id))
|
||||||
|
.toList();
|
||||||
|
return [...current, ...newItems];
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> loadMedia({int? id}) async {
|
Future<void> loadMedia({int? id}) async {
|
||||||
if (state.isLoading) return;
|
if (state.isLoading) return;
|
||||||
state = state.replace(isLoading: true);
|
state = state.replace(isLoading: true);
|
||||||
@ -128,8 +139,11 @@ class MediaNotifier extends StateNotifier<MediaState> {
|
|||||||
random: state.random,
|
random: state.random,
|
||||||
tag: state.tag,
|
tag: state.tag,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (newMedia.isNotEmpty) {
|
if (newMedia.isNotEmpty) {
|
||||||
addMediaItems(newMedia);
|
state = state.replace(
|
||||||
|
mediaItems: mergeMediaItems(state.mediaItems, newMedia),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Fehler beim Laden der Medien: $e');
|
print('Fehler beim Laden der Medien: $e');
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
@ -232,10 +233,11 @@ final ThemeData f0ck95Theme = ThemeData(
|
|||||||
onPrimary: Colors.black,
|
onPrimary: Colors.black,
|
||||||
onSecondary: Colors.white,
|
onSecondary: Colors.white,
|
||||||
),
|
),
|
||||||
appBarTheme: const AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
backgroundColor: Color(0xFFC0C0C0),
|
backgroundColor: const Color(0xFFE0E0E0),
|
||||||
foregroundColor: Colors.black,
|
foregroundColor: Colors.black,
|
||||||
elevation: 2,
|
elevation: 4,
|
||||||
|
centerTitle: true
|
||||||
),
|
),
|
||||||
textTheme: const TextTheme(
|
textTheme: const TextTheme(
|
||||||
bodyLarge: TextStyle(color: Colors.black),
|
bodyLarge: TextStyle(color: Colors.black),
|
||||||
|
@ -1,14 +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:f0ckapp/widgets/end_drawer.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:permission_handler/permission_handler.dart';
|
|
||||||
import 'package:flutter_downloader/flutter_downloader.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
import 'package:f0ckapp/models/mediaitem_model.dart';
|
import 'package:f0ckapp/models/mediaitem_model.dart';
|
||||||
@ -72,50 +73,21 @@ 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 file = await DefaultCacheManager().getSingleFile(
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
currentItem.mediaUrl,
|
||||||
PermissionStatus status = await Permission.storage.status;
|
|
||||||
if (!status.isGranted) {
|
|
||||||
status = await Permission.storage.request();
|
|
||||||
if (!status.isGranted) {
|
|
||||||
_showMsg("Speicherberechtigung wurde nicht erteilt.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String localPath;
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
final Directory? directory = await getExternalStorageDirectory();
|
|
||||||
localPath = "${directory!.path}/Download/fApp";
|
|
||||||
} else if (Platform.isIOS) {
|
|
||||||
final Directory directory = await getApplicationDocumentsDirectory();
|
|
||||||
localPath = directory.path;
|
|
||||||
} else {
|
|
||||||
final Directory directory = await getTemporaryDirectory();
|
|
||||||
localPath = directory.path;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Directory savedDir = Directory(localPath);
|
|
||||||
if (!await savedDir.exists()) {
|
|
||||||
await savedDir.create(recursive: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await FlutterDownloader.enqueue(
|
|
||||||
url: currentItem.mediaUrl,
|
|
||||||
savedDir: localPath,
|
|
||||||
fileName: currentItem.mediaUrl.split('/').last,
|
|
||||||
showNotification: true,
|
|
||||||
openFileFromNotification: true,
|
|
||||||
);
|
);
|
||||||
|
final MethodChannel methodChannel = const MethodChannel('MediaShit');
|
||||||
|
|
||||||
if (mounted) {
|
bool? success = await methodChannel.invokeMethod<bool>('saveFile', {
|
||||||
_showMsg('Download gestartet: ${currentItem.mediaUrl}');
|
'filePath': file.path,
|
||||||
}
|
'fileName': currentItem.dest,
|
||||||
} catch (e) {
|
});
|
||||||
_showMsg('Download fehlgeschlagen: $e');
|
|
||||||
}
|
success == true
|
||||||
|
? _showMsg(
|
||||||
|
'${currentItem.dest} wurde in Downloads/fApp neigespeichert.',
|
||||||
|
)
|
||||||
|
: _showMsg('${currentItem.dest} konnte nicht heruntergeladen werden.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -133,9 +105,7 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
|
|
||||||
if (itemIndex == -1) {
|
if (itemIndex == -1) {
|
||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
ref
|
ref.read(mediaProvider.notifier).loadMedia(id: widget.initialItemId + 50);
|
||||||
.read(mediaProvider.notifier)
|
|
||||||
.loadMedia(id: widget.initialItemId + 50);
|
|
||||||
});
|
});
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(),
|
appBar: AppBar(),
|
||||||
@ -153,10 +123,28 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
endDrawer: EndDrawer(ref: ref),
|
||||||
|
persistentFooterButtons: mediaState.tag != null
|
||||||
|
? [
|
||||||
|
Center(
|
||||||
|
child: InputChip(
|
||||||
|
label: Text(mediaState.tag!),
|
||||||
|
onDeleted: () {
|
||||||
|
ref.read(mediaProvider.notifier).setTag(null);
|
||||||
|
context.go('/', extra: true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
floating: true,
|
||||||
|
pinned: true,
|
||||||
|
snap: true,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text('f0ck #${mediaState.mediaItems[_currentIndex].id}'),
|
title: Text('f0ck #${mediaState.mediaItems[_currentIndex].id}'),
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -167,7 +155,12 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.fullscreen),
|
icon: const Icon(Icons.fullscreen),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_showMsg('fullscreen ist wip');
|
final currentItem = mediaState.mediaItems[_currentIndex];
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => FullScreenMediaView(item: currentItem),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -225,37 +218,39 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
],
|
],
|
||||||
icon: const Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
),
|
),
|
||||||
],
|
Builder(
|
||||||
|
builder: (context) => IconButton(
|
||||||
|
icon: const Icon(Icons.menu),
|
||||||
|
onPressed: () {
|
||||||
|
Scaffold.of(context).openEndDrawer();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
body: Stack(
|
),
|
||||||
children: [
|
],
|
||||||
PageTransformer(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
|
background: Container(color: Colors.transparent),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
sliver: SliverFillRemaining(
|
||||||
|
child: PageTransformer(
|
||||||
controller: _pageController!,
|
controller: _pageController!,
|
||||||
pages: mediaState.mediaItems.map((item) {
|
pages: mediaState.mediaItems.map((item) {
|
||||||
int itemIndex = mediaState.mediaItems.indexOf(item);
|
int pageIndex = mediaState.mediaItems.indexOf(item);
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
|
top: false,
|
||||||
child: SmartRefreshIndicator(
|
child: SmartRefreshIndicator(
|
||||||
onRefresh: _loadMoreMedia,
|
onRefresh: _loadMoreMedia,
|
||||||
child: _buildMediaItem(item, _currentIndex == itemIndex),
|
child: _buildMediaItem(item, _currentIndex == pageIndex),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
persistentFooterButtons: mediaState.tag != null
|
|
||||||
? [
|
|
||||||
Center(
|
|
||||||
child: InputChip(
|
|
||||||
label: Text(mediaState.tag!),
|
|
||||||
onDeleted: () {
|
|
||||||
ref.read(mediaProvider.notifier).setTag(null);
|
|
||||||
context.go('/', extra: true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,8 +264,10 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
CachedNetworkImage(
|
CachedNetworkImage(
|
||||||
imageUrl: item.mediaUrl,
|
imageUrl: item.mediaUrl,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
placeholder: (context, url) => const CircularProgressIndicator(),
|
placeholder: (context, url) =>
|
||||||
errorWidget: (context, url, error) => const Icon(Icons.error),
|
const Center(child: CircularProgressIndicator()),
|
||||||
|
errorWidget: (context, url, error) =>
|
||||||
|
const Center(child: Icon(Icons.error)),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
VideoWidget(details: item, isActive: isActive),
|
VideoWidget(details: item, isActive: isActive),
|
||||||
|
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, color: Colors.white),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
|
||||||
|
|
||||||
import 'package:f0ckapp/providers/media_provider.dart';
|
import 'package:f0ckapp/providers/media_provider.dart';
|
||||||
import 'package:f0ckapp/utils/appversion_util.dart';
|
|
||||||
import 'package:f0ckapp/providers/theme_provider.dart';
|
|
||||||
import 'package:f0ckapp/utils/customsearchdelegate_util.dart';
|
import 'package:f0ckapp/utils/customsearchdelegate_util.dart';
|
||||||
|
import 'package:f0ckapp/widgets/media_tile.dart';
|
||||||
const List<String> mediaTypes = ["alles", "image", "video", "audio"];
|
import 'package:f0ckapp/widgets/filter_bar.dart';
|
||||||
const List<String> mediaModes = ["sfw", "nsfw", "untagged", "all"];
|
import 'package:f0ckapp/widgets/end_drawer.dart';
|
||||||
|
|
||||||
class MediaGrid extends ConsumerStatefulWidget {
|
class MediaGrid extends ConsumerStatefulWidget {
|
||||||
const MediaGrid({super.key});
|
const MediaGrid({super.key});
|
||||||
@ -21,16 +17,6 @@ class MediaGrid extends ConsumerStatefulWidget {
|
|||||||
|
|
||||||
class _MediaGridState extends ConsumerState<MediaGrid> {
|
class _MediaGridState extends ConsumerState<MediaGrid> {
|
||||||
final ScrollController _scrollController = ScrollController();
|
final ScrollController _scrollController = ScrollController();
|
||||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
||||||
|
|
||||||
final TextEditingController _usernameController = TextEditingController();
|
|
||||||
final TextEditingController _passwordController = TextEditingController();
|
|
||||||
|
|
||||||
int _calculateCrossAxisCount(BuildContext context, int defaultCount) {
|
|
||||||
return defaultCount == 0
|
|
||||||
? (MediaQuery.of(context).size.width / 110).clamp(3, 5).toInt()
|
|
||||||
: defaultCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -49,210 +35,107 @@ class _MediaGridState extends ConsumerState<MediaGrid> {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_scrollController.dispose();
|
_scrollController.dispose();
|
||||||
_usernameController.dispose();
|
|
||||||
_passwordController.dispose();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final mediaState = ref.watch(mediaProvider);
|
final MediaState mediaState = ref.watch(mediaProvider);
|
||||||
final mediaNotifier = ref.read(mediaProvider.notifier);
|
final MediaNotifier mediaNotifier = ref.read(mediaProvider.notifier);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: _scaffoldKey,
|
body: RefreshIndicator(
|
||||||
appBar: AppBar(
|
onRefresh: () async {
|
||||||
|
mediaNotifier.setTag(null);
|
||||||
|
_scrollController.jumpTo(0);
|
||||||
|
await mediaNotifier.loadMedia();
|
||||||
|
},
|
||||||
|
child: CustomScrollView(
|
||||||
|
controller: _scrollController,
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
floating: true,
|
||||||
|
snap: true,
|
||||||
title: GestureDetector(
|
title: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
mediaNotifier.setTag(null);
|
||||||
|
_scrollController.jumpTo(0);
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 10,
|
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/images/f0ck_small.webp',
|
'assets/images/f0ck_small.webp',
|
||||||
fit: BoxFit.fitHeight,
|
fit: BoxFit.fitHeight,
|
||||||
),
|
),
|
||||||
Text('fApp', style: TextStyle(fontSize: 24)),
|
const SizedBox(width: 10),
|
||||||
|
const Text('fApp', style: TextStyle(fontSize: 24)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () {
|
|
||||||
mediaNotifier.setTag(null);
|
|
||||||
_scrollController.jumpTo(0);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.search),
|
icon: const Icon(Icons.search),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
showSearch(
|
await showSearch(
|
||||||
context: context,
|
context: context,
|
||||||
delegate: CustomSearchDelegate(),
|
delegate: CustomSearchDelegate(),
|
||||||
);
|
);
|
||||||
//mediaNotifier.setTag('drachenlord');
|
|
||||||
//_scrollController.jumpTo(0);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
mediaState.random ? Icons.shuffle_on_outlined : Icons.shuffle,
|
mediaState.random
|
||||||
|
? Icons.shuffle_on_outlined
|
||||||
|
: Icons.shuffle,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
mediaNotifier.toggleRandom();
|
mediaNotifier.toggleRandom();
|
||||||
_scrollController.jumpTo(0);
|
_scrollController.jumpTo(0);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
Builder(
|
||||||
|
builder: (context) {
|
||||||
|
return IconButton(
|
||||||
icon: const Icon(Icons.menu),
|
icon: const Icon(Icons.menu),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState?.openEndDrawer();
|
Scaffold.of(context).openEndDrawer();
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
bottomNavigationBar: BottomAppBar(
|
SliverPadding(
|
||||||
height: 50,
|
padding: const EdgeInsets.all(5.0),
|
||||||
child: Row(
|
sliver: SliverGrid(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
delegate: SliverChildBuilderDelegate(
|
||||||
children: [
|
(context, index) {
|
||||||
const Text('type: '),
|
if (index >= mediaState.mediaItems.length) {
|
||||||
DropdownButton<String>(
|
return const Center(child: CircularProgressIndicator());
|
||||||
value: mediaTypes[mediaState.typeIndex],
|
|
||||||
isDense: true,
|
|
||||||
items: mediaTypes.map((String value) {
|
|
||||||
return DropdownMenuItem<String>(
|
|
||||||
value: value,
|
|
||||||
child: Text(value),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
if (newValue != null) {
|
|
||||||
mediaNotifier.setType(newValue);
|
|
||||||
_scrollController.jumpTo(0);
|
|
||||||
}
|
}
|
||||||
|
return MediaTile(item: mediaState.mediaItems[index]);
|
||||||
},
|
},
|
||||||
|
childCount:
|
||||||
|
mediaState.mediaItems.length +
|
||||||
|
(mediaState.isLoading ? 1 : 0),
|
||||||
|
),
|
||||||
|
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
maxCrossAxisExtent: 150,
|
||||||
|
crossAxisSpacing: 5,
|
||||||
|
mainAxisSpacing: 5,
|
||||||
|
childAspectRatio: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const Text('mode: '),
|
|
||||||
DropdownButton<String>(
|
|
||||||
value: mediaModes[mediaState.modeIndex],
|
|
||||||
isDense: true,
|
|
||||||
items: mediaModes.map((String value) {
|
|
||||||
return DropdownMenuItem<String>(
|
|
||||||
value: value,
|
|
||||||
child: Text(value),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
if (newValue != null) {
|
|
||||||
mediaNotifier.setMode(mediaModes.indexOf(newValue));
|
|
||||||
_scrollController.jumpTo(0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
endDrawer: Drawer(
|
bottomNavigationBar: FilterBar(
|
||||||
child: ListView(
|
mediaNotifier: mediaNotifier,
|
||||||
padding: EdgeInsets.zero,
|
mediaState: mediaState,
|
||||||
children: [
|
scrollController: _scrollController,
|
||||||
DrawerHeader(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage('assets/images/menu.webp'),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
alignment: Alignment.topCenter,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: null,
|
|
||||||
),
|
|
||||||
ExpansionTile(
|
|
||||||
title: const Text('Login'),
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
TextField(
|
|
||||||
readOnly: true,
|
|
||||||
controller: _usernameController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Benutzername',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
TextField(
|
|
||||||
readOnly: true,
|
|
||||||
controller: _passwordController,
|
|
||||||
obscureText: true,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Passwort',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
const SnackBar(
|
|
||||||
content: Text("noch nicht implementiert lol"),
|
|
||||||
),
|
|
||||||
/*final success = await login(
|
|
||||||
_usernameController.text,
|
|
||||||
_passwordController.text,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text("Login fehlgeschlagen!")),
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: const Text('Login'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
ExpansionTile(
|
|
||||||
title: const Text('Theme'),
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
child: Column(
|
|
||||||
children: themeMap.entries.map((entry) {
|
|
||||||
final themeName = entry.key;
|
|
||||||
final themeData = entry.value;
|
|
||||||
final currentTheme = ref.watch(themeNotifierProvider);
|
|
||||||
final isSelected = currentTheme == themeData;
|
|
||||||
return ListTile(
|
|
||||||
title: Text(themeName),
|
|
||||||
selected: isSelected,
|
|
||||||
selectedTileColor: Colors.blue.withValues(alpha: 0.2),
|
|
||||||
onTap: () async {
|
|
||||||
await ref
|
|
||||||
.read(themeNotifierProvider.notifier)
|
|
||||||
.updateTheme(themeName);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text('v${AppVersion.version}'),
|
|
||||||
onTap: () {
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
const SnackBar(
|
|
||||||
content: Text('jooong lass das, hier ist nichts'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
endDrawer: EndDrawer(ref: ref),
|
||||||
persistentFooterButtons: mediaState.tag != null
|
persistentFooterButtons: mediaState.tag != null
|
||||||
? [
|
? [
|
||||||
Center(
|
Center(
|
||||||
@ -266,62 +149,6 @@ class _MediaGridState extends ConsumerState<MediaGrid> {
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
: null,
|
: null,
|
||||||
body: RefreshIndicator(
|
|
||||||
onRefresh: () async {
|
|
||||||
mediaNotifier.resetMedia();
|
|
||||||
_scrollController.jumpTo(0);
|
|
||||||
},
|
|
||||||
child: GridView.builder(
|
|
||||||
key: const PageStorageKey('mediaGrid'),
|
|
||||||
controller: _scrollController,
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: _calculateCrossAxisCount(
|
|
||||||
context,
|
|
||||||
mediaState.crossAxisCount,
|
|
||||||
),
|
|
||||||
crossAxisSpacing: 5.0,
|
|
||||||
mainAxisSpacing: 5.0,
|
|
||||||
),
|
|
||||||
itemCount:
|
|
||||||
mediaState.mediaItems.length + (mediaState.isLoading ? 1 : 0),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (index >= mediaState.mediaItems.length) {
|
|
||||||
return const Center(child: CircularProgressIndicator());
|
|
||||||
}
|
|
||||||
final item = mediaState.mediaItems[index];
|
|
||||||
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
context.push('/${item.id}', extra: true);
|
|
||||||
},
|
|
||||||
child: Stack(
|
|
||||||
fit: StackFit.expand,
|
|
||||||
children: <Widget>[
|
|
||||||
CachedNetworkImage(
|
|
||||||
imageUrl: item.thumbnailUrl,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
placeholder: (context, url) => const SizedBox.shrink(),
|
|
||||||
errorWidget: (context, url, error) =>
|
|
||||||
const Icon(Icons.error),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomRight,
|
|
||||||
child: Icon(
|
|
||||||
Icons.square,
|
|
||||||
color: switch (item.mode) {
|
|
||||||
1 => Colors.green,
|
|
||||||
2 => Colors.red,
|
|
||||||
_ => Colors.yellow,
|
|
||||||
},
|
|
||||||
size: 15.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
@ -6,26 +7,28 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|||||||
import 'package:f0ckapp/models/mediaitem_model.dart';
|
import 'package:f0ckapp/models/mediaitem_model.dart';
|
||||||
import 'package:f0ckapp/models/suggestion_model.dart';
|
import 'package:f0ckapp/models/suggestion_model.dart';
|
||||||
|
|
||||||
final FlutterSecureStorage storage = FlutterSecureStorage();
|
final FlutterSecureStorage storage = const FlutterSecureStorage(
|
||||||
|
aOptions: AndroidOptions(encryptedSharedPreferences: true),
|
||||||
|
);
|
||||||
|
|
||||||
Future<List<MediaItem>> fetchMedia({
|
Future<List<MediaItem>> fetchMedia({
|
||||||
int? older,
|
int? older,
|
||||||
String? type,
|
String type = 'image',
|
||||||
int? mode,
|
int mode = 0,
|
||||||
bool? random,
|
bool random = false,
|
||||||
String? tag,
|
String? tag,
|
||||||
}) async {
|
}) async {
|
||||||
final Uri url = Uri.parse('https://api.f0ck.me/items/get').replace(
|
final Uri url = Uri.parse('https://api.f0ck.me/items/get').replace(
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'type': type ?? 'image',
|
'type': type,
|
||||||
'mode': (mode ?? 0).toString(),
|
'mode': mode.toString(),
|
||||||
'random': (random! ? 1 : 0).toString(),
|
'random': (random ? 1 : 0).toString(),
|
||||||
if (tag != null) 'tag': tag,
|
if (tag != null) 'tag': tag,
|
||||||
if (older != null) 'older': older.toString(),
|
if (older != null) 'older': older.toString(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final response = await http.get(url);
|
final http.Response response = await http.get(url);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final List<dynamic> jsonList = jsonDecode(response.body);
|
final List<dynamic> jsonList = jsonDecode(response.body);
|
||||||
return jsonList.map((item) => MediaItem.fromJson(item)).toList();
|
return jsonList.map((item) => MediaItem.fromJson(item)).toList();
|
||||||
@ -37,7 +40,7 @@ Future<List<MediaItem>> fetchMedia({
|
|||||||
Future<MediaItem> fetchMediaDetail(int itemId) async {
|
Future<MediaItem> fetchMediaDetail(int itemId) async {
|
||||||
final Uri url = Uri.parse('https://api.f0ck.me/item/${itemId.toString()}');
|
final Uri url = Uri.parse('https://api.f0ck.me/item/${itemId.toString()}');
|
||||||
|
|
||||||
final response = await http.get(url);
|
final http.Response response = await http.get(url);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final Map<String, dynamic> jsonResponse = jsonDecode(response.body);
|
final Map<String, dynamic> jsonResponse = jsonDecode(response.body);
|
||||||
|
|
||||||
@ -50,51 +53,59 @@ Future<MediaItem> fetchMediaDetail(int itemId) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Suggestion>> fetchSuggestions(String query) async {
|
Future<List<Suggestion>> fetchSuggestions(String query) async {
|
||||||
final Uri uri = Uri.parse(
|
final Uri uri = Uri.parse('https://api.f0ck.me/search/?q=$query');
|
||||||
'https://f0ck.me/api/v2/admin/tags/suggest?q=$query',
|
try {
|
||||||
); // wip: new route in pyapi
|
final http.Response response = await http
|
||||||
final response = await http.get(uri);
|
.get(uri)
|
||||||
|
.timeout(const Duration(seconds: 5));
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final Map<String, dynamic> decoded = jsonDecode(response.body);
|
final dynamic decoded = jsonDecode(response.body);
|
||||||
if (decoded['success'] == true && decoded.containsKey('suggestions')) {
|
if (decoded is List) {
|
||||||
final List<dynamic> suggestionsList = decoded['suggestions'];
|
final suggestions = decoded
|
||||||
return suggestionsList
|
.map((item) => Suggestion.fromJson(item as Map<String, dynamic>))
|
||||||
.map(
|
.toList();
|
||||||
(dynamic jsonItem) =>
|
suggestions.sort((a, b) => b.score.compareTo(a.score));
|
||||||
Suggestion.fromJson(jsonItem as Map<String, dynamic>),
|
return suggestions;
|
||||||
)
|
|
||||||
.toList()
|
|
||||||
..sort(
|
|
||||||
(Suggestion a, Suggestion b) =>
|
|
||||||
(b.score * b.tagged).compareTo(a.score * a.tagged),
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
throw Exception('Nichts gefunden.');
|
throw Exception('Unerwartetes Format: Es wurde eine Liste erwartet.');
|
||||||
}
|
}
|
||||||
|
} else if (response.statusCode == 400) {
|
||||||
|
final dynamic error = jsonDecode(response.body);
|
||||||
|
final String message = error is Map<String, dynamic>
|
||||||
|
? error['detail']?.toString() ?? 'Unbekannter Fehler.'
|
||||||
|
: 'Unbekannter Fehler.';
|
||||||
|
throw Exception('Client-Fehler 400: $message');
|
||||||
} else {
|
} else {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
'Fehler beim Abrufen der Vorschläge: ${response.statusCode}',
|
'Fehler beim Abrufen der Vorschläge: ${response.statusCode}',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} on TimeoutException {
|
||||||
|
throw Exception('Anfrage an die API hat zu lange gedauert.');
|
||||||
|
} catch (e) {
|
||||||
|
throw Exception('Fehler bei der Verarbeitung der Anfrage: $e');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> login(String username, String password) async {
|
Future<bool> login(String username, String password) async {
|
||||||
final Uri url = Uri.parse('https://api.f0ck.me/login');
|
final Uri url = Uri.parse('https://api.f0ck.me/login');
|
||||||
|
|
||||||
final response = await http.post(
|
final http.Response response = await http.post(
|
||||||
url,
|
url,
|
||||||
body: {'username': username, 'password': password},
|
body: {'username': username, 'password': password},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final dynamic data = jsonDecode(response.body);
|
final dynamic data = jsonDecode(response.body);
|
||||||
final dynamic token = data['token'];
|
final token = data['token'];
|
||||||
|
if (token != null) {
|
||||||
await storage.write(key: "token", value: token);
|
await storage.write(key: "token", value: token);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
throw Exception('Token nicht im Response enthalten.');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw Exception('Login fehlgeschlagen: ${response.statusCode}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
import 'package:f0ckapp/services/api_service.dart';
|
import 'package:f0ckapp/services/api_service.dart';
|
||||||
import 'package:f0ckapp/models/suggestion_model.dart';
|
import 'package:f0ckapp/models/suggestion_model.dart';
|
||||||
import 'package:f0ckapp/providers/media_provider.dart';
|
import 'package:f0ckapp/providers/media_provider.dart';
|
||||||
|
|
||||||
class CustomSearchDelegate extends SearchDelegate<String> {
|
class CustomSearchDelegate extends SearchDelegate<String> {
|
||||||
|
Timer? _debounceTimer;
|
||||||
|
List<Suggestion>? _suggestions;
|
||||||
|
bool _isLoading = false;
|
||||||
|
String? _error;
|
||||||
|
String _lastFetchedQuery = "";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Widget> buildActions(BuildContext context) {
|
List<Widget> buildActions(BuildContext context) {
|
||||||
return [
|
return [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.clear),
|
icon: const Icon(Icons.clear),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
query = '';
|
query = '';
|
||||||
|
_clearResults();
|
||||||
showSuggestions(context);
|
showSuggestions(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -24,8 +29,11 @@ class CustomSearchDelegate extends SearchDelegate<String> {
|
|||||||
@override
|
@override
|
||||||
Widget buildLeading(BuildContext context) {
|
Widget buildLeading(BuildContext context) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
icon: Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
onPressed: () => close(context, 'null'),
|
onPressed: () {
|
||||||
|
_debounceTimer?.cancel();
|
||||||
|
close(context, 'null');
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,35 +44,58 @@ class CustomSearchDelegate extends SearchDelegate<String> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget buildSuggestions(BuildContext context) {
|
Widget buildSuggestions(BuildContext context) {
|
||||||
|
return StatefulBuilder(
|
||||||
|
builder: (BuildContext context, void Function(void Function()) setState) {
|
||||||
if (query.isEmpty) {
|
if (query.isEmpty) {
|
||||||
return Container(padding: EdgeInsets.all(16.0), child: Text(''));
|
_debounceTimer?.cancel();
|
||||||
|
return Container(padding: const EdgeInsets.all(16.0), child: const Text(''));
|
||||||
}
|
}
|
||||||
|
|
||||||
final Future<List<Suggestion>> futureSuggestions = Future.delayed(
|
if (query != _lastFetchedQuery) {
|
||||||
Duration(milliseconds: 300),
|
_debounceTimer?.cancel();
|
||||||
() => fetchSuggestions(query),
|
_isLoading = true;
|
||||||
);
|
_error = null;
|
||||||
|
_suggestions = null;
|
||||||
|
|
||||||
return FutureBuilder<List<Suggestion>>(
|
_debounceTimer = Timer(Duration(milliseconds: 500), () async {
|
||||||
future: futureSuggestions,
|
try {
|
||||||
builder: (BuildContext context, AsyncSnapshot<List<Suggestion>> snapshot) {
|
final List<Suggestion> results = await fetchSuggestions(query);
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
_lastFetchedQuery = query;
|
||||||
return Center(child: CircularProgressIndicator());
|
setState(() {
|
||||||
|
_suggestions = results;
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
_lastFetchedQuery = query;
|
||||||
|
setState(() {
|
||||||
|
_error = e.toString();
|
||||||
|
_suggestions = [];
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (snapshot.hasError) {
|
});
|
||||||
return Center(child: Text("Fehler: ${snapshot.error}"));
|
|
||||||
}
|
return Center(child: _buildLoadingIndicator());
|
||||||
if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
}
|
||||||
return Center(child: Text("Keine Vorschläge gefunden."));
|
|
||||||
|
if (_isLoading) {
|
||||||
|
return Center(child: _buildLoadingIndicator());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_error != null) {
|
||||||
|
return Center(child: Text("Fehler: $_error"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_suggestions == null || _suggestions!.isEmpty) {
|
||||||
|
return Center(child: const Text("Keine Ergebnisse gefunden."));
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Suggestion> suggestions = snapshot.data!;
|
|
||||||
return Consumer(
|
return Consumer(
|
||||||
builder: (BuildContext context, WidgetRef ref, Widget? child) {
|
builder: (BuildContext context, WidgetRef ref, Widget? child) {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: suggestions.length,
|
itemCount: _suggestions!.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final Suggestion suggestion = suggestions[index];
|
final Suggestion suggestion = _suggestions![index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(suggestion.tag),
|
title: Text(suggestion.tag),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
@ -83,4 +114,32 @@ class CustomSearchDelegate extends SearchDelegate<String> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildLoadingIndicator() {
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const CircularProgressIndicator(strokeWidth: 3.0),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
const Text(
|
||||||
|
'Vorschläge werden geladen...',
|
||||||
|
style: TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _clearResults() {
|
||||||
|
_debounceTimer?.cancel();
|
||||||
|
_suggestions = null;
|
||||||
|
_isLoading = false;
|
||||||
|
_error = null;
|
||||||
|
_lastFetchedQuery = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void close(BuildContext context, String result) {
|
||||||
|
_debounceTimer?.cancel();
|
||||||
|
super.close(context, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
122
lib/widgets/end_drawer.dart
Normal file
122
lib/widgets/end_drawer.dart
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
import 'package:f0ckapp/providers/theme_provider.dart';
|
||||||
|
import 'package:f0ckapp/utils/appversion_util.dart';
|
||||||
|
|
||||||
|
class EndDrawer extends StatelessWidget {
|
||||||
|
final WidgetRef ref;
|
||||||
|
|
||||||
|
const EndDrawer({super.key, required this.ref});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Drawer(
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
children: [
|
||||||
|
DrawerHeader(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/menu.webp'),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: null,
|
||||||
|
),
|
||||||
|
/*ExpansionTile(
|
||||||
|
title: const Text('Login'),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TextField(
|
||||||
|
readOnly: true,
|
||||||
|
controller: _usernameController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Benutzername',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
TextField(
|
||||||
|
readOnly: true,
|
||||||
|
controller: _passwordController,
|
||||||
|
obscureText: true,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Passwort',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text("noch nicht implementiert lol"),
|
||||||
|
),
|
||||||
|
final success = await login(
|
||||||
|
_usernameController.text,
|
||||||
|
_passwordController.text,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text("Login fehlgeschlagen!")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: const Text('Login'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),*/
|
||||||
|
ExpansionTile(
|
||||||
|
title: const Text('Theme'),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: Column(
|
||||||
|
children: themeMap.entries.map((entry) {
|
||||||
|
final String themeName = entry.key;
|
||||||
|
final ThemeData themeData = entry.value;
|
||||||
|
final ThemeData currentTheme = ref.watch(
|
||||||
|
themeNotifierProvider,
|
||||||
|
);
|
||||||
|
final bool isSelected = currentTheme == themeData;
|
||||||
|
return ListTile(
|
||||||
|
title: Text(themeName),
|
||||||
|
selected: isSelected,
|
||||||
|
selectedTileColor: Colors.blue.withValues(alpha: 0.2),
|
||||||
|
onTap: () async {
|
||||||
|
await ref
|
||||||
|
.read(themeNotifierProvider.notifier)
|
||||||
|
.updateTheme(themeName);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text('v${AppVersion.version}'),
|
||||||
|
onTap: () {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('jooong lass das, hier ist nichts'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
62
lib/widgets/filter_bar.dart
Normal file
62
lib/widgets/filter_bar.dart
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:f0ckapp/providers/media_provider.dart';
|
||||||
|
|
||||||
|
class FilterBar extends StatelessWidget {
|
||||||
|
final MediaState mediaState;
|
||||||
|
final MediaNotifier mediaNotifier;
|
||||||
|
final ScrollController scrollController;
|
||||||
|
|
||||||
|
const FilterBar({
|
||||||
|
super.key,
|
||||||
|
required this.mediaState,
|
||||||
|
required this.mediaNotifier,
|
||||||
|
required this.scrollController,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BottomAppBar(
|
||||||
|
height: 50,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
const Text('type: '),
|
||||||
|
DropdownButton<String>(
|
||||||
|
value: mediaTypes[mediaState.typeIndex],
|
||||||
|
isDense: true,
|
||||||
|
items: mediaTypes.map((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
if (newValue != null) {
|
||||||
|
mediaNotifier.setType(newValue);
|
||||||
|
scrollController.jumpTo(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const Text('mode: '),
|
||||||
|
DropdownButton<String>(
|
||||||
|
value: mediaModes[mediaState.modeIndex],
|
||||||
|
isDense: true,
|
||||||
|
items: mediaModes.map((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
if (newValue != null) {
|
||||||
|
mediaNotifier.setMode(mediaModes.indexOf(newValue));
|
||||||
|
scrollController.jumpTo(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
46
lib/widgets/media_tile.dart
Normal file
46
lib/widgets/media_tile.dart
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
import 'package:f0ckapp/models/mediaitem_model.dart';
|
||||||
|
|
||||||
|
class MediaTile extends StatelessWidget {
|
||||||
|
final MediaItem item;
|
||||||
|
|
||||||
|
const MediaTile({super.key, required this.item});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
context.push('/${item.id}', extra: true);
|
||||||
|
},
|
||||||
|
child: Stack(
|
||||||
|
fit: StackFit.expand,
|
||||||
|
children: [
|
||||||
|
Hero(
|
||||||
|
tag: 'media-${item.id}',
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: item.thumbnailUrl,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
child: Icon(
|
||||||
|
Icons.square,
|
||||||
|
color: switch (item.mode) {
|
||||||
|
1 => Colors.green,
|
||||||
|
2 => Colors.red,
|
||||||
|
_ => Colors.yellow,
|
||||||
|
},
|
||||||
|
size: 15.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -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> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
58
pubspec.lock
58
pubspec.lock
@ -150,14 +150,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.4.1"
|
version: "3.4.1"
|
||||||
flutter_downloader:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_downloader
|
|
||||||
sha256: "93a9ddbd561f8a3f5483b4189453fba145a0a1014a88143c96a966296b78a118"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.12.0"
|
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -393,7 +385,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.9.1"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||||
@ -440,54 +432,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.0"
|
||||||
permission_handler:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: permission_handler
|
|
||||||
sha256: "2d070d8684b68efb580a5997eb62f675e8a885ef0be6e754fb9ef489c177470f"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "12.0.0+1"
|
|
||||||
permission_handler_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: permission_handler_android
|
|
||||||
sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "13.0.1"
|
|
||||||
permission_handler_apple:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: permission_handler_apple
|
|
||||||
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "9.4.7"
|
|
||||||
permission_handler_html:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: permission_handler_html
|
|
||||||
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.3+5"
|
|
||||||
permission_handler_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: permission_handler_platform_interface
|
|
||||||
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.3.0"
|
|
||||||
permission_handler_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: permission_handler_windows
|
|
||||||
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.1"
|
|
||||||
platform:
|
platform:
|
||||||
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.11+41
|
version: 1.1.21+51
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.9.0-100.2.beta
|
sdk: ^3.9.0-100.2.beta
|
||||||
@ -42,9 +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
|
||||||
flutter_downloader: ^1.12.0
|
|
||||||
permission_handler: ^12.0.0+1
|
|
||||||
path_provider: ^2.1.5
|
|
||||||
|
|
||||||
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