Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
committed Dec 31, 2024
1 parent 7d32ab0 commit b28c208
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 29 deletions.
4 changes: 2 additions & 2 deletions general_documentation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dependencies:
sdk: 'flutter'
cupertino_icons: '^1.0.6'
path: '^1.9.0'
general_lib: '^0.0.51'
general_lib_flutter: '^0.0.32'
general_lib: '^0.0.52'
general_lib_flutter: '^0.0.33'
documentation: '^0.0.2'
dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion package/general/.flutter-plugins
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local_auth=/home/galaxeus/.pub-cache/hosted/pub.dev/local_auth-2.3.0/
local_auth_android=/home/galaxeus/.pub-cache/hosted/pub.dev/local_auth_android-1.0.46/
local_auth_darwin=/home/galaxeus/.pub-cache/hosted/pub.dev/local_auth_darwin-1.4.1/
local_auth_windows=/home/galaxeus/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/
media_kit_video=/home/galaxeus/.pub-cache/hosted/pub.dev/media_kit_video-1.2.5/
media_kit_video_fork=/home/galaxeus/.pub-cache/hosted/pub.dev/media_kit_video_fork-0.0.1/
package_info_plus=/home/galaxeus/.pub-cache/hosted/pub.dev/package_info_plus-8.0.3/
permission_handler=/home/galaxeus/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/
permission_handler_android=/home/galaxeus/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.12/
Expand Down
2 changes: 1 addition & 1 deletion package/general/.flutter-plugins-dependencies

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h"

#include <media_kit_video/media_kit_video_plugin.h>
#include <media_kit_video_fork/media_kit_video_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
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) media_kit_video_fork_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin");
media_kit_video_plugin_register_with_registrar(media_kit_video_fork_registrar);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
media_kit_video
media_kit_video_fork
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Foundation
import flutter_tts
import local_auth_darwin
import media_kit_video
import media_kit_video_fork
import package_info_plus
import screen_brightness_macos
import speech_to_text
Expand All @@ -17,6 +18,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin"))
SpeechToTextPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextPlugin"))
Expand Down
6 changes: 3 additions & 3 deletions package/general/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dependencies:
path: '../'
media_kit_video: '^1.2.5'
local_auth: '^2.2.0'
telegram_client: '^0.8.29'
general_lib: '^0.0.51'
general_lib_flutter: '^0.0.32'
telegram_client: '^0.8.30'
general_lib: '^0.0.52'
general_lib_flutter: '^0.0.33'
dev_dependencies:
flutter_test:
sdk: 'flutter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <flutter_tts/flutter_tts_plugin.h>
#include <local_auth_windows/local_auth_plugin.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
#include <media_kit_video_fork/media_kit_video_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <screen_brightness_windows/screen_brightness_windows_plugin.h>

Expand All @@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
MediaKitVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
MediaKitVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
flutter_tts
local_auth_windows
media_kit_video
media_kit_video_fork
permission_handler_windows
screen_brightness_windows
)
Expand Down
21 changes: 15 additions & 6 deletions package/general/lib/cli/cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,26 @@ Future<void> generalLibraryCli({
}

if (command == "init") {
await generalLibraryApi.create(newName: ".", directoryBase: Directory.current).listen((event) {
await generalLibraryApi
.create(newName: ".", directoryBase: Directory.current)
.listen((event) {
printed(event);
}).asFuture();
exit(0);
}

if (command == "setup") {
await generalLibraryApi.setup(directoryBase: Directory.current).listen((event) {
await generalLibraryApi
.setup(directoryBase: Directory.current)
.listen((event) {
printed(event);
}).asFuture();
exit(0);
}
if (command == "patch") {
await generalLibraryApi.patch(directoryBase: Directory.current).listen((event) {
await generalLibraryApi
.patch(directoryBase: Directory.current)
.listen((event) {
printed(event);
}).asFuture();
exit(0);
Expand All @@ -63,16 +69,19 @@ Future<void> generalLibraryCli({

Progress progress = logger.progress("message");
void printed(GeneralLibraryApiStatus event) {
if (event.serverUniverseApiStatusType == GeneralLibraryApiStatusType.progress_start) {
if (event.serverUniverseApiStatusType ==
GeneralLibraryApiStatusType.progress_start) {
progress.cancel();
progress = logger.progress(event.value);
return;
}
if (event.serverUniverseApiStatusType == GeneralLibraryApiStatusType.progress) {
if (event.serverUniverseApiStatusType ==
GeneralLibraryApiStatusType.progress) {
progress.update(event.value);
return;
}
if (event.serverUniverseApiStatusType == GeneralLibraryApiStatusType.progress_complete) {
if (event.serverUniverseApiStatusType ==
GeneralLibraryApiStatusType.progress_complete) {
progress.complete(event.value);

// progress.cancel();
Expand Down
2 changes: 1 addition & 1 deletion package/general/lib/core/player/player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba
import 'dart:typed_data';

import 'package:general/core/player/player_model_data.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_fork/media_kit_fork.dart';

extension GeneralLibraryPlayerMediaBaseExtesnion
on GeneralLibraryPlayerMediaBase {
Expand Down
2 changes: 1 addition & 1 deletion package/general/lib/core/player/player_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import 'package:general_lib/dart/executable_type/executable_type.dart';
import 'package:general_lib/general_lib.dart';

import 'player_controller.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_fork/media_kit_fork.dart';

class GeneralLibraryPlayerBase implements GeneralLibraryCore {
static List<GeneralLibraryPlayerControllerBase> players = [];
Expand Down
15 changes: 10 additions & 5 deletions package/general/lib/flutter/camera/camera_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class GeneralLibraryCameraBaseFlutter implements GeneralLibraryCameraBase {
bool is_select_camera = false;
bool is_camera_active = false;

bool get isDesktop => Platform.isWindows || Platform.isLinux || Platform.isMacOS;
bool get isDesktop =>
Platform.isWindows || Platform.isLinux || Platform.isMacOS;
bool get isMobile => Platform.isAndroid || Platform.isIOS || kIsWeb;

Future<void> initializeCameras() async {
Expand Down Expand Up @@ -99,7 +100,8 @@ class GeneralLibraryCameraBaseFlutter implements GeneralLibraryCameraBase {

if (isDesktop) {
if (Platform.isWindows) {
camera_id = await camera_windows.createCamera(camera_mobile_datas.first, camera_package.ResolutionPreset.max);
camera_id = await camera_windows.createCamera(
camera_mobile_datas.first, camera_package.ResolutionPreset.max);
is_select_camera = true;
setState(() {});
}
Expand All @@ -117,7 +119,8 @@ class GeneralLibraryCameraBaseFlutter implements GeneralLibraryCameraBase {
}
if (isMobile) {
for (var i = 0; i < camera_mobile_datas.length; i++) {
camera_package.CameraDescription camera_mobile_data = camera_mobile_datas[i];
camera_package.CameraDescription camera_mobile_data =
camera_mobile_datas[i];
if (i == (camera_id - 1)) {
camera_mobile_controller = camera_package.CameraController(
camera_mobile_data,
Expand All @@ -132,7 +135,8 @@ class GeneralLibraryCameraBaseFlutter implements GeneralLibraryCameraBase {
if (isDesktop) {
if (Platform.isWindows) {
for (var i = 0; i < camera_mobile_datas.length; i++) {
camera_package.CameraDescription camera_mobile_data = camera_mobile_datas[i];
camera_package.CameraDescription camera_mobile_data =
camera_mobile_datas[i];
if (i == (camera_id - 1)) {
camera_id = await camera_windows.createCamera(
camera_mobile_data,
Expand Down Expand Up @@ -549,5 +553,6 @@ class CameraTakePictureData {
String path;
String name;

CameraTakePictureData({required this.mimeType, required this.path, required this.name});
CameraTakePictureData(
{required this.mimeType, required this.path, required this.name});
}
7 changes: 5 additions & 2 deletions package/general/lib/flutter/camera/widget/camera_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class CameraWidget extends StatefulWidget {
class _CameraState extends State<CameraWidget> {
@override
Widget build(BuildContext context) {
if (!widget.generalLibraryCameraBase.is_camera_init || !widget.generalLibraryCameraBase.is_select_camera || !widget.generalLibraryCameraBase.is_camera_active) {
if (!widget.generalLibraryCameraBase.is_camera_init ||
!widget.generalLibraryCameraBase.is_select_camera ||
!widget.generalLibraryCameraBase.is_camera_active) {
if (!widget.generalLibraryCameraBase.is_camera_init) {
return widget.onCameraNotInit(context);
}
Expand All @@ -90,7 +92,8 @@ class _CameraState extends State<CameraWidget> {
),
);
return Visibility(
visible: widget.generalLibraryCameraBase.camera_mobile_controller.value.isInitialized,
visible: widget.generalLibraryCameraBase.camera_mobile_controller.value
.isInitialized,
replacement: const CircularProgressIndicator(),
child: camera_package.CameraPreview(
widget.generalLibraryCameraBase.camera_mobile_controller,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba

import 'package:flutter/widgets.dart';
import 'package:general/core/core.dart';
import 'package:media_kit_video/media_kit_video.dart';
import 'package:media_kit_video_fork/media_kit_video_fork.dart';

class PlayerWidget extends StatefulWidget {
final GeneralLibraryPlayerControllerBase
Expand Down
10 changes: 5 additions & 5 deletions package/general/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'general'
description: |
General is Library for help you integrate any package commong used like audio, video, permission, location
gamepad, local auth fingerprint, biometric, camera, and many more only use one library
version: '0.0.34'
version: '0.0.35'
homepage: 'https://github.com/azkadev/general'
repository: 'https://github.com/azkadev/general'
issue_tracker: 'https://t.me/DEVELOPER_GLOBAL_PUBLIC'
Expand All @@ -22,8 +22,8 @@ executables:
environment:
sdk: '>=3.6.0 <4.0.0'
dependencies:
general_lib: '^0.0.51'
media_kit: '^1.1.1'
general_lib: '^0.0.52'
media_kit_fork: '^0.0.1'
path: '^1.9.0'
io_universe: '^0.0.2'
mason_logger: '^0.3.1'
Expand All @@ -38,8 +38,8 @@ dependencies:
flutter_tts: '^4.2.0'
permission_handler: '^11.3.1'
speech_to_text: '^7.0.0'
general_lib_flutter: '^0.0.32'
media_kit_video: '^1.2.5'
general_lib_flutter: '^0.0.33'
media_kit_video_fork: '^0.0.1'
local_auth: '^2.3.0'
wakelock_plus: '^1.2.8'
camera: '^0.11.0+2'
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ funding:
environment:
sdk: '>=3.6.0 <4.0.0'
dependencies:
general_lib: '^0.0.51'
general_lib: '^0.0.52'
http: '^1.2.2'
mason_logger: '^0.3.1'
path: '^1.9.0'
Expand Down

0 comments on commit b28c208

Please sign in to comment.