diff --git a/bonfire/lib/features/auth/views/switcher.dart b/bonfire/lib/features/auth/views/switcher.dart index e7e4e6af..49d82cd6 100644 --- a/bonfire/lib/features/auth/views/switcher.dart +++ b/bonfire/lib/features/auth/views/switcher.dart @@ -1,4 +1,3 @@ -import 'package:bonfire/features/auth/views/credentials.dart'; import 'package:bonfire/theme/theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/bonfire/lib/features/forum/views/components/card/card.dart b/bonfire/lib/features/forum/views/components/card/card.dart index e2825465..895ad581 100644 --- a/bonfire/lib/features/forum/views/components/card/card.dart +++ b/bonfire/lib/features/forum/views/components/card/card.dart @@ -1,5 +1,4 @@ import 'package:bonfire/features/forum/controllers/forum.dart'; -import 'package:bonfire/features/forum/repositories/forum_posts.dart'; import 'package:bonfire/theme/theme.dart'; import 'package:firebridge/firebridge.dart'; import 'package:flutter/material.dart'; @@ -24,19 +23,8 @@ class _ThreadCardState extends ConsumerState { @override void initState() { super.initState(); - // widget.scrollController.addListener(_onScroll); } - // void _onScroll() { - // if (widget.scrollController.position.pixels >= - // widget.scrollController.position.maxScrollExtent - 200) { - // final forumPosts = ref.read(forumPostsProvider(widget.threadId).notifier); - // if (forumPosts.hasMore) { - // forumPosts.loadMore(); - // } - // } - // } - @override Widget build(BuildContext context) { // a bit of a hack, this can probably be done using other thread types so that should be handled @@ -62,61 +50,49 @@ class _ThreadCardState extends ConsumerState { context.go( "/channels/${thread.guildId}/${widget.channelId}/threads/${thread.id}/"); }, - child: Container( - decoration: BoxDecoration( - // color: Theme.of(context).custom.colorTheme.foreground, - // borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(12), - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - thread.name, - style: Theme.of(context).custom.textTheme.titleSmall, - ), - if (previewMessage != null) - ConstrainedBox( - constraints: - const BoxConstraints(maxHeight: 50, minHeight: 0), - child: Text( - previewMessage.content, - style: Theme.of(context).custom.textTheme.bodyText2, - overflow: TextOverflow.ellipsis, - maxLines: 2, - ), + child: Padding( + padding: const EdgeInsets.all(12), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + thread.name, + style: Theme.of(context).custom.textTheme.titleSmall, + ), + if (previewMessage != null) + ConstrainedBox( + constraints: + const BoxConstraints(maxHeight: 50, minHeight: 0), + child: Text( + previewMessage.content, + style: Theme.of(context).custom.textTheme.bodyText2, + overflow: TextOverflow.ellipsis, + maxLines: 2, ), - ], - ), + ), + ], ), - if (previewMessage?.attachments.isNotEmpty == true && - previewMessage!.attachments.first.contentType - ?.split("/")[0] == - "image") - ClipRRect( - borderRadius: BorderRadius.circular(8), - child: Image.network( - previewMessage.attachments.first.url.toString(), - width: 80, - height: 80, - fit: BoxFit.cover, - ), + ), + if (previewMessage?.attachments.isNotEmpty == true && + previewMessage!.attachments.first.contentType + ?.split("/")[0] == + "image") + ClipRRect( + borderRadius: BorderRadius.circular(8), + child: Image.network( + previewMessage.attachments.first.url.toString(), + width: 80, + height: 80, + fit: BoxFit.cover, ), - ], - ), + ), + ], ), ), ), ); } - - @override - void dispose() { - // widget.scrollController.removeListener(_onScroll); - super.dispose(); - } } diff --git a/bonfire/lib/features/forum/views/forum.dart b/bonfire/lib/features/forum/views/forum.dart index 9b247935..ad5b0d0a 100644 --- a/bonfire/lib/features/forum/views/forum.dart +++ b/bonfire/lib/features/forum/views/forum.dart @@ -64,7 +64,7 @@ class _ForumViewState extends ConsumerState { data: (threadLists) { // Combine all threads from the list of ThreadLists threads = threadLists.expand((threadList) { - return (threadList?.threads ?? []) as List; + return threadList?.threads ?? [] as List; }).toList(); return Stack( diff --git a/bonfire/lib/features/friends/views/friend_card.dart b/bonfire/lib/features/friends/views/friend_card.dart index a69a11df..0ba4f992 100644 --- a/bonfire/lib/features/friends/views/friend_card.dart +++ b/bonfire/lib/features/friends/views/friend_card.dart @@ -1,4 +1,3 @@ -import 'package:bonfire/features/me/controllers/settings.dart'; import 'package:bonfire/features/user/components/presence_avatar.dart'; import 'package:bonfire/features/user/controllers/presence.dart'; import 'package:bonfire/shared/widgets/presence_text.dart'; diff --git a/bonfire/lib/features/me/views/components/messages.dart b/bonfire/lib/features/me/views/components/messages.dart index 69b21883..8d12313a 100644 --- a/bonfire/lib/features/me/views/components/messages.dart +++ b/bonfire/lib/features/me/views/components/messages.dart @@ -24,7 +24,7 @@ class MessageView extends ConsumerStatefulWidget { class _MessageViewState extends ConsumerState { @override Widget build(BuildContext context) { - var channelId = widget.channelId; + Snowflake channelId = widget.channelId; if (widget.threadId != null) { channelId = widget.threadId!; } diff --git a/bonfire/lib/features/messaging/views/components/message_list.dart b/bonfire/lib/features/messaging/views/components/message_list.dart index dae7c21c..405c49ab 100644 --- a/bonfire/lib/features/messaging/views/components/message_list.dart +++ b/bonfire/lib/features/messaging/views/components/message_list.dart @@ -237,35 +237,33 @@ class _MessageViewState extends ConsumerState channelName = getChannelName(channel); return Scaffold( - body: Container( - child: Column( - children: [ - Expanded( - child: Stack( - children: [ - FadeTransition( - opacity: _fadeAnimation, - child: Align( - alignment: Alignment.bottomLeft, - child: content, - )), - if (!isSmartwatch(context)) - ChannelHeader(channelName: channelName), - ], - ), + body: Column( + children: [ + Expanded( + child: Stack( + children: [ + FadeTransition( + opacity: _fadeAnimation, + child: Align( + alignment: Alignment.bottomLeft, + child: content, + )), + if (!isSmartwatch(context)) + ChannelHeader(channelName: channelName), + ], ), - if (!isSmartwatch(context)) - MessageBar( - guildId: guild?.id ?? Snowflake.zero, - channel: channel, - ), - if (!isSmartwatch(context)) - SizedBox( - height: MediaQuery.of(context).padding.bottom, - ), - if (!isSmartwatch(context)) const KeyboardBuffer() - ], - ), + ), + if (!isSmartwatch(context)) + MessageBar( + guildId: guild?.id ?? Snowflake.zero, + channel: channel, + ), + if (!isSmartwatch(context)) + SizedBox( + height: MediaQuery.of(context).padding.bottom, + ), + if (!isSmartwatch(context)) const KeyboardBuffer() + ], ), ); } diff --git a/bonfire/lib/features/overview/views/overlapping_panels.dart b/bonfire/lib/features/overview/views/overlapping_panels.dart index b90059d9..f3dc1117 100644 --- a/bonfire/lib/features/overview/views/overlapping_panels.dart +++ b/bonfire/lib/features/overview/views/overlapping_panels.dart @@ -118,7 +118,6 @@ class OverlappingPanelsState extends State goal = _calculateGoal(mediaWidth, -1); break; case RevealSide.main: - default: goal = 0; break; } @@ -133,25 +132,22 @@ class OverlappingPanelsState extends State void _onApplyTranslation() { final mediaWidth = MediaQuery.of(context).size.width; - var _averagedDelta = (_lastDelta + _lastLastDelta) / 2; - print("LastDelta $_lastDelta"); - print("LastLastDelta $_lastLastDelta"); - print("AveragedDelta $_averagedDelta"); + double averagedDelta = (_lastDelta + _lastLastDelta) / 2; var goal = 0.0; - if (_averagedDelta > 0) { + if (averagedDelta > 0) { goal = _calculateGoal(mediaWidth, 1); } - if (_averagedDelta < 0) { + if (averagedDelta < 0) { goal = _calculateGoal(mediaWidth, -1); } - if (_averagedDelta > 0 && _translate < 0) { + if (averagedDelta > 0 && _translate < 0) { goal = 0; } - if (_averagedDelta < 0 && _translate > 0) { + if (averagedDelta < 0 && _translate > 0) { goal = 0; } diff --git a/bonfire/pubspec.lock b/bonfire/pubspec.lock index 7e244305..7f0194bf 100644 --- a/bonfire/pubspec.lock +++ b/bonfire/pubspec.lock @@ -1005,11 +1005,11 @@ packages: path: media_kit ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" resolved-ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" - url: "https://github.com/media-kit/media-kit" + url: "https://github.com/media-kit/media-kit.git" source: git version: "1.1.11" media_kit_libs_android_video: - dependency: "direct main" + dependency: transitive description: name: media_kit_libs_android_video sha256: "9dd8012572e4aff47516e55f2597998f0a378e3d588d0fad0ca1f11a53ae090c" @@ -1017,7 +1017,7 @@ packages: source: hosted version: "1.3.6" media_kit_libs_ios_video: - dependency: "direct main" + dependency: transitive description: name: media_kit_libs_ios_video sha256: b5382994eb37a4564c368386c154ad70ba0cc78dacdd3fb0cd9f30db6d837991 @@ -1025,7 +1025,7 @@ packages: source: hosted version: "1.1.4" media_kit_libs_linux: - dependency: "direct main" + dependency: transitive description: name: media_kit_libs_linux sha256: e186891c31daa6bedab4d74dcdb4e8adfccc7d786bfed6ad81fe24a3b3010310 @@ -1033,7 +1033,7 @@ packages: source: hosted version: "1.1.3" media_kit_libs_macos_video: - dependency: "direct main" + dependency: transitive description: name: media_kit_libs_macos_video sha256: f26aa1452b665df288e360393758f84b911f70ffb3878032e1aabba23aa1032d @@ -1041,16 +1041,16 @@ packages: source: hosted version: "1.1.4" media_kit_libs_video: - dependency: "direct overridden" + dependency: "direct main" description: path: "libs/universal/media_kit_libs_video" ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" resolved-ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" - url: "https://github.com/media-kit/media-kit" + url: "https://github.com/media-kit/media-kit.git" source: git version: "1.0.5" media_kit_libs_windows_video: - dependency: "direct main" + dependency: transitive description: name: media_kit_libs_windows_video sha256: "32654572167825c42c55466f5d08eee23ea11061c84aa91b09d0e0f69bdd0887" @@ -1071,7 +1071,7 @@ packages: path: media_kit_video ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" resolved-ref: "652c49e02701bb6bb80953a6fdf650a5c8f002f9" - url: "https://github.com/media-kit/media-kit" + url: "https://github.com/media-kit/media-kit.git" source: git version: "1.2.5" meta: @@ -1134,18 +1134,18 @@ packages: dependency: transitive description: name: package_info_plus - sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 + sha256: "70c421fe9d9cc1a9a7f3b05ae56befd469fe4f8daa3b484823141a55442d858d" url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "8.1.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" path: dependency: "direct main" description: diff --git a/bonfire/pubspec.yaml b/bonfire/pubspec.yaml index ac9bef04..c38ede17 100644 --- a/bonfire/pubspec.yaml +++ b/bonfire/pubspec.yaml @@ -38,12 +38,28 @@ dependencies: go_router: ^13.2.4 flutter_prism: ^0.2.2 + media_kit: + git: + url: https://github.com/media-kit/media-kit.git + ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 + path: ./media_kit + media_kit_video: + git: + url: https://github.com/media-kit/media-kit.git + ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 + path: ./media_kit_video + media_kit_libs_video: + git: + url: https://github.com/media-kit/media-kit.git + ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 + path: ./libs/universal/media_kit_libs_video + video_player_media_kit: ^1.0.5 - media_kit_libs_android_video: any - media_kit_libs_ios_video: any - media_kit_libs_macos_video: any - media_kit_libs_windows_video: any - media_kit_libs_linux: any + # media_kit_libs_android_video: any + # media_kit_libs_ios_video: any + # media_kit_libs_macos_video: any + # media_kit_libs_windows_video: any + # media_kit_libs_linux: any url_launcher: ^6.2.6 sticky_headers: ^0.3.0+2 flutter_svg: ^2.0.10+1 @@ -57,8 +73,6 @@ dependencies: dio: ^5.4.3+1 permission_handler: ^11.3.1 path_provider: ^2.1.3 - media_kit: ^1.1.10+1 - media_kit_video: ^1.2.4 universal_platform: ^1.1.0 dynamic_height_grid_view: ^0.0.4 loading_animation_widget: ^1.2.1 @@ -84,25 +98,19 @@ dependency_overrides: media_kit: git: - url: https://github.com/media-kit/media-kit - path: media_kit + url: https://github.com/media-kit/media-kit.git ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 + path: ./media_kit media_kit_video: git: - url: https://github.com/media-kit/media-kit - path: media_kit_video + url: https://github.com/media-kit/media-kit.git ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 + path: ./media_kit_video media_kit_libs_video: git: - url: https://github.com/media-kit/media-kit - path: libs/universal/media_kit_libs_video + url: https://github.com/media-kit/media-kit.git ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9 - - # media_kit_native_event_loop: - # git: - # url: https://github.com/media-kit/media-kit - # path: media_kit_native_event_loop - # ref: main + path: ./libs/universal/media_kit_libs_video flutter_keyboard_visibility_web: git: diff --git a/bonfire/windows/runner/media_kit_libs_windows_video_plugin.dll b/bonfire/windows/runner/media_kit_libs_windows_video_plugin.dll deleted file mode 100644 index e3fa3a30..00000000 Binary files a/bonfire/windows/runner/media_kit_libs_windows_video_plugin.dll and /dev/null differ diff --git a/bonfire/windows/runner/media_kit_native_event_loop.dll b/bonfire/windows/runner/media_kit_native_event_loop.dll deleted file mode 100644 index b5be0721..00000000 Binary files a/bonfire/windows/runner/media_kit_native_event_loop.dll and /dev/null differ diff --git a/bonfire/windows/runner/media_kit_video_plugin.dll b/bonfire/windows/runner/media_kit_video_plugin.dll deleted file mode 100644 index 9b8b5f06..00000000 Binary files a/bonfire/windows/runner/media_kit_video_plugin.dll and /dev/null differ