forked from Nexus/nexus
Compare commits
5 changed files with 27 additions and 38 deletions
2
gomuks
2
gomuks
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0e06c7b74f96d3e29a8101893ca1921d13a90573
|
Subproject commit 9444dd293664c300c6e710bb6cddcd9c6cab365d
|
||||||
|
|
@ -2,7 +2,6 @@ import "dart:ffi";
|
||||||
import "dart:io";
|
import "dart:io";
|
||||||
import "dart:isolate";
|
import "dart:isolate";
|
||||||
import "dart:math";
|
import "dart:math";
|
||||||
|
|
||||||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||||
import "package:ffi/ffi.dart";
|
import "package:ffi/ffi.dart";
|
||||||
import "package:flutter/foundation.dart";
|
import "package:flutter/foundation.dart";
|
||||||
|
|
@ -262,13 +261,8 @@ class ClientController extends AsyncNotifier<int> {
|
||||||
Future<Paginate> paginate(PaginateRequest request) async =>
|
Future<Paginate> paginate(PaginateRequest request) async =>
|
||||||
.fromJson(await _sendCommand("paginate", request.toJson()));
|
.fromJson(await _sendCommand("paginate", request.toJson()));
|
||||||
|
|
||||||
Future<ProfileResponse> getProfile(String userId) async {
|
Future<ProfileResponse> getProfile(String userId) async =>
|
||||||
try {
|
.fromJson(await _sendCommand("get_profile", {"user_id": userId}));
|
||||||
return .fromJson(await _sendCommand("get_profile", {"user_id": userId}));
|
|
||||||
} catch (_) {
|
|
||||||
return ProfileResponse(profile: .new(id: userId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> reportEvent(ReportRequest request) =>
|
Future<void> reportEvent(ReportRequest request) =>
|
||||||
_sendCommand("report_event", request.toJson());
|
_sendCommand("report_event", request.toJson());
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ part "profile_response.g.dart";
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ProfileResponse({
|
class const ProfileResponse({
|
||||||
@JsonKey(fromJson: Profile.fromJson) required final Profile profile,
|
@JsonKey(fromJson: Profile.fromJson) required final Profile profile,
|
||||||
final Bio? bio,
|
required final Bio? bio,
|
||||||
}) with _$ProfileResponse {
|
}) with _$ProfileResponse {
|
||||||
Map<String, Object?> toJson() => _$ProfileResponseToJson(this);
|
Map<String, Object?> toJson() => _$ProfileResponseToJson(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,9 @@ class const UrlPreview(final Uri link, {super.key}) extends ConsumerWidget {
|
||||||
Text(
|
Text(
|
||||||
preview.title!,
|
preview.title!,
|
||||||
style: Theme.of(context).textTheme.titleLarge,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
maxLines: 3,
|
|
||||||
overflow: .ellipsis,
|
|
||||||
),
|
),
|
||||||
if (preview.description != null) ...[
|
if (preview.description != null) ...[
|
||||||
Text(
|
Text(preview.description!),
|
||||||
preview.description!,
|
|
||||||
maxLines: 20,
|
|
||||||
overflow: .ellipsis,
|
|
||||||
),
|
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
],
|
],
|
||||||
if (preview.imageUrl != null)
|
if (preview.imageUrl != null)
|
||||||
|
|
|
||||||
|
|
@ -207,14 +207,15 @@ final class const UserBottomSheet(
|
||||||
targetUser: userId,
|
targetUser: userId,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
))
|
) &&
|
||||||
|
member.status == .join ||
|
||||||
|
member.status == .invite)
|
||||||
Padding(
|
Padding(
|
||||||
padding: .only(top: 4),
|
padding: .only(top: 4),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
if (member.status == .join || member.status == .invite)
|
|
||||||
M3EButton.icon(
|
M3EButton.icon(
|
||||||
onPressed: () => showMembershipDialog(.kick),
|
onPressed: () => showMembershipDialog(.kick),
|
||||||
shape: .square,
|
shape: .square,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue