From 8366bda8467a7860b5f5442cc11416d33da7253f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 24 Jul 2024 01:17:41 +0800 Subject: [PATCH] :recycle: Refactored friend module --- lib/main.dart | 6 +- .../{friendship.dart => relations.dart} | 10 +- lib/providers/{content => }/call.dart | 0 lib/providers/content/channel.dart | 4 +- lib/providers/friend.dart | 43 ---- lib/providers/relation.dart | 57 ++++++ lib/router.dart | 5 +- lib/screens/account/friend.dart | 187 ++++++++---------- lib/screens/channel/call/call.dart | 2 +- lib/screens/channel/channel_chat.dart | 2 +- lib/widgets/account/friend_list.dart | 87 -------- lib/widgets/account/relative_list.dart | 83 ++++++++ ...riend_select.dart => relative_select.dart} | 22 +-- lib/widgets/channel/channel_member.dart | 4 +- lib/widgets/chat/call/call_controls.dart | 2 +- lib/widgets/chat/call/call_prejoin.dart | 2 +- .../chat/call/chat_call_indicator.dart | 2 +- lib/widgets/realms/realm_member.dart | 4 +- 18 files changed, 250 insertions(+), 272 deletions(-) rename lib/models/{friendship.dart => relations.dart} (85%) rename lib/providers/{content => }/call.dart (100%) delete mode 100644 lib/providers/friend.dart create mode 100644 lib/providers/relation.dart delete mode 100644 lib/widgets/account/friend_list.dart create mode 100644 lib/widgets/account/relative_list.dart rename lib/widgets/account/{friend_select.dart => relative_select.dart} (74%) diff --git a/lib/main.dart b/lib/main.dart index d2f7617..efdb30a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,11 +11,11 @@ import 'package:solian/platform.dart'; import 'package:solian/providers/websocket.dart'; import 'package:solian/providers/auth.dart'; import 'package:solian/providers/content/attachment.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; import 'package:solian/providers/content/channel.dart'; import 'package:solian/providers/content/posts.dart'; import 'package:solian/providers/content/realm.dart'; -import 'package:solian/providers/friend.dart'; +import 'package:solian/providers/relation.dart'; import 'package:solian/providers/account_status.dart'; import 'package:solian/router.dart'; import 'package:solian/shells/system_shell.dart'; @@ -96,7 +96,7 @@ class SolianApp extends StatelessWidget { void _initializeProviders(BuildContext context) async { Get.lazyPut(() => AuthProvider()); - Get.lazyPut(() => FriendProvider()); + Get.lazyPut(() => RelationshipProvider()); Get.lazyPut(() => PostProvider()); Get.lazyPut(() => AttachmentProvider()); Get.lazyPut(() => WebSocketProvider()); diff --git a/lib/models/friendship.dart b/lib/models/relations.dart similarity index 85% rename from lib/models/friendship.dart rename to lib/models/relations.dart index dc7541b..c722d4f 100644 --- a/lib/models/friendship.dart +++ b/lib/models/relations.dart @@ -1,38 +1,35 @@ import 'package:solian/models/account.dart'; -class Friendship { +class Relationship { int id; DateTime createdAt; DateTime updatedAt; DateTime? deletedAt; int accountId; int relatedId; - int? blockedBy; Account account; Account related; int status; - Friendship({ + Relationship({ required this.id, required this.createdAt, required this.updatedAt, required this.deletedAt, required this.accountId, required this.relatedId, - required this.blockedBy, required this.account, required this.related, required this.status, }); - factory Friendship.fromJson(Map json) => Friendship( + factory Relationship.fromJson(Map json) => Relationship( id: json['id'], createdAt: DateTime.parse(json['created_at']), updatedAt: DateTime.parse(json['updated_at']), deletedAt: json['deleted_at'], accountId: json['account_id'], relatedId: json['related_id'], - blockedBy: json['blocked_by'], account: Account.fromJson(json['account']), related: Account.fromJson(json['related']), status: json['status'], @@ -45,7 +42,6 @@ class Friendship { 'deleted_at': deletedAt, 'account_id': accountId, 'related_id': relatedId, - 'blocked_by': blockedBy, 'account': account.toJson(), 'related': related.toJson(), 'status': status, diff --git a/lib/providers/content/call.dart b/lib/providers/call.dart similarity index 100% rename from lib/providers/content/call.dart rename to lib/providers/call.dart diff --git a/lib/providers/content/channel.dart b/lib/providers/content/channel.dart index ba89700..252e147 100644 --- a/lib/providers/content/channel.dart +++ b/lib/providers/content/channel.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:solian/models/channel.dart'; import 'package:solian/providers/auth.dart'; -import 'package:solian/widgets/account/friend_select.dart'; +import 'package:solian/widgets/account/relative_select.dart'; import 'package:uuid/uuid.dart'; class ChannelProvider extends GetxController { @@ -123,7 +123,7 @@ class ChannelProvider extends GetxController { final related = await showModalBottomSheet( useRootNavigator: true, context: context, - builder: (context) => FriendSelect( + builder: (context) => RelativeSelector( title: 'channelOrganizeDirectHint'.tr, ), ); diff --git a/lib/providers/friend.dart b/lib/providers/friend.dart deleted file mode 100644 index 10b3dcb..0000000 --- a/lib/providers/friend.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:get/get.dart'; -import 'package:solian/models/friendship.dart'; -import 'package:solian/providers/auth.dart'; -import 'package:solian/services.dart'; - -class FriendProvider extends GetConnect { - @override - void onInit() { - final AuthProvider auth = Get.find(); - - httpClient.baseUrl = ServiceFinder.buildUrl('auth', null); - httpClient.addAuthenticator(auth.requestAuthenticator); - } - - Future listFriendship() => get('/users/me/friends'); - - Future listFriendshipWithStatus(int status) => - get('/users/me/friends?status=$status'); - - Future createFriendship(String username) async { - final resp = await post('/users/me/friends?related=$username', {}); - if (resp.statusCode != 200) { - throw Exception(resp.bodyString); - } - - return resp; - } - - Future updateFriendship(Friendship relationship, int status) async { - final AuthProvider auth = Get.find(); - final prof = await auth.getProfile(); - final otherside = relationship.getOtherside(prof.body['id']); - - final resp = await put('/users/me/friends/${otherside.id}', { - 'status': status, - }); - if (resp.statusCode != 200) { - throw Exception(resp.bodyString); - } - - return resp; - } -} diff --git a/lib/providers/relation.dart b/lib/providers/relation.dart new file mode 100644 index 0000000..46215c9 --- /dev/null +++ b/lib/providers/relation.dart @@ -0,0 +1,57 @@ +import 'package:get/get.dart'; +import 'package:solian/models/relations.dart'; +import 'package:solian/providers/auth.dart'; +import 'package:solian/services.dart'; + +class RelationshipProvider extends GetConnect { + @override + void onInit() { + final AuthProvider auth = Get.find(); + + httpClient.baseUrl = ServiceFinder.buildUrl('auth', null); + httpClient.addAuthenticator(auth.requestAuthenticator); + } + + Future listRelation() => get('/users/me/relations'); + + Future listRelationWithStatus(int status) => + get('/users/me/relations?status=$status'); + + Future makeFriend(String username) async { + final resp = await post('/users/me/relations?related=$username', {}); + if (resp.statusCode != 200) { + throw Exception(resp.bodyString); + } + + return resp; + } + + Future handleRelation( + Relationship relationship, bool doAccept) async { + final AuthProvider auth = Get.find(); + final client = auth.configureClient('auth'); + final resp = await client.post( + '/users/me/relations/${relationship.relatedId}/${doAccept ? 'accept' : 'decline'}', + {}, + ); + if (resp.statusCode != 200) { + throw Exception(resp.bodyString); + } + + return resp; + } + + Future editRelation(Relationship relationship, int status) async { + final AuthProvider auth = Get.find(); + final client = auth.configureClient('auth'); + final resp = + await client.patch('/users/me/relations/${relationship.relatedId}', { + 'status': status, + }); + if (resp.statusCode != 200) { + throw Exception(resp.bodyString); + } + + return resp; + } +} diff --git a/lib/router.dart b/lib/router.dart index 6794c54..a87c79e 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -191,10 +191,7 @@ abstract class AppRouter { GoRoute( path: '/account/friend', name: 'accountFriend', - builder: (context, state) => TitleShell( - state: state, - child: const FriendScreen(), - ), + builder: (context, state) => const FriendScreen(), ), GoRoute( path: '/account/personalize', diff --git a/lib/screens/account/friend.dart b/lib/screens/account/friend.dart index 87989b3..6607e0f 100644 --- a/lib/screens/account/friend.dart +++ b/lib/screens/account/friend.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:get/get.dart'; import 'package:solian/exts.dart'; -import 'package:solian/models/friendship.dart'; -import 'package:solian/providers/auth.dart'; -import 'package:solian/providers/friend.dart'; -import 'package:solian/widgets/account/friend_list.dart'; +import 'package:solian/models/relations.dart'; +import 'package:solian/providers/relation.dart'; +import 'package:solian/widgets/account/relative_list.dart'; class FriendScreen extends StatefulWidget { const FriendScreen({super.key}); @@ -14,71 +13,38 @@ class FriendScreen extends StatefulWidget { State createState() => _FriendScreenState(); } -class _FriendScreenState extends State { +class _FriendScreenState extends State + with SingleTickerProviderStateMixin { + late final TabController _tabController; + bool _isBusy = false; - int? _accountId; - List _friendships = List.empty(); + List _relations = List.empty(); - List filterWithStatus(int status) { - return _friendships.where((x) => x.status == status).toList(); + List filterByStatus(int status) { + return _relations.where((x) => x.status == status).toList(); } - Future getFriendship() async { + Future loadRelations() async { setState(() => _isBusy = true); - final FriendProvider provider = Get.find(); - final resp = await provider.listFriendship(); + final RelationshipProvider provider = Get.find(); + final resp = await provider.listRelation(); setState(() { - _friendships = resp.body - .map((e) => Friendship.fromJson(e)) + _relations = resp.body + .map((e) => Relationship.fromJson(e)) .toList() - .cast(); + .cast(); _isBusy = false; }); } - void showScopedListPopup(String title, int status) { - showModalBottomSheet( - useRootNavigator: true, - isScrollControlled: true, - context: context, - builder: (context) { - return SizedBox( - height: MediaQuery.of(context).size.height * 0.85, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: Theme.of(context).textTheme.headlineSmall, - ).paddingOnly(left: 24, right: 24, top: 32, bottom: 16), - Expanded( - child: CustomScrollView( - slivers: [ - SliverFriendList( - accountId: _accountId!, - items: filterWithStatus(status), - onUpdate: () { - getFriendship(); - }, - ), - ], - ), - ), - ], - ), - ); - }, - ); - } - void promptAddFriend() async { - final FriendProvider provider = Get.find(); + final RelationshipProvider provider = Get.find(); final controller = TextEditingController(); - final input = await showDialog( + final input = await showDialog( context: context, builder: (context) { return AlertDialog( @@ -125,7 +91,7 @@ class _FriendScreenState extends State { try { setState(() => _isBusy = true); - await provider.createFriendship(input); + await provider.makeFriend(input); } catch (e) { context.showErrorDialog(e); } finally { @@ -135,12 +101,14 @@ class _FriendScreenState extends State { @override void initState() { - Get.find().getProfile().then((value) { - _accountId = value.body['id']; - }); super.initState(); + _tabController = TabController(length: 3, vsync: this); - Future.delayed(Duration.zero, () => getFriendship()); + loadRelations().then((_) { + if (filterByStatus(0).isEmpty) { + _tabController.animateTo(1); + } + }); } @override @@ -148,64 +116,71 @@ class _FriendScreenState extends State { return Material( color: Theme.of(context).colorScheme.surface, child: Scaffold( + appBar: AppBar( + centerTitle: false, + title: Text('accountFriend'.tr), + bottom: TabBar( + controller: _tabController, + tabs: const [ + Tab(icon: Icon(Icons.call_received)), + Tab(icon: Icon(Icons.people)), + Tab(icon: Icon(Icons.call_made)), + ], + ), + ), floatingActionButton: FloatingActionButton( child: const Icon(Icons.add), onPressed: () => promptAddFriend(), ), - body: RefreshIndicator( - onRefresh: () => getFriendship(), - child: CustomScrollView( - slivers: [ - if (_isBusy) - SliverToBoxAdapter( - child: const LinearProgressIndicator().animate().scaleX(), - ), - SliverToBoxAdapter( - child: ListTile( - tileColor: Theme.of(context).colorScheme.surfaceContainerLow, - contentPadding: const EdgeInsets.symmetric(horizontal: 20), - leading: const Icon(Icons.person_add), - trailing: const Icon(Icons.chevron_right), - title: Text( - '${'accountFriendPending'.tr} (${filterWithStatus(0).length})', + body: TabBarView( + controller: _tabController, + children: [ + RefreshIndicator( + onRefresh: () => loadRelations(), + child: CustomScrollView( + slivers: [ + if (_isBusy) + SliverToBoxAdapter( + child: const LinearProgressIndicator().animate().scaleX(), + ), + SilverRelativeList( + items: filterByStatus(0), + onUpdate: () => loadRelations(), ), - onTap: () => - showScopedListPopup('accountFriendPending'.tr, 0), - ), + ], ), - SliverToBoxAdapter( - child: ListTile( - tileColor: Theme.of(context).colorScheme.surfaceContainerLow, - contentPadding: const EdgeInsets.symmetric(horizontal: 20), - leading: const Icon(Icons.block), - trailing: const Icon(Icons.chevron_right), - title: Text( - '${'accountFriendBlocked'.tr} (${filterWithStatus(2).length})', + ), + RefreshIndicator( + onRefresh: () => loadRelations(), + child: CustomScrollView( + slivers: [ + if (_isBusy) + SliverToBoxAdapter( + child: const LinearProgressIndicator().animate().scaleX(), + ), + SilverRelativeList( + items: filterByStatus(1), + onUpdate: () => loadRelations(), ), - onTap: () => - showScopedListPopup('accountFriendBlocked'.tr, 2), - ), + ], ), - if (_accountId != null) - SliverFriendList( - accountId: _accountId!, - items: filterWithStatus(1), - onUpdate: () { - getFriendship(); - }, - ), - const SliverToBoxAdapter( - child: Divider(thickness: 0.3, height: 0.3), + ), + RefreshIndicator( + onRefresh: () => loadRelations(), + child: CustomScrollView( + slivers: [ + if (_isBusy) + SliverToBoxAdapter( + child: const LinearProgressIndicator().animate().scaleX(), + ), + SilverRelativeList( + items: filterByStatus(3), + onUpdate: () => loadRelations(), + ), + ], ), - SliverToBoxAdapter( - child: Text( - 'accountFriendListHint'.tr, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodySmall, - ).paddingOnly(top: 16, bottom: 32), - ), - ], - ), + ), + ], ), ), ); diff --git a/lib/screens/channel/call/call.dart b/lib/screens/channel/call/call.dart index bc037d0..3de6ce8 100644 --- a/lib/screens/channel/call/call.dart +++ b/lib/screens/channel/call/call.dart @@ -3,7 +3,7 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; import 'package:solian/theme.dart'; import 'package:solian/widgets/app_bar_leading.dart'; import 'package:solian/widgets/chat/call/call_controls.dart'; diff --git a/lib/screens/channel/channel_chat.dart b/lib/screens/channel/channel_chat.dart index ad0fa58..92b3ea8 100644 --- a/lib/screens/channel/channel_chat.dart +++ b/lib/screens/channel/channel_chat.dart @@ -11,7 +11,7 @@ import 'package:solian/models/channel.dart'; import 'package:solian/models/event.dart'; import 'package:solian/models/packet.dart'; import 'package:solian/providers/auth.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; import 'package:solian/providers/content/channel.dart'; import 'package:solian/providers/websocket.dart'; import 'package:solian/router.dart'; diff --git a/lib/widgets/account/friend_list.dart b/lib/widgets/account/friend_list.dart deleted file mode 100644 index 59ec07c..0000000 --- a/lib/widgets/account/friend_list.dart +++ /dev/null @@ -1,87 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:solian/models/friendship.dart'; -import 'package:solian/providers/friend.dart'; -import 'package:solian/widgets/account/account_avatar.dart'; -import 'package:solian/widgets/account/account_profile_popup.dart'; - -class SliverFriendList extends StatelessWidget { - final int accountId; - final List items; - final Function onUpdate; - - const SliverFriendList({ - super.key, - required this.accountId, - required this.items, - required this.onUpdate, - }); - - DismissDirection getDismissDirection(Friendship relation) { - if (relation.status == 2) return DismissDirection.endToStart; - if (relation.status == 1) return DismissDirection.startToEnd; - if (relation.status == 0 && relation.relatedId != accountId) { - return DismissDirection.startToEnd; - } - return DismissDirection.horizontal; - } - - Widget buildItem(context, index) { - final element = items[index]; - final otherside = element.getOtherside(accountId); - - final randomId = DateTime.now().microsecondsSinceEpoch >> 10; - - return Dismissible( - key: Key(randomId.toString()), - background: Container( - color: Colors.red, - padding: const EdgeInsets.symmetric(horizontal: 20), - alignment: Alignment.centerLeft, - child: const Icon(Icons.close, color: Colors.white), - ), - secondaryBackground: Container( - color: Colors.green, - padding: const EdgeInsets.symmetric(horizontal: 20), - alignment: Alignment.centerRight, - child: const Icon(Icons.check, color: Colors.white), - ), - direction: getDismissDirection(element), - child: ListTile( - title: Text(otherside.nick), - subtitle: Text(otherside.name), - leading: GestureDetector( - child: AccountAvatar(content: otherside.avatar), - onTap: () { - showModalBottomSheet( - useRootNavigator: true, - isScrollControlled: true, - backgroundColor: Theme.of(context).colorScheme.surface, - context: context, - builder: (context) => AccountProfilePopup( - account: otherside, - ), - ); - }, - ), - ), - onDismissed: (direction) { - final FriendProvider provider = Get.find(); - if (direction == DismissDirection.startToEnd) { - provider.updateFriendship(element, 2).then((_) => onUpdate()); - } - if (direction == DismissDirection.endToStart) { - provider.updateFriendship(element, 1).then((_) => onUpdate()); - } - }, - ); - } - - @override - Widget build(BuildContext context) { - return SliverList.builder( - itemCount: items.length, - itemBuilder: (context, idx) => buildItem(context, idx), - ); - } -} diff --git a/lib/widgets/account/relative_list.dart b/lib/widgets/account/relative_list.dart new file mode 100644 index 0000000..d992157 --- /dev/null +++ b/lib/widgets/account/relative_list.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:solian/models/relations.dart'; +import 'package:solian/providers/relation.dart'; +import 'package:solian/widgets/account/account_avatar.dart'; +import 'package:solian/widgets/account/account_profile_popup.dart'; + +class SilverRelativeList extends StatelessWidget { + final List items; + final Function onUpdate; + final bool isHandleable; + + const SilverRelativeList({ + super.key, + required this.items, + required this.onUpdate, + this.isHandleable = true, + }); + + Widget buildItem(context, index) { + final element = items[index]; + return ListTile( + title: Text(element.related.nick), + subtitle: Text(element.related.name), + leading: GestureDetector( + child: AccountAvatar(content: element.related.avatar), + onTap: () { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: true, + backgroundColor: Theme + .of(context) + .colorScheme + .surface, + context: context, + builder: (context) => + AccountProfilePopup( + account: element.related, + ), + ); + }, + ), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if(element.status != 1 && element.status != 3) + IconButton( + icon: const Icon(Icons.check), + onPressed: () { + final RelationshipProvider provider = Get.find(); + if (element.status == 0) { + provider.handleRelation(element, true).then((_) => onUpdate()); + } else { + provider.editRelation(element, 1).then((_) => onUpdate()); + } + }, + ), + if(element.status != 2 && element.status != 3) + IconButton( + icon: const Icon(Icons.close), + onPressed: () { + final RelationshipProvider provider = Get.find(); + if (element.status == 0) { + provider.handleRelation(element, false).then((_) => onUpdate()); + } else { + provider.editRelation(element, 2).then((_) => onUpdate()); + } + }, + ), + ], + ), + contentPadding: const EdgeInsets.symmetric(horizontal: 24), + ); + } + + @override + Widget build(BuildContext context) { + return SliverList.builder( + itemCount: items.length, + itemBuilder: (context, idx) => buildItem(context, idx), + ); + } +} diff --git a/lib/widgets/account/friend_select.dart b/lib/widgets/account/relative_select.dart similarity index 74% rename from lib/widgets/account/friend_select.dart rename to lib/widgets/account/relative_select.dart index 401bb88..f6cf379 100644 --- a/lib/widgets/account/friend_select.dart +++ b/lib/widgets/account/relative_select.dart @@ -1,39 +1,39 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:solian/models/account.dart'; -import 'package:solian/models/friendship.dart'; +import 'package:solian/models/relations.dart'; import 'package:solian/providers/auth.dart'; -import 'package:solian/providers/friend.dart'; +import 'package:solian/providers/relation.dart'; import 'package:solian/widgets/account/account_avatar.dart'; -class FriendSelect extends StatefulWidget { +class RelativeSelector extends StatefulWidget { final String title; final Widget? Function(Account item)? trailingBuilder; - const FriendSelect({super.key, required this.title, this.trailingBuilder}); + const RelativeSelector({super.key, required this.title, this.trailingBuilder}); @override - State createState() => _FriendSelectState(); + State createState() => _RelativeSelectorState(); } -class _FriendSelectState extends State { +class _RelativeSelectorState extends State { int _accountId = 0; - final List _friends = List.empty(growable: true); + final List _friends = List.empty(growable: true); getFriends() async { final AuthProvider auth = Get.find(); final prof = await auth.getProfile(); _accountId = prof.body['id']; - final FriendProvider provider = Get.find(); - final resp = await provider.listFriendshipWithStatus(1); + final RelationshipProvider provider = Get.find(); + final resp = await provider.listRelationWithStatus(1); setState(() { _friends.addAll(resp.body - .map((e) => Friendship.fromJson(e)) + .map((e) => Relationship.fromJson(e)) .toList() - .cast()); + .cast()); }); } diff --git a/lib/widgets/channel/channel_member.dart b/lib/widgets/channel/channel_member.dart index 81d7b82..f71975d 100644 --- a/lib/widgets/channel/channel_member.dart +++ b/lib/widgets/channel/channel_member.dart @@ -7,7 +7,7 @@ import 'package:solian/providers/auth.dart'; import 'package:solian/services.dart'; import 'package:solian/widgets/account/account_avatar.dart'; import 'package:solian/widgets/account/account_profile_popup.dart'; -import 'package:solian/widgets/account/friend_select.dart'; +import 'package:solian/widgets/account/relative_select.dart'; class ChannelMemberListPopup extends StatefulWidget { final Channel channel; @@ -62,7 +62,7 @@ class _ChannelMemberListPopupState extends State { final input = await showModalBottomSheet( context: context, builder: (context) { - return FriendSelect(title: 'channelMembersAdd'.tr); + return RelativeSelector(title: 'channelMembersAdd'.tr); }, ); if (input == null) return; diff --git a/lib/widgets/chat/call/call_controls.dart b/lib/widgets/chat/call/call_controls.dart index dfebe3e..72a66f1 100644 --- a/lib/widgets/chat/call/call_controls.dart +++ b/lib/widgets/chat/call/call_controls.dart @@ -6,7 +6,7 @@ import 'package:flutter_webrtc/flutter_webrtc.dart'; import 'package:get/get.dart'; import 'package:livekit_client/livekit_client.dart'; import 'package:solian/exts.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; class ControlsWidget extends StatefulWidget { final Room room; diff --git a/lib/widgets/chat/call/call_prejoin.dart b/lib/widgets/chat/call/call_prejoin.dart index ed36399..2dedbbf 100644 --- a/lib/widgets/chat/call/call_prejoin.dart +++ b/lib/widgets/chat/call/call_prejoin.dart @@ -6,7 +6,7 @@ import 'package:solian/exts.dart'; import 'package:solian/models/call.dart'; import 'package:solian/models/channel.dart'; import 'package:solian/providers/auth.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; class ChatCallPrejoinPopup extends StatefulWidget { final Call ongoingCall; diff --git a/lib/widgets/chat/call/chat_call_indicator.dart b/lib/widgets/chat/call/chat_call_indicator.dart index 2efedcb..de62397 100644 --- a/lib/widgets/chat/call/chat_call_indicator.dart +++ b/lib/widgets/chat/call/chat_call_indicator.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:solian/providers/content/call.dart'; +import 'package:solian/providers/call.dart'; class ChatCallCurrentIndicator extends StatelessWidget { const ChatCallCurrentIndicator({super.key}); diff --git a/lib/widgets/realms/realm_member.dart b/lib/widgets/realms/realm_member.dart index 068fe07..d091c01 100644 --- a/lib/widgets/realms/realm_member.dart +++ b/lib/widgets/realms/realm_member.dart @@ -7,7 +7,7 @@ import 'package:solian/providers/auth.dart'; import 'package:solian/services.dart'; import 'package:solian/widgets/account/account_avatar.dart'; import 'package:solian/widgets/account/account_profile_popup.dart'; -import 'package:solian/widgets/account/friend_select.dart'; +import 'package:solian/widgets/account/relative_select.dart'; class RealmMemberListPopup extends StatefulWidget { final Realm realm; @@ -59,7 +59,7 @@ class _RealmMemberListPopupState extends State { final input = await showModalBottomSheet( context: context, builder: (context) { - return FriendSelect(title: 'channelMembersAdd'.tr); + return RelativeSelector(title: 'channelMembersAdd'.tr); }, ); if (input == null) return;