From 468b7f2c2e3f37d449a2be56cbd043af0abf22a4 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 3 Dec 2024 23:38:43 +0800 Subject: [PATCH] :sparkles: User profile --- assets/translations/en.json | 6 +- assets/translations/zh.json | 6 +- ios/Podfile.lock | 12 +- lib/router.dart | 2 +- lib/screens/account/pfp.dart | 375 ++++++++++-------- ...ost_publisher.dart => publisher_page.dart} | 42 +- lib/types/account.dart | 13 + lib/types/account.freezed.dart | 218 ++++++++++ lib/types/account.g.dart | 20 + macos/Podfile.lock | 12 +- pubspec.lock | 14 +- pubspec.yaml | 3 +- 12 files changed, 520 insertions(+), 203 deletions(-) rename lib/screens/post/{post_publisher.dart => publisher_page.dart} (95%) diff --git a/assets/translations/en.json b/assets/translations/en.json index a3af96b..53f1827 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -358,5 +358,9 @@ "accountBirthday": "Born on {}", "accountBadge": "Badge", "badgeCompanyStaff": "Solsynth LLC Staff", - "badgeSiteMigration": "Solar Network Native" + "badgeSiteMigration": "Solar Network Native", + "accountStatus": "Status", + "accountStatusOnline": "Online", + "accountStatusOffline": "Offline", + "accountStatusLastSeen": "Last seen at {}" } diff --git a/assets/translations/zh.json b/assets/translations/zh.json index 4c6410f..f13acc4 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -358,5 +358,9 @@ "accountBirthday": "出生于 {}", "accountBadge": "徽章", "badgeCompanyStaff": "索尔辛茨士大夫 · Staff", - "badgeSiteMigration": "Solar Network 原住民" + "badgeSiteMigration": "Solar Network 原住民", + "accountStatus": "状态", + "accountStatusOnline": "在线", + "accountStatusOffline": "离线", + "accountStatusLastSeen": "最后一次在 {} 上线" } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5aab488..edd4146 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -109,7 +109,7 @@ PODS: - SAMKeychain - flutter_webrtc (0.12.2): - Flutter - - WebRTC-SDK (= 125.6422.05) + - WebRTC-SDK (= 125.6422.06) - GoogleAppMeasurement (11.4.0): - GoogleAppMeasurement/AdIdSupport (= 11.4.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.0) @@ -164,7 +164,7 @@ PODS: - Flutter - livekit_client (2.3.1): - Flutter - - WebRTC-SDK (= 125.6422.05) + - WebRTC-SDK (= 125.6422.06) - media_kit_libs_ios_video (1.0.4): - Flutter - media_kit_native_event_loop (1.0.0): @@ -210,7 +210,7 @@ PODS: - Flutter - wakelock_plus (0.0.1): - Flutter - - WebRTC-SDK (125.6422.05) + - WebRTC-SDK (125.6422.06) DEPENDENCIES: - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) @@ -341,12 +341,12 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_native_splash: e8a1e01082d97a8099d973f919f57904c925008a flutter_udid: a2482c67a61b9c806ef59dd82ed8d007f1b7ac04 - flutter_webrtc: 043d1b47e9795158dd97dc84f1c152cd0e98b93b + flutter_webrtc: 1a53bd24f97bcfeff512f13699e721897f261563 GoogleAppMeasurement: 987769c4ca6b968f2479fbcc9fe3ce34af454b8e GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 - livekit_client: e5e1be9c3fedd51c63f3ec4b4d3c616e9744c92b + livekit_client: dbb906ef427fe96dde5854471c3dda0a50cc15f9 media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1 media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e @@ -367,7 +367,7 @@ SPEC CHECKSUMS: url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9 wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 - WebRTC-SDK: 1990a1a595bd0b59c17485ce13ff17f575732c12 + WebRTC-SDK: 79942c006ea64f6fb48d7da8a4786dfc820bc1db PODFILE CHECKSUM: d2bdaa1cc7915e14cf47235c34a21fcb07b00390 diff --git a/lib/router.dart b/lib/router.dart index 1cc6e02..395b622 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -21,7 +21,7 @@ import 'package:surface/screens/home.dart'; import 'package:surface/screens/notification.dart'; import 'package:surface/screens/post/post_detail.dart'; import 'package:surface/screens/post/post_editor.dart'; -import 'package:surface/screens/post/post_publisher.dart'; +import 'package:surface/screens/post/publisher_page.dart'; import 'package:surface/screens/post/post_search.dart'; import 'package:surface/screens/realm.dart'; import 'package:surface/screens/realm/manage.dart'; diff --git a/lib/screens/account/pfp.dart b/lib/screens/account/pfp.dart index df79f4f..d91c72e 100644 --- a/lib/screens/account/pfp.dart +++ b/lib/screens/account/pfp.dart @@ -13,14 +13,16 @@ import 'package:surface/widgets/account/account_image.dart'; import 'package:surface/widgets/dialog.dart'; import 'package:surface/widgets/universal_image.dart'; -const Map kBadgesMeta = { +const Map kBadgesMeta = { 'company.staff': ( 'badgeCompanyStaff', Symbols.tools_wrench, + Colors.teal, ), 'site.migration': ( 'badgeSiteMigration', Symbols.flag, + Colors.orange, ), }; @@ -54,6 +56,22 @@ class _UserScreenState extends State } } + SnAccountStatusInfo? _status; + + Future _fetchStatus() async { + try { + final sn = context.read(); + final resp = await sn.client.get('/cgi/id/users/${widget.name}/status'); + if (!mounted) return; + _status = SnAccountStatusInfo.fromJson(resp.data); + } catch (err) { + if (!mounted) return; + context.showErrorDialog(err); + } finally { + setState(() {}); + } + } + double _appBarBlur = 0.0; late final _appBarWidth = MediaQuery.of(context).size.width; @@ -71,7 +89,9 @@ class _UserScreenState extends State @override void initState() { super.initState(); - _fetchAccount().then((_) {}); + _fetchAccount().then((_) { + _fetchStatus(); + }); _scrollController.addListener(_updateAppBarBlur); } @@ -99,175 +119,208 @@ class _UserScreenState extends State final sn = context.read(); return Scaffold( - body: NestedScrollView( + body: CustomScrollView( controller: _scrollController, - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverAppBar( - expandedHeight: _appBarHeight, - title: _account == null - ? Text('loading').tr() - : RichText( - textAlign: TextAlign.center, - text: TextSpan(children: [ - TextSpan( - text: _account!.nick, - style: - Theme.of(context).textTheme.titleLarge!.copyWith( - color: Colors.white, - shadows: labelShadows, - ), - ), - const TextSpan(text: '\n'), - TextSpan( - text: '@${_account!.name}', - style: - Theme.of(context).textTheme.bodySmall!.copyWith( - color: Colors.white, - shadows: labelShadows, - ), - ), - ]), - ), - pinned: true, - flexibleSpace: _account != null - ? Stack( - fit: StackFit.expand, - children: [ - UniversalImage( - sn.getAttachmentUrl(_account!.banner), - fit: BoxFit.cover, - height: imageHeight, - width: _appBarWidth, - cacheHeight: imageHeight, - cacheWidth: _appBarWidth, - ), - Positioned( - top: 0, - left: 0, - right: 0, - height: 56 + MediaQuery.of(context).padding.top, - child: ClipRect( - child: BackdropFilter( - filter: ImageFilter.blur( - sigmaX: _appBarBlur, - sigmaY: _appBarBlur, - ), - child: Container( - color: Colors.black.withOpacity( - clampDouble(_appBarBlur * 0.1, 0, 0.5), - ), + slivers: [ + SliverAppBar( + expandedHeight: _appBarHeight, + title: _account == null + ? Text('loading').tr() + : RichText( + textAlign: TextAlign.center, + text: TextSpan(children: [ + TextSpan( + text: _account!.nick, + style: Theme.of(context).textTheme.titleLarge!.copyWith( + color: Colors.white, + shadows: labelShadows, + ), + ), + const TextSpan(text: '\n'), + TextSpan( + text: '@${_account!.name}', + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Colors.white, + shadows: labelShadows, + ), + ), + ]), + ), + pinned: true, + flexibleSpace: _account != null + ? Stack( + fit: StackFit.expand, + children: [ + UniversalImage( + sn.getAttachmentUrl(_account!.banner), + fit: BoxFit.cover, + height: imageHeight, + width: _appBarWidth, + cacheHeight: imageHeight, + cacheWidth: _appBarWidth, + ), + Positioned( + top: 0, + left: 0, + right: 0, + height: 56 + MediaQuery.of(context).padding.top, + child: ClipRect( + child: BackdropFilter( + filter: ImageFilter.blur( + sigmaX: _appBarBlur, + sigmaY: _appBarBlur, + ), + child: Container( + color: Colors.black.withOpacity( + clampDouble(_appBarBlur * 0.1, 0, 0.5), ), ), ), ), - ], - ) - : null, - ), - ]; - }, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AccountImage( - content: _account!.avatar, - radius: 28, - ), - const Gap(16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _account!.nick, - style: Theme.of(context).textTheme.titleMedium, - ).bold(), - Text('@${_account!.name}').fontSize(13), - ], ), - ), - ], - ).padding(right: 8), - const Gap(12), - Text(_account!.description).padding(horizontal: 8), - const Gap(12), - Column( - children: [ - Row( - children: [ - const Icon(Symbols.calendar_add_on), - const Gap(8), - Text('publisherJoinedAt').tr(args: [ - DateFormat('y/M/d').format(_account!.createdAt) - ]), - ], - ), - Row( - children: [ - const Icon(Symbols.cake), - const Gap(8), - Text('accountBirthday').tr(args: [ - _account!.profile?.birthday == null - ? 'unknown'.tr() - : DateFormat('M/d') - .format(_account!.profile!.birthday!) - ]), - ], - ), - Row( - children: [ - const Icon(Symbols.identity_platform), - const Gap(8), - Text( - '#${_account!.id.toString().padLeft(8, '0')}', - style: GoogleFonts.robotoMono(), - ).opacity(0.8), - ], - ), - ], - ).padding(horizontal: 8), - ], - ).padding(all: 16), - const Divider(), - const Gap(12), - Text('accountBadge') - .bold() - .fontSize(17) - .tr() - .padding(horizontal: 20, bottom: 4), - SizedBox( - height: 64, - width: double.infinity, - child: ListView( - padding: EdgeInsets.symmetric(horizontal: 8), - scrollDirection: Axis.horizontal, + ], + ) + : null, + ), + if (_account != null) + SliverToBoxAdapter( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - for (final badge in _account?.badges ?? []) - SizedBox( - width: 280, - child: Card( - child: ListTile( - leading: Icon( - kBadgesMeta[badge.type]?.$2 ?? - Symbols.question_mark, - ), - title: Text( - kBadgesMeta[badge.type]?.$1 ?? 'unknown', - ).tr(), + Row( + children: [ + AccountImage( + content: _account!.avatar, + radius: 28, + ), + const Gap(16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _account!.nick, + style: Theme.of(context).textTheme.titleMedium, + ).bold(), + Text('@${_account!.name}').fontSize(13), + ], ), ), - ), + ], + ).padding(right: 8), + const Gap(12), + Text(_account!.description).padding(horizontal: 8), + const Gap(4), + Card( + child: Row( + children: [ + Icon( + Symbols.circle, + fill: 1, + size: 16, + color: (_status?.isOnline ?? false) + ? Colors.green + : Colors.grey, + ).padding(all: 4), + const Gap(8), + Text( + _status != null + ? _status!.isOnline + ? 'accountStatusOnline'.tr() + : 'accountStatusOffline'.tr() + : 'loading'.tr(), + ), + ], + ).padding(vertical: 8, horizontal: 12), + ), + const Gap(8), + Column( + children: [ + Row( + children: [ + const Icon(Symbols.calendar_add_on), + const Gap(8), + Text('publisherJoinedAt').tr(args: [ + DateFormat('y/M/d').format(_account!.createdAt) + ]), + ], + ), + Row( + children: [ + const Icon(Symbols.cake), + const Gap(8), + Text('accountBirthday').tr(args: [ + _account!.profile?.birthday == null + ? 'unknown'.tr() + : DateFormat('M/d').format( + _account!.profile!.birthday!.toLocal(), + ) + ]), + ], + ), + Row( + children: [ + const Icon(Symbols.identity_platform), + const Gap(8), + Text( + '#${_account!.id.toString().padLeft(8, '0')}', + style: GoogleFonts.robotoMono(), + ).opacity(0.8), + ], + ), + ], + ).padding(horizontal: 8), ], - ), - ) - ], - ), + ).padding(all: 16), + ), + SliverToBoxAdapter(child: const Divider()), + const SliverGap(12), + SliverToBoxAdapter( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('accountBadge') + .bold() + .fontSize(17) + .tr() + .padding(horizontal: 20, bottom: 4), + SizedBox( + height: 80, + width: double.infinity, + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 8), + scrollDirection: Axis.horizontal, + children: [ + for (final badge in _account?.badges ?? []) + SizedBox( + width: 280, + child: Card( + child: ListTile( + leading: Icon( + kBadgesMeta[badge.type]?.$2 ?? + Symbols.question_mark, + color: kBadgesMeta[badge.type]?.$3, + fill: 1, + ), + title: Text( + kBadgesMeta[badge.type]?.$1 ?? 'unknown', + ).tr(), + subtitle: badge.metadata['title'] != null + ? Text(badge.metadata['title']) + : Text( + DateFormat('y/M/d') + .format(badge.createdAt), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ) + ], ), ); } diff --git a/lib/screens/post/post_publisher.dart b/lib/screens/post/publisher_page.dart similarity index 95% rename from lib/screens/post/post_publisher.dart rename to lib/screens/post/publisher_page.dart index 01ba92b..676f6a2 100644 --- a/lib/screens/post/post_publisher.dart +++ b/lib/screens/post/publisher_page.dart @@ -404,30 +404,36 @@ class _PostPublisherScreenState extends State ], ), SliverToBoxAdapter(child: const Divider(height: 1)), - Gap(math.max(MediaQuery.of(context).padding.top, 50)), ], ), ), ]; }, - body: TabBarView( - controller: _tabController, - children: List.filled( - 3, - _PublisherPostList( - isBusy: _isBusy, - postCount: _postCount, - posts: _posts, - fetchPosts: _fetchPosts, - onChanged: (idx, data) { - setState(() => _posts[idx] = data); - }, - onDeleted: () { - _posts.clear(); - _fetchPosts(); - }, + body: Column( + children: [ + Gap(math.max(MediaQuery.of(context).padding.top, 64)), + Expanded( + child: TabBarView( + controller: _tabController, + children: List.filled( + 3, + _PublisherPostList( + isBusy: _isBusy, + postCount: _postCount, + posts: _posts, + fetchPosts: _fetchPosts, + onChanged: (idx, data) { + setState(() => _posts[idx] = data); + }, + onDeleted: () { + _posts.clear(); + _fetchPosts(); + }, + ), + ), + ), ), - ), + ], ), ), ); diff --git a/lib/types/account.dart b/lib/types/account.dart index 4ef0b13..9fa02cf 100644 --- a/lib/types/account.dart +++ b/lib/types/account.dart @@ -106,3 +106,16 @@ class SnAccountBadge with _$SnAccountBadge { factory SnAccountBadge.fromJson(Map json) => _$SnAccountBadgeFromJson(json); } + +@freezed +class SnAccountStatusInfo with _$SnAccountStatusInfo { + const factory SnAccountStatusInfo({ + required bool isDisturbable, + required bool isOnline, + required DateTime? lastSeenAt, + required dynamic status, + }) = _SnAccountStatusInfo; + + factory SnAccountStatusInfo.fromJson(Map json) => + _$SnAccountStatusInfoFromJson(json); +} diff --git a/lib/types/account.freezed.dart b/lib/types/account.freezed.dart index 16d0114..69fcdd8 100644 --- a/lib/types/account.freezed.dart +++ b/lib/types/account.freezed.dart @@ -1987,3 +1987,221 @@ abstract class _SnAccountBadge implements SnAccountBadge { _$$SnAccountBadgeImplCopyWith<_$SnAccountBadgeImpl> get copyWith => throw _privateConstructorUsedError; } + +SnAccountStatusInfo _$SnAccountStatusInfoFromJson(Map json) { + return _SnAccountStatusInfo.fromJson(json); +} + +/// @nodoc +mixin _$SnAccountStatusInfo { + bool get isDisturbable => throw _privateConstructorUsedError; + bool get isOnline => throw _privateConstructorUsedError; + DateTime? get lastSeenAt => throw _privateConstructorUsedError; + dynamic get status => throw _privateConstructorUsedError; + + /// Serializes this SnAccountStatusInfo to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of SnAccountStatusInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SnAccountStatusInfoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SnAccountStatusInfoCopyWith<$Res> { + factory $SnAccountStatusInfoCopyWith( + SnAccountStatusInfo value, $Res Function(SnAccountStatusInfo) then) = + _$SnAccountStatusInfoCopyWithImpl<$Res, SnAccountStatusInfo>; + @useResult + $Res call( + {bool isDisturbable, + bool isOnline, + DateTime? lastSeenAt, + dynamic status}); +} + +/// @nodoc +class _$SnAccountStatusInfoCopyWithImpl<$Res, $Val extends SnAccountStatusInfo> + implements $SnAccountStatusInfoCopyWith<$Res> { + _$SnAccountStatusInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SnAccountStatusInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? isDisturbable = null, + Object? isOnline = null, + Object? lastSeenAt = freezed, + Object? status = freezed, + }) { + return _then(_value.copyWith( + isDisturbable: null == isDisturbable + ? _value.isDisturbable + : isDisturbable // ignore: cast_nullable_to_non_nullable + as bool, + isOnline: null == isOnline + ? _value.isOnline + : isOnline // ignore: cast_nullable_to_non_nullable + as bool, + lastSeenAt: freezed == lastSeenAt + ? _value.lastSeenAt + : lastSeenAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + status: freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as dynamic, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$SnAccountStatusInfoImplCopyWith<$Res> + implements $SnAccountStatusInfoCopyWith<$Res> { + factory _$$SnAccountStatusInfoImplCopyWith(_$SnAccountStatusInfoImpl value, + $Res Function(_$SnAccountStatusInfoImpl) then) = + __$$SnAccountStatusInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {bool isDisturbable, + bool isOnline, + DateTime? lastSeenAt, + dynamic status}); +} + +/// @nodoc +class __$$SnAccountStatusInfoImplCopyWithImpl<$Res> + extends _$SnAccountStatusInfoCopyWithImpl<$Res, _$SnAccountStatusInfoImpl> + implements _$$SnAccountStatusInfoImplCopyWith<$Res> { + __$$SnAccountStatusInfoImplCopyWithImpl(_$SnAccountStatusInfoImpl _value, + $Res Function(_$SnAccountStatusInfoImpl) _then) + : super(_value, _then); + + /// Create a copy of SnAccountStatusInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? isDisturbable = null, + Object? isOnline = null, + Object? lastSeenAt = freezed, + Object? status = freezed, + }) { + return _then(_$SnAccountStatusInfoImpl( + isDisturbable: null == isDisturbable + ? _value.isDisturbable + : isDisturbable // ignore: cast_nullable_to_non_nullable + as bool, + isOnline: null == isOnline + ? _value.isOnline + : isOnline // ignore: cast_nullable_to_non_nullable + as bool, + lastSeenAt: freezed == lastSeenAt + ? _value.lastSeenAt + : lastSeenAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + status: freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as dynamic, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$SnAccountStatusInfoImpl implements _SnAccountStatusInfo { + const _$SnAccountStatusInfoImpl( + {required this.isDisturbable, + required this.isOnline, + required this.lastSeenAt, + required this.status}); + + factory _$SnAccountStatusInfoImpl.fromJson(Map json) => + _$$SnAccountStatusInfoImplFromJson(json); + + @override + final bool isDisturbable; + @override + final bool isOnline; + @override + final DateTime? lastSeenAt; + @override + final dynamic status; + + @override + String toString() { + return 'SnAccountStatusInfo(isDisturbable: $isDisturbable, isOnline: $isOnline, lastSeenAt: $lastSeenAt, status: $status)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SnAccountStatusInfoImpl && + (identical(other.isDisturbable, isDisturbable) || + other.isDisturbable == isDisturbable) && + (identical(other.isOnline, isOnline) || + other.isOnline == isOnline) && + (identical(other.lastSeenAt, lastSeenAt) || + other.lastSeenAt == lastSeenAt) && + const DeepCollectionEquality().equals(other.status, status)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, isDisturbable, isOnline, + lastSeenAt, const DeepCollectionEquality().hash(status)); + + /// Create a copy of SnAccountStatusInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SnAccountStatusInfoImplCopyWith<_$SnAccountStatusInfoImpl> get copyWith => + __$$SnAccountStatusInfoImplCopyWithImpl<_$SnAccountStatusInfoImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$SnAccountStatusInfoImplToJson( + this, + ); + } +} + +abstract class _SnAccountStatusInfo implements SnAccountStatusInfo { + const factory _SnAccountStatusInfo( + {required final bool isDisturbable, + required final bool isOnline, + required final DateTime? lastSeenAt, + required final dynamic status}) = _$SnAccountStatusInfoImpl; + + factory _SnAccountStatusInfo.fromJson(Map json) = + _$SnAccountStatusInfoImpl.fromJson; + + @override + bool get isDisturbable; + @override + bool get isOnline; + @override + DateTime? get lastSeenAt; + @override + dynamic get status; + + /// Create a copy of SnAccountStatusInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SnAccountStatusInfoImplCopyWith<_$SnAccountStatusInfoImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/types/account.g.dart b/lib/types/account.g.dart index 60cb271..c9c491e 100644 --- a/lib/types/account.g.dart +++ b/lib/types/account.g.dart @@ -192,3 +192,23 @@ Map _$$SnAccountBadgeImplToJson( 'account_id': instance.accountId, 'metadata': instance.metadata, }; + +_$SnAccountStatusInfoImpl _$$SnAccountStatusInfoImplFromJson( + Map json) => + _$SnAccountStatusInfoImpl( + isDisturbable: json['is_disturbable'] as bool, + isOnline: json['is_online'] as bool, + lastSeenAt: json['last_seen_at'] == null + ? null + : DateTime.parse(json['last_seen_at'] as String), + status: json['status'], + ); + +Map _$$SnAccountStatusInfoImplToJson( + _$SnAccountStatusInfoImpl instance) => + { + 'is_disturbable': instance.isDisturbable, + 'is_online': instance.isOnline, + 'last_seen_at': instance.lastSeenAt?.toIso8601String(), + 'status': instance.status, + }; diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 24bb298..bf907fd 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -75,7 +75,7 @@ PODS: - SAMKeychain - flutter_webrtc (0.12.2): - FlutterMacOS - - WebRTC-SDK (= 125.6422.05) + - WebRTC-SDK (= 125.6422.06) - FlutterMacOS (1.0.0) - GoogleAppMeasurement (11.4.0): - GoogleAppMeasurement/AdIdSupport (= 11.4.0) @@ -129,7 +129,7 @@ PODS: - GoogleUtilities/Privacy - livekit_client (2.3.1): - FlutterMacOS - - WebRTC-SDK (= 125.6422.05) + - WebRTC-SDK (= 125.6422.06) - media_kit_libs_macos_video (1.0.4): - FlutterMacOS - media_kit_native_event_loop (1.0.0): @@ -167,7 +167,7 @@ PODS: - FlutterMacOS - wakelock_plus (0.0.1): - FlutterMacOS - - WebRTC-SDK (125.6422.05) + - WebRTC-SDK (125.6422.06) DEPENDENCIES: - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/darwin`) @@ -278,12 +278,12 @@ SPEC CHECKSUMS: FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414 FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2 flutter_udid: 6b2b89780c3dfeecf0047bdf93f622d6416b1c07 - flutter_webrtc: 646bc8ab7ba7e45aae7279a371177e414cd5a326 + flutter_webrtc: 53c9e1285ab32dfb58afb1e1471416a877e23d7a FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 GoogleAppMeasurement: 987769c4ca6b968f2479fbcc9fe3ce34af454b8e GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d - livekit_client: 6ff0eb9b53ca4fbe0deb7e4b875f4ae9167702d2 + livekit_client: 8838dc52cb95b452968efb84e87cad895c261d9d media_kit_libs_macos_video: b3e2bbec2eef97c285f2b1baa7963c67c753fb82 media_kit_native_event_loop: 81fd5b45192b72f8b5b69eaf5b540f45777eb8d5 media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5 @@ -300,7 +300,7 @@ SPEC CHECKSUMS: sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269 - WebRTC-SDK: 1990a1a595bd0b59c17485ce13ff17f575732c12 + WebRTC-SDK: 79942c006ea64f6fb48d7da8a4786dfc820bc1db PODFILE CHECKSUM: c2e95c8c0fe03c5c57e438583cae4cc732296009 diff --git a/pubspec.lock b/pubspec.lock index 4ad848f..b749e84 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -667,13 +667,13 @@ packages: source: sdk version: "0.0.0" flutter_webrtc: - dependency: "direct main" + dependency: transitive description: name: flutter_webrtc - sha256: fcaee6f28cc1221e804fcba16fbee6f20b0848af20fe11174a0f97c3b9833381 + sha256: "4838217405c42cce422698eacc9c2e17089b9c05322be899c0a725107dcddbdc" url: "https://pub.dev" source: hosted - version: "0.12.2" + version: "0.12.3" freezed: dependency: "direct dev" description: @@ -974,10 +974,10 @@ packages: dependency: "direct main" description: name: livekit_client - sha256: "442c228f42a3b757e1a5e526b0816f2b0a93b34625ff29b2c9fb9503ce4e4f3e" + sha256: e1e2524c8b0c9280ab852b5239b9ad00f10f50c82c5f6cc674df3583b6d3408b url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.1+hotfix.1" logging: dependency: transitive description: @@ -1486,10 +1486,10 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" + sha256: "7f172d1b06de5da47b6264c2692ee2ead20bbbc246690427cdb4fc301cd0c549" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.3.4" shared_preferences_foundation: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0713e5a..b54df05 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -88,8 +88,7 @@ dependencies: pasteboard: ^0.3.0 sentry_flutter: ^8.10.1 synchronized: ^3.3.0+3 - livekit_client: ^2.3.0 - flutter_webrtc: 0.12.2 # TODO: Remove this once livekit solved its dependency issue, https://github.com/livekit/client-sdk-flutter/issues/648 + livekit_client: ^2.3.1+hotfix.1 wakelock_plus: ^1.2.8 permission_handler: ^11.3.1 flutter_staggered_grid_view: ^0.7.0