Compare commits
2 Commits
v1.1.20+50
...
v1.1.22+52
Author | SHA1 | Date | |
---|---|---|---|
16ebc51e77 | |||
7981436374 |
@ -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),
|
||||||
|
@ -105,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(),
|
||||||
@ -125,113 +123,8 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
|
||||||
centerTitle: true,
|
|
||||||
title: Text('f0ck #${mediaState.mediaItems[_currentIndex].id}'),
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
leading: IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_back),
|
|
||||||
onPressed: () {
|
|
||||||
context.canPop() ? context.pop() : context.go('/', extra: true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.fullscreen),
|
|
||||||
onPressed: () {
|
|
||||||
final mediaState = ref.read(mediaProvider);
|
|
||||||
final currentItem = mediaState.mediaItems[_currentIndex];
|
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => FullScreenMediaView(item: currentItem),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.download),
|
|
||||||
onPressed: _downloadMedia,
|
|
||||||
),
|
|
||||||
PopupMenuButton<String>(
|
|
||||||
onSelected: (value) async {
|
|
||||||
final item = mediaState.mediaItems[_currentIndex];
|
|
||||||
switch (value) {
|
|
||||||
case 'media':
|
|
||||||
File file = await DefaultCacheManager().getSingleFile(
|
|
||||||
item.mediaUrl,
|
|
||||||
);
|
|
||||||
Uint8List bytes = await file.readAsBytes();
|
|
||||||
final params = ShareParams(
|
|
||||||
files: [XFile.fromData(bytes, mimeType: item.mime)],
|
|
||||||
);
|
|
||||||
await SharePlus.instance.share(params);
|
|
||||||
break;
|
|
||||||
case 'direct_link':
|
|
||||||
await SharePlus.instance.share(
|
|
||||||
ShareParams(text: item.mediaUrl),
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'post_link':
|
|
||||||
await SharePlus.instance.share(
|
|
||||||
ShareParams(text: item.postUrl),
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemBuilder: (context) => [
|
|
||||||
PopupMenuItem(
|
|
||||||
value: 'media',
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.image),
|
|
||||||
title: const Text('Als Datei'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PopupMenuItem(
|
|
||||||
value: 'direct_link',
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.link),
|
|
||||||
title: const Text('Link zur Datei'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PopupMenuItem(
|
|
||||||
value: 'post_link',
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.article),
|
|
||||||
title: const Text('Link zum f0ck'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
icon: const Icon(Icons.share),
|
|
||||||
),
|
|
||||||
Builder(
|
|
||||||
builder: (context) {
|
|
||||||
return IconButton(
|
|
||||||
icon: const Icon(Icons.menu),
|
|
||||||
onPressed: () {
|
|
||||||
Scaffold.of(context).openEndDrawer();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
endDrawer: EndDrawer(ref: ref),
|
endDrawer: EndDrawer(ref: ref),
|
||||||
body: Stack(
|
endDrawerEnableOpenDragGesture: false,
|
||||||
children: [
|
|
||||||
PageTransformer(
|
|
||||||
controller: _pageController!,
|
|
||||||
pages: mediaState.mediaItems.map((item) {
|
|
||||||
int itemIndex = mediaState.mediaItems.indexOf(item);
|
|
||||||
return SafeArea(
|
|
||||||
child: SmartRefreshIndicator(
|
|
||||||
onRefresh: _loadMoreMedia,
|
|
||||||
child: _buildMediaItem(item, _currentIndex == itemIndex),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
persistentFooterButtons: mediaState.tag != null
|
persistentFooterButtons: mediaState.tag != null
|
||||||
? [
|
? [
|
||||||
Center(
|
Center(
|
||||||
@ -245,6 +138,116 @@ class _DetailViewState extends ConsumerState<DetailView> {
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
: null,
|
: null,
|
||||||
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
floating: true,
|
||||||
|
snap: true,
|
||||||
|
centerTitle: true,
|
||||||
|
title: Text('f0ck #${mediaState.mediaItems[_currentIndex].id}'),
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
onPressed: () {
|
||||||
|
context.canPop() ? context.pop() : context.go('/', extra: true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.fullscreen),
|
||||||
|
onPressed: () {
|
||||||
|
final currentItem = mediaState.mediaItems[_currentIndex];
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => FullScreenMediaView(item: currentItem),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.download),
|
||||||
|
onPressed: _downloadMedia,
|
||||||
|
),
|
||||||
|
PopupMenuButton<String>(
|
||||||
|
onSelected: (value) async {
|
||||||
|
final item = mediaState.mediaItems[_currentIndex];
|
||||||
|
switch (value) {
|
||||||
|
case 'media':
|
||||||
|
File file = await DefaultCacheManager().getSingleFile(
|
||||||
|
item.mediaUrl,
|
||||||
|
);
|
||||||
|
Uint8List bytes = await file.readAsBytes();
|
||||||
|
final params = ShareParams(
|
||||||
|
files: [XFile.fromData(bytes, mimeType: item.mime)],
|
||||||
|
);
|
||||||
|
await SharePlus.instance.share(params);
|
||||||
|
break;
|
||||||
|
case 'direct_link':
|
||||||
|
await SharePlus.instance.share(
|
||||||
|
ShareParams(text: item.mediaUrl),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'post_link':
|
||||||
|
await SharePlus.instance.share(
|
||||||
|
ShareParams(text: item.postUrl),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemBuilder: (context) => [
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'media',
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.image),
|
||||||
|
title: const Text('Als Datei'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'direct_link',
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.link),
|
||||||
|
title: const Text('Link zur Datei'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'post_link',
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.article),
|
||||||
|
title: const Text('Link zum f0ck'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
icon: const Icon(Icons.share),
|
||||||
|
),
|
||||||
|
Builder(
|
||||||
|
builder: (context) => IconButton(
|
||||||
|
icon: const Icon(Icons.menu),
|
||||||
|
onPressed: () {
|
||||||
|
Scaffold.of(context).openEndDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
sliver: SliverFillRemaining(
|
||||||
|
child: PageTransformer(
|
||||||
|
controller: _pageController!,
|
||||||
|
pages: mediaState.mediaItems.map((item) {
|
||||||
|
int pageIndex = mediaState.mediaItems.indexOf(item);
|
||||||
|
return SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: SmartRefreshIndicator(
|
||||||
|
onRefresh: _loadMoreMedia,
|
||||||
|
child: _buildMediaItem(item, _currentIndex == pageIndex),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,8 +261,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),
|
||||||
|
@ -40,7 +40,7 @@ class _FullScreenMediaViewState extends State<FullScreenMediaView> {
|
|||||||
child: widget.item.mime.startsWith('image')
|
child: widget.item.mime.startsWith('image')
|
||||||
? InteractiveViewer(
|
? InteractiveViewer(
|
||||||
minScale: 1.0,
|
minScale: 1.0,
|
||||||
maxScale: 6.0,
|
maxScale: 7.0,
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: widget.item.mediaUrl,
|
imageUrl: widget.item.mediaUrl,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
@ -62,7 +62,7 @@ class _FullScreenMediaViewState extends State<FullScreenMediaView> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -106,7 +106,7 @@ class _MediaGridState extends ConsumerState<MediaGrid> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.all(5.0),
|
padding: EdgeInsets.zero,
|
||||||
sliver: SliverGrid(
|
sliver: SliverGrid(
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
@ -136,6 +136,7 @@ class _MediaGridState extends ConsumerState<MediaGrid> {
|
|||||||
scrollController: _scrollController,
|
scrollController: _scrollController,
|
||||||
),
|
),
|
||||||
endDrawer: EndDrawer(ref: ref),
|
endDrawer: EndDrawer(ref: ref),
|
||||||
|
endDrawerEnableOpenDragGesture: false,
|
||||||
persistentFooterButtons: mediaState.tag != null
|
persistentFooterButtons: mediaState.tag != null
|
||||||
? [
|
? [
|
||||||
Center(
|
Center(
|
||||||
|
@ -10,6 +10,12 @@ class EndDrawer extends StatelessWidget {
|
|||||||
|
|
||||||
const EndDrawer({super.key, required this.ref});
|
const EndDrawer({super.key, required this.ref});
|
||||||
|
|
||||||
|
void _showMsg(String message, BuildContext context) {
|
||||||
|
ScaffoldMessenger.of(context)
|
||||||
|
..removeCurrentSnackBar()
|
||||||
|
..showSnackBar(SnackBar(content: Text(message)));
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Drawer(
|
return Drawer(
|
||||||
@ -105,14 +111,18 @@ class EndDrawer extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: const Text('Einstellungen'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
_showMsg('wip', context);
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('v${AppVersion.version}'),
|
title: Text('v${AppVersion.version}'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
Navigator.pop(context);
|
||||||
const SnackBar(
|
_showMsg('jooong lass das, hier ist nichts', context);
|
||||||
content: Text('jooong lass das, hier ist nichts'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -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.20+50
|
version: 1.1.22+52
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.9.0-100.2.beta
|
sdk: ^3.9.0-100.2.beta
|
||||||
|
Reference in New Issue
Block a user