From 26c372abd7a0045d1827b8ce464efb0a31113de6 Mon Sep 17 00:00:00 2001 From: jvenin Date: Sun, 10 Mar 2024 17:52:55 +0100 Subject: [PATCH] feat: skeleton and bones + refactored header 2 state --- lib/classes/gsf/header2/chunks/bind_pose.dart | 112 ++ lib/classes/gsf/header2/chunks/bone.dart | 107 ++ lib/classes/gsf/header2/chunks/bone_link.dart | 97 ++ lib/classes/gsf/header2/chunks/skeleton.dart | 178 ++++ lib/classes/gsf/header2/chunks_table.dart | 12 + lib/widgets/header2/display.dart | 83 +- lib/widgets/header2/notifier.dart | 60 +- lib/widgets/header2/state.dart | 34 +- lib/widgets/header2/state.freezed.dart | 986 +++++++++++++++--- lib/widgets/header2/widgets/chunks/mesh.dart | 10 +- pubspec.lock | 74 +- 11 files changed, 1540 insertions(+), 213 deletions(-) create mode 100644 lib/classes/gsf/header2/chunks/bind_pose.dart create mode 100644 lib/classes/gsf/header2/chunks/bone.dart create mode 100644 lib/classes/gsf/header2/chunks/bone_link.dart create mode 100644 lib/classes/gsf/header2/chunks/skeleton.dart diff --git a/lib/classes/gsf/header2/chunks/bind_pose.dart b/lib/classes/gsf/header2/chunks/bind_pose.dart new file mode 100644 index 0000000..799a383 --- /dev/null +++ b/lib/classes/gsf/header2/chunks/bind_pose.dart @@ -0,0 +1,112 @@ +import 'dart:typed_data'; + +import 'package:paraworld_gsf_viewer/classes/gsf_data.dart'; + +class BindPose extends GsfPart { + late final Standard4BytesData float1To1; + late final Standard4BytesData float1To2; + late final Standard4BytesData float1To3; + late final Standard4BytesData float1To4; + late final Standard4BytesData float2To1; + late final Standard4BytesData float2To2; + late final Standard4BytesData float2To3; + late final Standard4BytesData float2To4; + late final Standard4BytesData float3To1; + late final Standard4BytesData float3To2; + late final Standard4BytesData float3To3; + late final Standard4BytesData float3To4; + late final Standard4BytesData float4To1; + late final Standard4BytesData float4To2; + late final Standard4BytesData float4To3; + late final Standard4BytesData float4To4; + + + @override + String get label => 'Bind Pose'; + + BindPose.fromBytes(Uint8List bytes, int offset) : super(offset: offset) { + float1To1 = Standard4BytesData( + position: 0, + bytes: bytes, + offset: offset, + ); + float1To2 = Standard4BytesData( + position: float1To1.relativeEnd, + bytes: bytes, + offset: offset, + ); + float1To3 = Standard4BytesData( + position: float1To2.relativeEnd, + bytes: bytes, + offset: offset, + ); + float1To4 = Standard4BytesData( + position: float1To3.relativeEnd, + bytes: bytes, + offset: offset, + ); + float2To1 = Standard4BytesData( + position: float1To4.relativeEnd, + bytes: bytes, + offset: offset, + ); + float2To2 = Standard4BytesData( + position: float2To1.relativeEnd, + bytes: bytes, + offset: offset, + ); + float2To3 = Standard4BytesData( + position: float2To2.relativeEnd, + bytes: bytes, + offset: offset, + ); + float2To4 = Standard4BytesData( + position: float2To3.relativeEnd, + bytes: bytes, + offset: offset, + ); + float3To1 = Standard4BytesData( + position: float2To4.relativeEnd, + bytes: bytes, + offset: offset, + ); + float3To2 = Standard4BytesData( + position: float3To1.relativeEnd, + bytes: bytes, + offset: offset, + ); + float3To3 = Standard4BytesData( + position: float3To2.relativeEnd, + bytes: bytes, + offset: offset, + ); + float3To4 = Standard4BytesData( + position: float3To3.relativeEnd, + bytes: bytes, + offset: offset, + ); + float4To1 = Standard4BytesData( + position: float3To4.relativeEnd, + bytes: bytes, + offset: offset, + ); + float4To2 = Standard4BytesData( + position: float4To1.relativeEnd, + bytes: bytes, + offset: offset, + ); + float4To3 = Standard4BytesData( + position: float4To2.relativeEnd, + bytes: bytes, + offset: offset, + ); + float4To4 = Standard4BytesData( + position: float4To3.relativeEnd, + bytes: bytes, + offset: offset, + ); + } + + @override + int getEndOffset() => float4To4.offsettedLength; +} \ No newline at end of file diff --git a/lib/classes/gsf/header2/chunks/bone.dart b/lib/classes/gsf/header2/chunks/bone.dart new file mode 100644 index 0000000..42f58a5 --- /dev/null +++ b/lib/classes/gsf/header2/chunks/bone.dart @@ -0,0 +1,107 @@ +import 'dart:typed_data'; + +import 'package:paraworld_gsf_viewer/classes/gsf_data.dart'; + +class Bone extends GsfPart { + late final Standard4BytesData guid; + late final Standard4BytesData flags; + late final Standard4BytesData animPositionX; + late final Standard4BytesData animPositionY; + late final Standard4BytesData animPositionZ; + late final Standard4BytesData scaleX; + late final Standard4BytesData scaleY; + late final Standard4BytesData scaleZ; + late final Standard4BytesData quaternionL; + late final Standard4BytesData quaternionI; + late final Standard4BytesData quaternionJ; + late final Standard4BytesData quaternionK; + late final Standard4BytesData bonesCount; + late final Standard4BytesData nextBoneOffset; + late final Standard4BytesData bonesCount2; + + @override + String get label => 'Bone $guid'; + + Bone.fromBytes(Uint8List bytes, int offset) : super(offset: offset) { + guid = Standard4BytesData( + position: 0, + bytes: bytes, + offset: offset, + ); + flags = Standard4BytesData( + position: guid.relativeEnd, + bytes: bytes, + offset: offset, + ); + animPositionX = Standard4BytesData( + position: flags.relativeEnd, + bytes: bytes, + offset: offset, + ); + animPositionY = Standard4BytesData( + position: animPositionX.relativeEnd, + bytes: bytes, + offset: offset, + ); + animPositionZ = Standard4BytesData( + position: animPositionY.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleX = Standard4BytesData( + position: animPositionZ.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleY = Standard4BytesData( + position: scaleX.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleZ = Standard4BytesData( + position: scaleY.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionL = Standard4BytesData( + position: scaleZ.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionI = Standard4BytesData( + position: quaternionL.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionJ = Standard4BytesData( + position: quaternionI.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionK = Standard4BytesData( + position: quaternionJ.relativeEnd, + bytes: bytes, + offset: offset, + ); + bonesCount = Standard4BytesData( + position: quaternionK.relativeEnd, + bytes: bytes, + offset: offset, + ); + nextBoneOffset = Standard4BytesData( + position: bonesCount.relativeEnd, + bytes: bytes, + offset: offset, + ); + bonesCount2 = Standard4BytesData( + position: nextBoneOffset.relativeEnd, + bytes: bytes, + offset: offset, + ); + } + + @override + int getEndOffset() { + return bonesCount2.offsettedLength; + } +} \ No newline at end of file diff --git a/lib/classes/gsf/header2/chunks/bone_link.dart b/lib/classes/gsf/header2/chunks/bone_link.dart new file mode 100644 index 0000000..b352a8e --- /dev/null +++ b/lib/classes/gsf/header2/chunks/bone_link.dart @@ -0,0 +1,97 @@ +import 'dart:typed_data'; + +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf_data.dart'; + +class BoneLinkChunk extends Chunk { + late final Standard4BytesData attributes; + late final Standard4BytesData guid; + late final Standard4BytesData positionX; + late final Standard4BytesData positionY; + late final Standard4BytesData positionZ; + late final Standard4BytesData quaternionL; + late final Standard4BytesData quaternionI; + late final Standard4BytesData quaternionJ; + late final Standard4BytesData quaternionK; + late final Standard4BytesData fourccLink; + late final Standard4BytesData skeletonIndex; + late final Standard4BytesData boneIds; + late final Standard4BytesData boneWeights; + + @override + String get label => 'BoneLink 0x${guid.value.toRadixString(16)}'; + + BoneLinkChunk.fromBytes(Uint8List bytes, int offset) + : super(offset: offset, type: ChunkType.boneLink) { + attributes = Standard4BytesData( + position: 0, + bytes: bytes, + offset: offset, + ); + guid = Standard4BytesData( + position: attributes.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionX = Standard4BytesData( + position: guid.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionY = Standard4BytesData( + position: positionX.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionZ = Standard4BytesData( + position: positionY.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionL = Standard4BytesData( + position: positionZ.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionI = Standard4BytesData( + position: quaternionL.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionJ = Standard4BytesData( + position: quaternionI.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionK = Standard4BytesData( + position: quaternionJ.relativeEnd, + bytes: bytes, + offset: offset, + ); + fourccLink = Standard4BytesData( + position: quaternionK.relativeEnd, + bytes: bytes, + offset: offset, + ); + skeletonIndex = Standard4BytesData( + position: fourccLink.relativeEnd, + bytes: bytes, + offset: offset, + ); + boneIds = Standard4BytesData( + position: skeletonIndex.relativeEnd, + bytes: bytes, + offset: offset, + ); + boneWeights = Standard4BytesData( + position: boneIds.relativeEnd, + bytes: bytes, + offset: offset, + ); + } + + @override + int getEndOffset() { + return boneWeights.offsettedLength; + } +} diff --git a/lib/classes/gsf/header2/chunks/skeleton.dart b/lib/classes/gsf/header2/chunks/skeleton.dart new file mode 100644 index 0000000..3a7d780 --- /dev/null +++ b/lib/classes/gsf/header2/chunks/skeleton.dart @@ -0,0 +1,178 @@ +import 'dart:typed_data'; + +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bind_pose.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf_data.dart'; + +class SkeletonChunk extends Chunk { + late final Standard4BytesData attributes; + late final Standard4BytesData guid; + late final Standard4BytesData index; + late final Standard4BytesData id; + late final Standard4BytesData flags; + late final Standard4BytesData positionX; + late final Standard4BytesData positionY; + late final Standard4BytesData positionZ; + late final Standard4BytesData scaleX; + late final Standard4BytesData scaleY; + late final Standard4BytesData scaleZ; + late final Standard4BytesData quaternionL; + late final Standard4BytesData quaternionI; + late final Standard4BytesData quaternionJ; + late final Standard4BytesData quaternionK; + late final Standard4BytesData bonesCount; + late final Standard4BytesData bonesOffset; + late final Standard4BytesData bonesCount2; + late final Standard4BytesData bindPoseOffset; + late final Standard4BytesData allBonesCount; + late final Standard4BytesData allBones2; + late final Standard4BytesData unknownData; + + late final List bones; + late final BindPose bindPose; + + @override + String get label => 'Skeleton 0x${guid.value.toRadixString(16)}'; + + SkeletonChunk.fromBytes(Uint8List bytes, int offset) + : super(offset: offset, type: ChunkType.skeleton) { + attributes = Standard4BytesData( + position: 0, + bytes: bytes, + offset: offset, + ); + guid = Standard4BytesData( + position: attributes.relativeEnd, + bytes: bytes, + offset: offset, + ); + index = Standard4BytesData( + position: guid.relativeEnd, + bytes: bytes, + offset: offset, + ); + id = Standard4BytesData( + position: index.relativeEnd, + bytes: bytes, + offset: offset, + ); + flags = Standard4BytesData( + position: id.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionX = Standard4BytesData( + position: flags.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionY = Standard4BytesData( + position: positionX.relativeEnd, + bytes: bytes, + offset: offset, + ); + positionZ = Standard4BytesData( + position: positionY.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleX = Standard4BytesData( + position: positionZ.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleY = Standard4BytesData( + position: scaleX.relativeEnd, + bytes: bytes, + offset: offset, + ); + scaleZ = Standard4BytesData( + position: scaleY.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionL = Standard4BytesData( + position: scaleZ.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionI = Standard4BytesData( + position: quaternionL.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionJ = Standard4BytesData( + position: quaternionI.relativeEnd, + bytes: bytes, + offset: offset, + ); + quaternionK = Standard4BytesData( + position: quaternionJ.relativeEnd, + bytes: bytes, + offset: offset, + ); + bonesCount = Standard4BytesData( + position: quaternionK.relativeEnd, + bytes: bytes, + offset: offset, + ); + bonesOffset = Standard4BytesData( + position: bonesCount.relativeEnd, + bytes: bytes, + offset: offset, + ); + bonesCount2 = Standard4BytesData( + position: bonesOffset.relativeEnd, + bytes: bytes, + offset: offset, + ); + + bindPoseOffset = Standard4BytesData( + position: bonesCount2.relativeEnd, + bytes: bytes, + offset: offset, + ); + + allBonesCount = Standard4BytesData( + position: bindPoseOffset.relativeEnd, + bytes: bytes, + offset: offset, + ); + + allBones2 = Standard4BytesData( + position: allBonesCount.relativeEnd, + bytes: bytes, + offset: offset, + ); + + unknownData = Standard4BytesData( + position: allBones2.relativeEnd, + bytes: bytes, + offset: offset, + ); + bones = []; + for (var i = 0; i < bonesCount.value; i++) { + bones.add( + Bone.fromBytes( + bytes, + bones.isNotEmpty + ? bones.last.getEndOffset() + : bonesOffset.offsettedPos + bonesOffset.value, + ), + ); + } + + bindPose = BindPose.fromBytes( + bytes, + bindPoseOffset.offsettedPos + bindPoseOffset.value, + ); + } + + @override + int getEndOffset() { + return bones.isNotEmpty + ? bones.last.getEndOffset() + : unknownData.offsettedLength; + } +} diff --git a/lib/classes/gsf/header2/chunks_table.dart b/lib/classes/gsf/header2/chunks_table.dart index 9da5785..9585aa1 100644 --- a/lib/classes/gsf/header2/chunks_table.dart +++ b/lib/classes/gsf/header2/chunks_table.dart @@ -1,8 +1,10 @@ import 'dart:typed_data'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone_link.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/cloth.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/mesh.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/skeleton.dart'; import 'package:paraworld_gsf_viewer/classes/gsf_data.dart'; class ChunksTable extends GsfPart { @@ -56,6 +58,16 @@ class ChunksTable extends GsfPart { typeData.offsettedLength, type, ); + case ChunkType.skeleton: + return SkeletonChunk.fromBytes( + bytes, + typeData.offsettedLength, + ); + case ChunkType.boneLink: + return BoneLinkChunk.fromBytes( + bytes, + typeData.offsettedLength, + ); default: return Chunk(offset: typeData.offsettedLength, type: type); } diff --git a/lib/widgets/header2/display.dart b/lib/widgets/header2/display.dart index 0fbb136..3d82a0a 100644 --- a/lib/widgets/header2/display.dart +++ b/lib/widgets/header2/display.dart @@ -1,8 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; -import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/cloth.dart'; -import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/mesh.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/fallback_table.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/material.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/materials_table.dart'; @@ -98,9 +95,12 @@ class _MaterialsTable extends ConsumerWidget { @override Widget build(BuildContext context, ref) { - final selected = ref.watch(header2StateNotifierProvider).maybeMap( + final selectedMaterial = ref.watch(header2StateNotifierProvider).maybeMap( withMaterial: (data) => data.material, - withModelSettings: (data) => data.material, + withModelSettings: (data) => data.selectedChunkState?.mapOrNull( + withMesh: (mesh) => mesh.material, + withCloth: (cloth) => cloth.material, + ), orElse: () => null, ); return Column( @@ -116,7 +116,7 @@ class _MaterialsTable extends ConsumerWidget { GsfDataTile( label: 'Materials length', data: materialsTable.maxEntriesCount), PartSelector( - value: selected, + value: selectedMaterial, label: "materials", parts: materialsTable.materials .sublist(0, materialsTable.materialCount.value), @@ -137,18 +137,12 @@ List withModelSettings(Header2StateWithModelSettings state) { materialsTable: state.header2.materialsTable), if (state.objectName != null) ObjectNameDisplay(objectName: state.objectName!), - if (state.chunk != null) ...[ - getChunkWidgetByType(state.chunk!, state.modelSettings.fallbackTable, - state.header2.materialsTable.materials), - if (state.chunk is MeshToModelInterface && state.submesh == null) ...[ - Flexible( - child: Viewer( - model: (state.chunk as MeshToModelInterface).toModel(), - )), - ], - if (state.submesh != null) SubmeshDisplay(submesh: state.submesh!), - if (state.material != null) MaterialDisplay(material: state.material!), - ] + if (state.selectedChunkState != null) + ...getChunkWidgetByType( + state.selectedChunkState!, + state.modelSettings.fallbackTable, + state.header2.materialsTable.materials, + ), ]; } @@ -158,29 +152,42 @@ List withMaterial(Header2StateWithMaterial state) { ]; } -Widget getChunkWidgetByType( - Chunk chunk, FallbackTable? fallbackTable, List materials) { - final Widget widget = () { - switch (chunk.type) { - case ChunkType.meshSkinnedSimple: - case ChunkType.meshSkinned: - case ChunkType.mesh: - return MeshChunkDisplay( - mesh: chunk as MeshChunk, +List getChunkWidgetByType(SelectedChunkState chunkState, + FallbackTable? fallbackTable, List materials) { + final List widgets = () { + return chunkState.maybeMap( + withMesh: (data) => [ + MeshChunkDisplay( + mesh: data.mesh, fallbackTable: fallbackTable, materials: materials, - ); - case ChunkType.clothSkinnedSimple: - case ChunkType.clothSkinned: - case ChunkType.cloth: - return ClothChunkDisplay( - cloth: chunk as ClothChunk, + ), + data.submesh != null + ? SubmeshDisplay(submesh: data.submesh!) + : Flexible( + child: Viewer( + model: data.mesh.toModel(), + ), + ), + if (data.material != null) MaterialDisplay(material: data.material!), + ], + withCloth: (data) => [ + ClothChunkDisplay( + cloth: data.cloth, fallbackTable: fallbackTable, materials: materials, - ); - default: - return const SizedBox.shrink(); - } + ), + data.submesh != null + ? SubmeshDisplay(submesh: data.submesh!) + : Flexible( + child: Viewer( + model: data.cloth.toModel(), + ), + ), + if (data.material != null) MaterialDisplay(material: data.material!), + ], + orElse: () => [const SizedBox.shrink()], + ); }(); - return widget; + return widgets; } diff --git a/lib/widgets/header2/notifier.dart b/lib/widgets/header2/notifier.dart index b9a457a..81d54a0 100644 --- a/lib/widgets/header2/notifier.dart +++ b/lib/widgets/header2/notifier.dart @@ -1,6 +1,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/gsf.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone_link.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/cloth.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/mesh.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/skeleton.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/submesh.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/material.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/model_settings.dart'; @@ -32,33 +37,74 @@ class Header2StateNotifier extends Notifier { state = state.maybeMap( withModelSettings: (s) => s.copyWith( objectName: objectName, - chunk: null, - submesh: null, + selectedChunkState: null, ), orElse: () => state, ); } void setChunk(Chunk chunk) { + state = state.maybeMap( + withModelSettings: (s) { + switch(chunk.runtimeType) { + case BoneLinkChunk: + return s.copyWith( + selectedChunkState: SelectedChunkState.withBoneLink(boneLink: chunk as BoneLinkChunk), + ); + case SkeletonChunk: + return s.copyWith( + selectedChunkState: SelectedChunkState.withSkeleton(skeleton: chunk as SkeletonChunk), + ); + case MeshChunk: + return s.copyWith( + selectedChunkState: SelectedChunkState.withMesh(mesh: chunk as MeshChunk), + ); + case ClothChunk: + return s.copyWith( + selectedChunkState: SelectedChunkState.withCloth(cloth: chunk as ClothChunk), + ); + default: + return s; + } + }, + orElse: () => state, + ); + } + + void setSubmesh(Submesh submesh) { state = state.maybeMap( withModelSettings: (s) => s.copyWith( - chunk: chunk, - submesh: null, + selectedChunkState: s.selectedChunkState?.maybeMap( + withMesh: (data) => data.copyWith(submesh: submesh), + withCloth: (data) => data.copyWith(submesh: submesh), + orElse: () => s.selectedChunkState, + ), ), orElse: () => state, ); } - void setSubmesh(Submesh mesh) { + void setBone(Bone bone) { state = state.maybeMap( - withModelSettings: (s) => s.copyWith(submesh: mesh, material: null), + withModelSettings: (s) => s.copyWith( + selectedChunkState: s.selectedChunkState?.maybeMap( + withSkeleton: (data) => data.copyWith(bone: bone), + orElse: () => s.selectedChunkState, + ), + ), orElse: () => state, ); } void setMaterial(MaterialData material) { state = state.maybeMap( - withModelSettings: (s) => s.copyWith(material: material, submesh: null), + withModelSettings: (s) => s.copyWith( + selectedChunkState: s.selectedChunkState?.maybeMap( + withMesh: (data) => data.copyWith(material: material), + withCloth: (data) => data.copyWith(material: material), + orElse: () => s.selectedChunkState, + ), + ), orElse: () => Header2State.withMaterial( header2: gsfFile!.header2, material: material, diff --git a/lib/widgets/header2/state.dart b/lib/widgets/header2/state.dart index f2807dc..365f7a5 100644 --- a/lib/widgets/header2/state.dart +++ b/lib/widgets/header2/state.dart @@ -1,5 +1,9 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/chunk.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/bone_link.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/cloth.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/mesh.dart'; +import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/skeleton.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/chunks/submesh.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/header2.dart'; import 'package:paraworld_gsf_viewer/classes/gsf/header2/material.dart'; @@ -18,12 +22,34 @@ class Header2State with _$Header2State { {required Header2 header2, required ModelSettings modelSettings, ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material}) = Header2StateWithModelSettings; + SelectedChunkState? selectedChunkState}) = Header2StateWithModelSettings; const factory Header2State.withMaterial({ required Header2 header2, required MaterialData material, }) = Header2StateWithMaterial; } + +@freezed +class SelectedChunkState with _$SelectedChunkState { + const factory SelectedChunkState.withSkeleton({ + required SkeletonChunk skeleton, + Bone? bone, + }) = SelectedChunkStateWithSkeleton; + + const factory SelectedChunkState.withBoneLink({ + required BoneLinkChunk boneLink, + }) = SelectedChunkStateWithBoneLink; + + const factory SelectedChunkState.withMesh({ + required MeshChunk mesh, + MaterialData? material, + Submesh? submesh, + }) = SelectedChunkStateWithMesh; + + const factory SelectedChunkState.withCloth({ + required ClothChunk cloth, + MaterialData? material, + Submesh? submesh, + }) = SelectedChunkStateWithCloth; +} diff --git a/lib/widgets/header2/state.freezed.dart b/lib/widgets/header2/state.freezed.dart index 193aeae..385ce6a 100644 --- a/lib/widgets/header2/state.freezed.dart +++ b/lib/widgets/header2/state.freezed.dart @@ -20,13 +20,8 @@ mixin _$Header2State { @optionalTypeArgs TResult when({ required TResult Function(Header2? header2) empty, - required TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material) + required TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState) withModelSettings, required TResult Function(Header2 header2, MaterialData material) withMaterial, @@ -35,13 +30,8 @@ mixin _$Header2State { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(Header2? header2)? empty, - TResult? Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult? Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult? Function(Header2 header2, MaterialData material)? withMaterial, }) => @@ -49,13 +39,8 @@ mixin _$Header2State { @optionalTypeArgs TResult maybeWhen({ TResult Function(Header2? header2)? empty, - TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult Function(Header2 header2, MaterialData material)? withMaterial, required TResult orElse(), @@ -190,13 +175,8 @@ class _$EmptyImpl implements _Empty { @optionalTypeArgs TResult when({ required TResult Function(Header2? header2) empty, - required TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material) + required TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState) withModelSettings, required TResult Function(Header2 header2, MaterialData material) withMaterial, @@ -208,13 +188,8 @@ class _$EmptyImpl implements _Empty { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(Header2? header2)? empty, - TResult? Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult? Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult? Function(Header2 header2, MaterialData material)? withMaterial, }) { @@ -225,13 +200,8 @@ class _$EmptyImpl implements _Empty { @optionalTypeArgs TResult maybeWhen({ TResult Function(Header2? header2)? empty, - TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult Function(Header2 header2, MaterialData material)? withMaterial, required TResult orElse(), @@ -302,9 +272,9 @@ abstract class _$$Header2StateWithModelSettingsImplCopyWith<$Res> {Header2 header2, ModelSettings modelSettings, ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material}); + SelectedChunkState? selectedChunkState}); + + $SelectedChunkStateCopyWith<$Res>? get selectedChunkState; } /// @nodoc @@ -323,9 +293,7 @@ class __$$Header2StateWithModelSettingsImplCopyWithImpl<$Res> Object? header2 = null, Object? modelSettings = null, Object? objectName = freezed, - Object? chunk = freezed, - Object? submesh = freezed, - Object? material = freezed, + Object? selectedChunkState = freezed, }) { return _then(_$Header2StateWithModelSettingsImpl( header2: null == header2 @@ -340,20 +308,25 @@ class __$$Header2StateWithModelSettingsImplCopyWithImpl<$Res> ? _value.objectName : objectName // ignore: cast_nullable_to_non_nullable as ObjectName?, - chunk: freezed == chunk - ? _value.chunk - : chunk // ignore: cast_nullable_to_non_nullable - as Chunk?, - submesh: freezed == submesh - ? _value.submesh - : submesh // ignore: cast_nullable_to_non_nullable - as Submesh?, - material: freezed == material - ? _value.material - : material // ignore: cast_nullable_to_non_nullable - as MaterialData?, + selectedChunkState: freezed == selectedChunkState + ? _value.selectedChunkState + : selectedChunkState // ignore: cast_nullable_to_non_nullable + as SelectedChunkState?, )); } + + @override + @pragma('vm:prefer-inline') + $SelectedChunkStateCopyWith<$Res>? get selectedChunkState { + if (_value.selectedChunkState == null) { + return null; + } + + return $SelectedChunkStateCopyWith<$Res>(_value.selectedChunkState!, + (value) { + return _then(_value.copyWith(selectedChunkState: value)); + }); + } } /// @nodoc @@ -364,9 +337,7 @@ class _$Header2StateWithModelSettingsImpl {required this.header2, required this.modelSettings, this.objectName, - this.chunk, - this.submesh, - this.material}); + this.selectedChunkState}); @override final Header2 header2; @@ -375,15 +346,11 @@ class _$Header2StateWithModelSettingsImpl @override final ObjectName? objectName; @override - final Chunk? chunk; - @override - final Submesh? submesh; - @override - final MaterialData? material; + final SelectedChunkState? selectedChunkState; @override String toString() { - return 'Header2State.withModelSettings(header2: $header2, modelSettings: $modelSettings, objectName: $objectName, chunk: $chunk, submesh: $submesh, material: $material)'; + return 'Header2State.withModelSettings(header2: $header2, modelSettings: $modelSettings, objectName: $objectName, selectedChunkState: $selectedChunkState)'; } @override @@ -396,15 +363,13 @@ class _$Header2StateWithModelSettingsImpl other.modelSettings == modelSettings) && (identical(other.objectName, objectName) || other.objectName == objectName) && - (identical(other.chunk, chunk) || other.chunk == chunk) && - (identical(other.submesh, submesh) || other.submesh == submesh) && - (identical(other.material, material) || - other.material == material)); + (identical(other.selectedChunkState, selectedChunkState) || + other.selectedChunkState == selectedChunkState)); } @override - int get hashCode => Object.hash(runtimeType, header2, modelSettings, - objectName, chunk, submesh, material); + int get hashCode => Object.hash( + runtimeType, header2, modelSettings, objectName, selectedChunkState); @JsonKey(ignore: true) @override @@ -418,57 +383,42 @@ class _$Header2StateWithModelSettingsImpl @optionalTypeArgs TResult when({ required TResult Function(Header2? header2) empty, - required TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material) + required TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState) withModelSettings, required TResult Function(Header2 header2, MaterialData material) withMaterial, }) { return withModelSettings( - header2, modelSettings, objectName, chunk, submesh, material); + header2, modelSettings, objectName, selectedChunkState); } @override @optionalTypeArgs TResult? whenOrNull({ TResult? Function(Header2? header2)? empty, - TResult? Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult? Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult? Function(Header2 header2, MaterialData material)? withMaterial, }) { return withModelSettings?.call( - header2, modelSettings, objectName, chunk, submesh, material); + header2, modelSettings, objectName, selectedChunkState); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function(Header2? header2)? empty, - TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult Function(Header2 header2, MaterialData material)? withMaterial, required TResult orElse(), }) { if (withModelSettings != null) { return withModelSettings( - header2, modelSettings, objectName, chunk, submesh, material); + header2, modelSettings, objectName, selectedChunkState); } return orElse(); } @@ -511,20 +461,17 @@ class _$Header2StateWithModelSettingsImpl abstract class Header2StateWithModelSettings implements Header2State { const factory Header2StateWithModelSettings( - {required final Header2 header2, - required final ModelSettings modelSettings, - final ObjectName? objectName, - final Chunk? chunk, - final Submesh? submesh, - final MaterialData? material}) = _$Header2StateWithModelSettingsImpl; + {required final Header2 header2, + required final ModelSettings modelSettings, + final ObjectName? objectName, + final SelectedChunkState? selectedChunkState}) = + _$Header2StateWithModelSettingsImpl; @override Header2 get header2; ModelSettings get modelSettings; ObjectName? get objectName; - Chunk? get chunk; - Submesh? get submesh; - MaterialData? get material; + SelectedChunkState? get selectedChunkState; @override @JsonKey(ignore: true) _$$Header2StateWithModelSettingsImplCopyWith< @@ -612,13 +559,8 @@ class _$Header2StateWithMaterialImpl implements Header2StateWithMaterial { @optionalTypeArgs TResult when({ required TResult Function(Header2? header2) empty, - required TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material) + required TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState) withModelSettings, required TResult Function(Header2 header2, MaterialData material) withMaterial, @@ -630,13 +572,8 @@ class _$Header2StateWithMaterialImpl implements Header2StateWithMaterial { @optionalTypeArgs TResult? whenOrNull({ TResult? Function(Header2? header2)? empty, - TResult? Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult? Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult? Function(Header2 header2, MaterialData material)? withMaterial, }) { @@ -647,13 +584,8 @@ class _$Header2StateWithMaterialImpl implements Header2StateWithMaterial { @optionalTypeArgs TResult maybeWhen({ TResult Function(Header2? header2)? empty, - TResult Function( - Header2 header2, - ModelSettings modelSettings, - ObjectName? objectName, - Chunk? chunk, - Submesh? submesh, - MaterialData? material)? + TResult Function(Header2 header2, ModelSettings modelSettings, + ObjectName? objectName, SelectedChunkState? selectedChunkState)? withModelSettings, TResult Function(Header2 header2, MaterialData material)? withMaterial, required TResult orElse(), @@ -713,3 +645,799 @@ abstract class Header2StateWithMaterial implements Header2State { _$$Header2StateWithMaterialImplCopyWith<_$Header2StateWithMaterialImpl> get copyWith => throw _privateConstructorUsedError; } + +/// @nodoc +mixin _$SelectedChunkState { + @optionalTypeArgs + TResult when({ + required TResult Function(SkeletonChunk skeleton, Bone? bone) withSkeleton, + required TResult Function(BoneLinkChunk boneLink) withBoneLink, + required TResult Function( + MeshChunk mesh, MaterialData? material, Submesh? submesh) + withMesh, + required TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh) + withCloth, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult? Function(BoneLinkChunk boneLink)? withBoneLink, + TResult? Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult? Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult Function(BoneLinkChunk boneLink)? withBoneLink, + TResult Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(SelectedChunkStateWithSkeleton value) + withSkeleton, + required TResult Function(SelectedChunkStateWithBoneLink value) + withBoneLink, + required TResult Function(SelectedChunkStateWithMesh value) withMesh, + required TResult Function(SelectedChunkStateWithCloth value) withCloth, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult? Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult? Function(SelectedChunkStateWithMesh value)? withMesh, + TResult? Function(SelectedChunkStateWithCloth value)? withCloth, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult Function(SelectedChunkStateWithMesh value)? withMesh, + TResult Function(SelectedChunkStateWithCloth value)? withCloth, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SelectedChunkStateCopyWith<$Res> { + factory $SelectedChunkStateCopyWith( + SelectedChunkState value, $Res Function(SelectedChunkState) then) = + _$SelectedChunkStateCopyWithImpl<$Res, SelectedChunkState>; +} + +/// @nodoc +class _$SelectedChunkStateCopyWithImpl<$Res, $Val extends SelectedChunkState> + implements $SelectedChunkStateCopyWith<$Res> { + _$SelectedChunkStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$SelectedChunkStateWithSkeletonImplCopyWith<$Res> { + factory _$$SelectedChunkStateWithSkeletonImplCopyWith( + _$SelectedChunkStateWithSkeletonImpl value, + $Res Function(_$SelectedChunkStateWithSkeletonImpl) then) = + __$$SelectedChunkStateWithSkeletonImplCopyWithImpl<$Res>; + @useResult + $Res call({SkeletonChunk skeleton, Bone? bone}); +} + +/// @nodoc +class __$$SelectedChunkStateWithSkeletonImplCopyWithImpl<$Res> + extends _$SelectedChunkStateCopyWithImpl<$Res, + _$SelectedChunkStateWithSkeletonImpl> + implements _$$SelectedChunkStateWithSkeletonImplCopyWith<$Res> { + __$$SelectedChunkStateWithSkeletonImplCopyWithImpl( + _$SelectedChunkStateWithSkeletonImpl _value, + $Res Function(_$SelectedChunkStateWithSkeletonImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? skeleton = null, + Object? bone = freezed, + }) { + return _then(_$SelectedChunkStateWithSkeletonImpl( + skeleton: null == skeleton + ? _value.skeleton + : skeleton // ignore: cast_nullable_to_non_nullable + as SkeletonChunk, + bone: freezed == bone + ? _value.bone + : bone // ignore: cast_nullable_to_non_nullable + as Bone?, + )); + } +} + +/// @nodoc + +class _$SelectedChunkStateWithSkeletonImpl + implements SelectedChunkStateWithSkeleton { + const _$SelectedChunkStateWithSkeletonImpl( + {required this.skeleton, this.bone}); + + @override + final SkeletonChunk skeleton; + @override + final Bone? bone; + + @override + String toString() { + return 'SelectedChunkState.withSkeleton(skeleton: $skeleton, bone: $bone)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SelectedChunkStateWithSkeletonImpl && + (identical(other.skeleton, skeleton) || + other.skeleton == skeleton) && + (identical(other.bone, bone) || other.bone == bone)); + } + + @override + int get hashCode => Object.hash(runtimeType, skeleton, bone); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SelectedChunkStateWithSkeletonImplCopyWith< + _$SelectedChunkStateWithSkeletonImpl> + get copyWith => __$$SelectedChunkStateWithSkeletonImplCopyWithImpl< + _$SelectedChunkStateWithSkeletonImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(SkeletonChunk skeleton, Bone? bone) withSkeleton, + required TResult Function(BoneLinkChunk boneLink) withBoneLink, + required TResult Function( + MeshChunk mesh, MaterialData? material, Submesh? submesh) + withMesh, + required TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh) + withCloth, + }) { + return withSkeleton(skeleton, bone); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult? Function(BoneLinkChunk boneLink)? withBoneLink, + TResult? Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult? Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + }) { + return withSkeleton?.call(skeleton, bone); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult Function(BoneLinkChunk boneLink)? withBoneLink, + TResult Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + required TResult orElse(), + }) { + if (withSkeleton != null) { + return withSkeleton(skeleton, bone); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SelectedChunkStateWithSkeleton value) + withSkeleton, + required TResult Function(SelectedChunkStateWithBoneLink value) + withBoneLink, + required TResult Function(SelectedChunkStateWithMesh value) withMesh, + required TResult Function(SelectedChunkStateWithCloth value) withCloth, + }) { + return withSkeleton(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult? Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult? Function(SelectedChunkStateWithMesh value)? withMesh, + TResult? Function(SelectedChunkStateWithCloth value)? withCloth, + }) { + return withSkeleton?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult Function(SelectedChunkStateWithMesh value)? withMesh, + TResult Function(SelectedChunkStateWithCloth value)? withCloth, + required TResult orElse(), + }) { + if (withSkeleton != null) { + return withSkeleton(this); + } + return orElse(); + } +} + +abstract class SelectedChunkStateWithSkeleton implements SelectedChunkState { + const factory SelectedChunkStateWithSkeleton( + {required final SkeletonChunk skeleton, + final Bone? bone}) = _$SelectedChunkStateWithSkeletonImpl; + + SkeletonChunk get skeleton; + Bone? get bone; + @JsonKey(ignore: true) + _$$SelectedChunkStateWithSkeletonImplCopyWith< + _$SelectedChunkStateWithSkeletonImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SelectedChunkStateWithBoneLinkImplCopyWith<$Res> { + factory _$$SelectedChunkStateWithBoneLinkImplCopyWith( + _$SelectedChunkStateWithBoneLinkImpl value, + $Res Function(_$SelectedChunkStateWithBoneLinkImpl) then) = + __$$SelectedChunkStateWithBoneLinkImplCopyWithImpl<$Res>; + @useResult + $Res call({BoneLinkChunk boneLink}); +} + +/// @nodoc +class __$$SelectedChunkStateWithBoneLinkImplCopyWithImpl<$Res> + extends _$SelectedChunkStateCopyWithImpl<$Res, + _$SelectedChunkStateWithBoneLinkImpl> + implements _$$SelectedChunkStateWithBoneLinkImplCopyWith<$Res> { + __$$SelectedChunkStateWithBoneLinkImplCopyWithImpl( + _$SelectedChunkStateWithBoneLinkImpl _value, + $Res Function(_$SelectedChunkStateWithBoneLinkImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? boneLink = null, + }) { + return _then(_$SelectedChunkStateWithBoneLinkImpl( + boneLink: null == boneLink + ? _value.boneLink + : boneLink // ignore: cast_nullable_to_non_nullable + as BoneLinkChunk, + )); + } +} + +/// @nodoc + +class _$SelectedChunkStateWithBoneLinkImpl + implements SelectedChunkStateWithBoneLink { + const _$SelectedChunkStateWithBoneLinkImpl({required this.boneLink}); + + @override + final BoneLinkChunk boneLink; + + @override + String toString() { + return 'SelectedChunkState.withBoneLink(boneLink: $boneLink)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SelectedChunkStateWithBoneLinkImpl && + (identical(other.boneLink, boneLink) || + other.boneLink == boneLink)); + } + + @override + int get hashCode => Object.hash(runtimeType, boneLink); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SelectedChunkStateWithBoneLinkImplCopyWith< + _$SelectedChunkStateWithBoneLinkImpl> + get copyWith => __$$SelectedChunkStateWithBoneLinkImplCopyWithImpl< + _$SelectedChunkStateWithBoneLinkImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(SkeletonChunk skeleton, Bone? bone) withSkeleton, + required TResult Function(BoneLinkChunk boneLink) withBoneLink, + required TResult Function( + MeshChunk mesh, MaterialData? material, Submesh? submesh) + withMesh, + required TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh) + withCloth, + }) { + return withBoneLink(boneLink); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult? Function(BoneLinkChunk boneLink)? withBoneLink, + TResult? Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult? Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + }) { + return withBoneLink?.call(boneLink); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult Function(BoneLinkChunk boneLink)? withBoneLink, + TResult Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + required TResult orElse(), + }) { + if (withBoneLink != null) { + return withBoneLink(boneLink); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SelectedChunkStateWithSkeleton value) + withSkeleton, + required TResult Function(SelectedChunkStateWithBoneLink value) + withBoneLink, + required TResult Function(SelectedChunkStateWithMesh value) withMesh, + required TResult Function(SelectedChunkStateWithCloth value) withCloth, + }) { + return withBoneLink(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult? Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult? Function(SelectedChunkStateWithMesh value)? withMesh, + TResult? Function(SelectedChunkStateWithCloth value)? withCloth, + }) { + return withBoneLink?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult Function(SelectedChunkStateWithMesh value)? withMesh, + TResult Function(SelectedChunkStateWithCloth value)? withCloth, + required TResult orElse(), + }) { + if (withBoneLink != null) { + return withBoneLink(this); + } + return orElse(); + } +} + +abstract class SelectedChunkStateWithBoneLink implements SelectedChunkState { + const factory SelectedChunkStateWithBoneLink( + {required final BoneLinkChunk boneLink}) = + _$SelectedChunkStateWithBoneLinkImpl; + + BoneLinkChunk get boneLink; + @JsonKey(ignore: true) + _$$SelectedChunkStateWithBoneLinkImplCopyWith< + _$SelectedChunkStateWithBoneLinkImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SelectedChunkStateWithMeshImplCopyWith<$Res> { + factory _$$SelectedChunkStateWithMeshImplCopyWith( + _$SelectedChunkStateWithMeshImpl value, + $Res Function(_$SelectedChunkStateWithMeshImpl) then) = + __$$SelectedChunkStateWithMeshImplCopyWithImpl<$Res>; + @useResult + $Res call({MeshChunk mesh, MaterialData? material, Submesh? submesh}); +} + +/// @nodoc +class __$$SelectedChunkStateWithMeshImplCopyWithImpl<$Res> + extends _$SelectedChunkStateCopyWithImpl<$Res, + _$SelectedChunkStateWithMeshImpl> + implements _$$SelectedChunkStateWithMeshImplCopyWith<$Res> { + __$$SelectedChunkStateWithMeshImplCopyWithImpl( + _$SelectedChunkStateWithMeshImpl _value, + $Res Function(_$SelectedChunkStateWithMeshImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? mesh = null, + Object? material = freezed, + Object? submesh = freezed, + }) { + return _then(_$SelectedChunkStateWithMeshImpl( + mesh: null == mesh + ? _value.mesh + : mesh // ignore: cast_nullable_to_non_nullable + as MeshChunk, + material: freezed == material + ? _value.material + : material // ignore: cast_nullable_to_non_nullable + as MaterialData?, + submesh: freezed == submesh + ? _value.submesh + : submesh // ignore: cast_nullable_to_non_nullable + as Submesh?, + )); + } +} + +/// @nodoc + +class _$SelectedChunkStateWithMeshImpl implements SelectedChunkStateWithMesh { + const _$SelectedChunkStateWithMeshImpl( + {required this.mesh, this.material, this.submesh}); + + @override + final MeshChunk mesh; + @override + final MaterialData? material; + @override + final Submesh? submesh; + + @override + String toString() { + return 'SelectedChunkState.withMesh(mesh: $mesh, material: $material, submesh: $submesh)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SelectedChunkStateWithMeshImpl && + (identical(other.mesh, mesh) || other.mesh == mesh) && + (identical(other.material, material) || + other.material == material) && + (identical(other.submesh, submesh) || other.submesh == submesh)); + } + + @override + int get hashCode => Object.hash(runtimeType, mesh, material, submesh); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SelectedChunkStateWithMeshImplCopyWith<_$SelectedChunkStateWithMeshImpl> + get copyWith => __$$SelectedChunkStateWithMeshImplCopyWithImpl< + _$SelectedChunkStateWithMeshImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(SkeletonChunk skeleton, Bone? bone) withSkeleton, + required TResult Function(BoneLinkChunk boneLink) withBoneLink, + required TResult Function( + MeshChunk mesh, MaterialData? material, Submesh? submesh) + withMesh, + required TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh) + withCloth, + }) { + return withMesh(mesh, material, submesh); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult? Function(BoneLinkChunk boneLink)? withBoneLink, + TResult? Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult? Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + }) { + return withMesh?.call(mesh, material, submesh); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult Function(BoneLinkChunk boneLink)? withBoneLink, + TResult Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + required TResult orElse(), + }) { + if (withMesh != null) { + return withMesh(mesh, material, submesh); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SelectedChunkStateWithSkeleton value) + withSkeleton, + required TResult Function(SelectedChunkStateWithBoneLink value) + withBoneLink, + required TResult Function(SelectedChunkStateWithMesh value) withMesh, + required TResult Function(SelectedChunkStateWithCloth value) withCloth, + }) { + return withMesh(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult? Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult? Function(SelectedChunkStateWithMesh value)? withMesh, + TResult? Function(SelectedChunkStateWithCloth value)? withCloth, + }) { + return withMesh?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult Function(SelectedChunkStateWithMesh value)? withMesh, + TResult Function(SelectedChunkStateWithCloth value)? withCloth, + required TResult orElse(), + }) { + if (withMesh != null) { + return withMesh(this); + } + return orElse(); + } +} + +abstract class SelectedChunkStateWithMesh implements SelectedChunkState { + const factory SelectedChunkStateWithMesh( + {required final MeshChunk mesh, + final MaterialData? material, + final Submesh? submesh}) = _$SelectedChunkStateWithMeshImpl; + + MeshChunk get mesh; + MaterialData? get material; + Submesh? get submesh; + @JsonKey(ignore: true) + _$$SelectedChunkStateWithMeshImplCopyWith<_$SelectedChunkStateWithMeshImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SelectedChunkStateWithClothImplCopyWith<$Res> { + factory _$$SelectedChunkStateWithClothImplCopyWith( + _$SelectedChunkStateWithClothImpl value, + $Res Function(_$SelectedChunkStateWithClothImpl) then) = + __$$SelectedChunkStateWithClothImplCopyWithImpl<$Res>; + @useResult + $Res call({ClothChunk cloth, MaterialData? material, Submesh? submesh}); +} + +/// @nodoc +class __$$SelectedChunkStateWithClothImplCopyWithImpl<$Res> + extends _$SelectedChunkStateCopyWithImpl<$Res, + _$SelectedChunkStateWithClothImpl> + implements _$$SelectedChunkStateWithClothImplCopyWith<$Res> { + __$$SelectedChunkStateWithClothImplCopyWithImpl( + _$SelectedChunkStateWithClothImpl _value, + $Res Function(_$SelectedChunkStateWithClothImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? cloth = null, + Object? material = freezed, + Object? submesh = freezed, + }) { + return _then(_$SelectedChunkStateWithClothImpl( + cloth: null == cloth + ? _value.cloth + : cloth // ignore: cast_nullable_to_non_nullable + as ClothChunk, + material: freezed == material + ? _value.material + : material // ignore: cast_nullable_to_non_nullable + as MaterialData?, + submesh: freezed == submesh + ? _value.submesh + : submesh // ignore: cast_nullable_to_non_nullable + as Submesh?, + )); + } +} + +/// @nodoc + +class _$SelectedChunkStateWithClothImpl implements SelectedChunkStateWithCloth { + const _$SelectedChunkStateWithClothImpl( + {required this.cloth, this.material, this.submesh}); + + @override + final ClothChunk cloth; + @override + final MaterialData? material; + @override + final Submesh? submesh; + + @override + String toString() { + return 'SelectedChunkState.withCloth(cloth: $cloth, material: $material, submesh: $submesh)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SelectedChunkStateWithClothImpl && + (identical(other.cloth, cloth) || other.cloth == cloth) && + (identical(other.material, material) || + other.material == material) && + (identical(other.submesh, submesh) || other.submesh == submesh)); + } + + @override + int get hashCode => Object.hash(runtimeType, cloth, material, submesh); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$SelectedChunkStateWithClothImplCopyWith<_$SelectedChunkStateWithClothImpl> + get copyWith => __$$SelectedChunkStateWithClothImplCopyWithImpl< + _$SelectedChunkStateWithClothImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(SkeletonChunk skeleton, Bone? bone) withSkeleton, + required TResult Function(BoneLinkChunk boneLink) withBoneLink, + required TResult Function( + MeshChunk mesh, MaterialData? material, Submesh? submesh) + withMesh, + required TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh) + withCloth, + }) { + return withCloth(cloth, material, submesh); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult? Function(BoneLinkChunk boneLink)? withBoneLink, + TResult? Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult? Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + }) { + return withCloth?.call(cloth, material, submesh); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(SkeletonChunk skeleton, Bone? bone)? withSkeleton, + TResult Function(BoneLinkChunk boneLink)? withBoneLink, + TResult Function(MeshChunk mesh, MaterialData? material, Submesh? submesh)? + withMesh, + TResult Function( + ClothChunk cloth, MaterialData? material, Submesh? submesh)? + withCloth, + required TResult orElse(), + }) { + if (withCloth != null) { + return withCloth(cloth, material, submesh); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(SelectedChunkStateWithSkeleton value) + withSkeleton, + required TResult Function(SelectedChunkStateWithBoneLink value) + withBoneLink, + required TResult Function(SelectedChunkStateWithMesh value) withMesh, + required TResult Function(SelectedChunkStateWithCloth value) withCloth, + }) { + return withCloth(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult? Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult? Function(SelectedChunkStateWithMesh value)? withMesh, + TResult? Function(SelectedChunkStateWithCloth value)? withCloth, + }) { + return withCloth?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(SelectedChunkStateWithSkeleton value)? withSkeleton, + TResult Function(SelectedChunkStateWithBoneLink value)? withBoneLink, + TResult Function(SelectedChunkStateWithMesh value)? withMesh, + TResult Function(SelectedChunkStateWithCloth value)? withCloth, + required TResult orElse(), + }) { + if (withCloth != null) { + return withCloth(this); + } + return orElse(); + } +} + +abstract class SelectedChunkStateWithCloth implements SelectedChunkState { + const factory SelectedChunkStateWithCloth( + {required final ClothChunk cloth, + final MaterialData? material, + final Submesh? submesh}) = _$SelectedChunkStateWithClothImpl; + + ClothChunk get cloth; + MaterialData? get material; + Submesh? get submesh; + @JsonKey(ignore: true) + _$$SelectedChunkStateWithClothImplCopyWith<_$SelectedChunkStateWithClothImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/widgets/header2/widgets/chunks/mesh.dart b/lib/widgets/header2/widgets/chunks/mesh.dart index 997afd3..e2492ba 100644 --- a/lib/widgets/header2/widgets/chunks/mesh.dart +++ b/lib/widgets/header2/widgets/chunks/mesh.dart @@ -26,7 +26,10 @@ class MeshChunkDisplay extends ConsumerWidget { @override Widget build(BuildContext context, ref) { final selectedSubMesh = ref.watch(header2StateNotifierProvider).mapOrNull( - withModelSettings: (data) => data.submesh, + withModelSettings: (data) => data.selectedChunkState?.mapOrNull( + withCloth: (cloth) => cloth.submesh, + withMesh: (mesh) => mesh.submesh, + ), ); return DataDecorator(children: [ GsfDataTile(label: 'attributes', data: mesh.attributes), @@ -108,7 +111,10 @@ class ClothChunkDisplay extends ConsumerWidget { @override Widget build(BuildContext context, ref) { final selectedSubMesh = ref.watch(header2StateNotifierProvider).mapOrNull( - withModelSettings: (data) => data.submesh, + withModelSettings: (data) => data.selectedChunkState?.mapOrNull( + withCloth: (cloth) => cloth.submesh, + withMesh: (mesh) => mesh.submesh, + ), ); return DataDecorator(children: [ GsfDataTile(label: 'attributes', data: cloth.attributes), diff --git a/pubspec.lock b/pubspec.lock index 4488f7c..21efe5e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "64.0.0" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "6.4.1" analyzer_plugin: dependency: transitive description: @@ -189,26 +189,26 @@ packages: dependency: transitive description: name: custom_lint - sha256: "22bd87a362f433ba6aae127a7bac2838645270737f3721b180916d7c5946cb5d" + sha256: "445242371d91d2e24bd7b82e3583a2c05610094ba2d0575262484ad889c8f981" url: "https://pub.dev" source: hosted - version: "0.5.11" + version: "0.6.2" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: "2952837953022de610dacb464f045594854ced6506ac7f76af28d4a6490e189b" + sha256: ce5d6215f4e143f7780ce53f73dfa6fc503f39d2d30bef76c48be9ac1a09d9a6 url: "https://pub.dev" source: hosted - version: "0.5.14" + version: "0.6.2" dart_style: dependency: transitive description: name: dart_style - sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" url: "https://pub.dev" source: hosted - version: "2.3.4" + version: "2.3.6" equatable: dependency: "direct main" description: @@ -229,10 +229,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" file: dependency: transitive description: @@ -245,10 +245,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" + sha256: caa6bc229eab3e32eb2f37b53a5f9d22a6981474afd210c512a7546c1e1a04f6 url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.2.0" fixnum: dependency: transitive description: @@ -282,10 +282,10 @@ packages: dependency: "direct main" description: name: flutter_riverpod - sha256: "4bce556b7ecbfea26109638d5237684538d4abc509d253e6c5c4c5733b360098" + sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d" url: "https://pub.dev" source: hosted - version: "2.4.10" + version: "2.5.1" flutter_test: dependency: "direct dev" description: flutter @@ -444,10 +444,10 @@ packages: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" package_config: dependency: transitive description: @@ -556,34 +556,34 @@ packages: dependency: transitive description: name: riverpod - sha256: "548e2192eb7aeb826eb89387f814edb76594f3363e2c0bb99dd733d795ba3589" + sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.5.1" riverpod_analyzer_utils: dependency: transitive description: name: riverpod_analyzer_utils - sha256: d4dabc35358413bf4611fcb6abb46308a67c4ef4cd5e69fd3367b11925c59f57 + sha256: "8b71f03fc47ae27d13769496a1746332df4cec43918aeba9aff1e232783a780f" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.5.1" riverpod_annotation: dependency: transitive description: name: riverpod_annotation - sha256: "77e5d51afa4fa3e67903fb8746f33d368728d7051a0b6c292bcee60aeba46d95" + sha256: e5e796c0eba4030c704e9dae1b834a6541814963292839dcf9638d53eba84f5c url: "https://pub.dev" source: hosted - version: "2.3.4" + version: "2.3.5" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "7340e2ac0fb05b2d893b049c45188a81443c2bd825d5f266cba06197867b0ade" + sha256: d451608bf17a372025fc36058863737636625dfdb7e3cbf6142e0dfeb366ab22 url: "https://pub.dev" source: hosted - version: "2.3.10" + version: "2.4.0" rxdart: dependency: transitive description: @@ -713,10 +713,10 @@ packages: dependency: transitive description: name: uuid - sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f" + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.dev" source: hosted - version: "4.2.2" + version: "4.3.3" vector_math: dependency: "direct main" description: @@ -741,22 +741,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.4" win32: dependency: transitive description: name: win32 - sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480" url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "5.3.0" xdg_directories: dependency: transitive description: @@ -774,5 +782,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-0 <4.0.0" + dart: ">=3.3.0 <4.0.0" flutter: ">=3.10.0"