Skip to content

Commit

Permalink
Merge branch 'master' into fix/copy-message
Browse files Browse the repository at this point in the history
  • Loading branch information
deven98 committed Jul 3, 2024
2 parents 7156a56 + b1bb239 commit fb92f29
Show file tree
Hide file tree
Showing 28 changed files with 135 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/legacy_version_analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: legacy_version_analyze
env:
# Note: The versions below should be manually updated after a new stable
# version comes out.
flutter_version: "3.13.9"
flutter_version: "3.19.6"

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stream_flutter_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: stream_flutter_workflow
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
flutter_channel: "stable"
flutter_version: "3.13.9"
flutter_version: "3.22.2"

on:
pull_request:
Expand Down
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ linter:
- empty_statements
- hash_and_equals
- invariant_booleans
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
Expand All @@ -35,7 +33,6 @@ linter:
- use_key_in_widget_constructors
- valid_regexps
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
Expand Down
4 changes: 2 additions & 2 deletions packages/stream_chat/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

dependencies:
cupertino_icons: ^1.0.5
Expand Down
2 changes: 0 additions & 2 deletions packages/stream_chat/lib/src/client/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1714,8 +1714,6 @@ class ClientState {
/// The current user as a stream
Stream<OwnUser?> get currentUserStream => _currentUserController.stream;

// coverage:ignore-end

/// The current user
Map<String, User> get users => _usersController.value;

Expand Down
14 changes: 7 additions & 7 deletions packages/stream_chat/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

environment:
sdk: '>=3.1.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'

dependencies:
async: ^2.11.0
collection: ^1.17.2
dio: ^5.3.2
dio: ^5.4.3+1
equatable: ^2.0.5
freezed_annotation: ^2.4.1
http_parser: ^4.0.2
jose: ^0.3.4
json_annotation: ^4.8.1
json_annotation: ^4.9.0
logging: ^1.2.0
meta: ^1.9.1
mime: ^1.0.4
mime: ^1.0.5
rate_limiter: ^1.0.0
rxdart: ^0.27.7
synchronized: ^3.1.0
uuid: ^4.2.1
web_socket_channel: ^2.4.0
synchronized: ^3.1.0+1
uuid: ^4.4.0
web_socket_channel: ^2.4.5

dev_dependencies:
build_runner: ^2.4.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<application
android:name=".Application"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="example">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:name="io.flutter.embedding.android.FlutterActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package com.example.example

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

#include "generated_plugin_registrant.h"

#include <dart_vlc/dart_vlc_plugin.h>
#include <desktop_drop/desktop_drop_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <media_kit_video/media_kit_video_plugin.h>
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dart_vlc_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DartVlcPlugin");
dart_vlc_plugin_register_with_registrar(dart_vlc_registrar);
g_autoptr(FlPluginRegistrar) desktop_drop_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopDropPlugin");
desktop_drop_plugin_register_with_registrar(desktop_drop_registrar);
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) media_kit_video_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin");
media_kit_video_plugin_register_with_registrar(media_kit_video_registrar);
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
dart_vlc
desktop_drop
file_selector_linux
media_kit_video
sqlite3_flutter_libs
url_launcher_linux
)
Expand Down
4 changes: 2 additions & 2 deletions packages/stream_chat_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

dependencies:
collection: ^1.15.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
#include "generated_plugin_registrant.h"

#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <dart_vlc/dart_vlc_plugin.h>
#include <desktop_drop/desktop_drop_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
#include <screen_brightness_windows/screen_brightness_windows_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
#include <thumblr_windows/thumblr_windows_plugin.h>
Expand All @@ -18,12 +19,14 @@
void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
DartVlcPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DartVlcPlugin"));
DesktopDropPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopDropPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
MediaKitVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
dart_vlc
desktop_drop
file_selector_windows
media_kit_video
screen_brightness_windows
share_plus
sqlite3_flutter_libs
thumblr_windows
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:contextmenu/contextmenu.dart';
import 'package:dart_vlc/dart_vlc.dart';
import 'package:flutter/material.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart';
import 'package:photo_view/photo_view.dart';
import 'package:stream_chat_flutter/src/context_menu_items/download_menu_item.dart';
import 'package:stream_chat_flutter/src/fullscreen_media/full_screen_media_widget.dart';
Expand Down Expand Up @@ -332,14 +333,16 @@ class _FullScreenMediaDesktopState extends State<FullScreenMediaDesktop> {
);
} else if (attachment.type == AttachmentType.video) {
final package = videoPackages[attachment.id]!;
package.player.open(
Playlist(
medias: [
Media.network(package.attachment.assetUrl),
],
),
autoStart: widget.autoplayVideos,
);
if (package.attachment.assetUrl != null) {
package.player.open(
Playlist(
[
Media(package.attachment.assetUrl!),
],
),
play: widget.autoplayVideos,
);
}

final mediaQuery = MediaQuery.of(context);
final bottomPadding = mediaQuery.padding.bottom;
Expand All @@ -359,7 +362,7 @@ class _FullScreenMediaDesktopState extends State<FullScreenMediaDesktop> {
),
],
child: Video(
player: package.player,
controller: package.controller,
),
),
);
Expand All @@ -382,24 +385,36 @@ class _FullScreenMediaDesktopState extends State<FullScreenMediaDesktop> {
/// Class for packaging up things required for videos
class DesktopVideoPackage {
/// Constructor for creating [VideoPackage]
DesktopVideoPackage(
this.attachment, {
this.showControls = true,
}) : player = Player(
id: int.parse(
attachment.id.characters
.getRange(0, 10)
.toString()
.replaceAll(RegExp('[^0-9]'), ''),
),
);
factory DesktopVideoPackage(
Attachment attachment, {
bool showControls = true,
}) {
final player = Player();
final controller = VideoController(player);
return DesktopVideoPackage._internal(
attachment,
player,
controller,
showControls,
);
}

DesktopVideoPackage._internal(
this.attachment,
this.player,
this.controller,
this.showControls,
);

/// The video attachment to play.
final Attachment attachment;

/// The VLC player to use.
final Player player;

/// The VLC video controller to use.
final VideoController controller;

/// Whether to show the player controls or not.
final bool showControls;
}
Expand All @@ -417,16 +432,18 @@ class _PlaylistPlayer extends StatelessWidget {
Widget build(BuildContext context) {
final _media = <Media>[];
for (final package in packages) {
_media.add(Media.network(package.attachment.assetUrl));
if (package.attachment.assetUrl != null) {
_media.add(Media(package.attachment.assetUrl!));
}
}
packages.first.player.open(
Playlist(
medias: _media,
_media,
),
autoStart: autoStart,
play: autoStart,
);
return Video(
player: packages.first.player,
controller: packages.first.controller,
fit: BoxFit.cover,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,21 +434,6 @@ class StreamMessageTextField extends StatefulWidget {
/// {@endtemplate}
final GestureTapCallback? onTap;

/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following
/// [MaterialState]s:
///
/// * [MaterialState.error].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
///
/// If this property is null, [MaterialStateMouseCursor.textable] will be
/// used.
///
/// The [mouseCursor] is the only property of [TextField] that controls the
/// appearance of the mouse pointer. All other properties related to "cursor"
/// stand for the text cursor, which is usually a blinking vertical line at
Expand Down
2 changes: 0 additions & 2 deletions packages/stream_chat_flutter/lib/src/utils/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Future<bool?> showConfirmationBottomSheet(
}) {
final chatThemeData = StreamChatTheme.of(context);
return showModalBottomSheet(
useRootNavigator: false,
backgroundColor: chatThemeData.colorTheme.barsBg,
context: context,
shape: const RoundedRectangleBorder(
Expand Down Expand Up @@ -157,7 +156,6 @@ Future<bool?> showInfoBottomSheet(
}) {
final chatThemeData = StreamChatTheme.of(context);
return showModalBottomSheet(
useRootNavigator: false,
backgroundColor:
theme?.colorTheme.barsBg ?? chatThemeData.colorTheme.barsBg,
context: context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:dart_vlc/dart_vlc.dart';
import 'package:media_kit/media_kit.dart';
import 'package:stream_chat_flutter/src/video/vlc/vlc_manager.dart';

/// The desktop implementation of [VlcManager]. It simply initializes VLC.
class VlcManagerDesktop extends VlcManager {
@override
void initialize() {
DartVLC.initialize();
MediaKit.ensureInitialized();
}
}

Expand Down
Loading

0 comments on commit fb92f29

Please sign in to comment.