✨ Better post display
🐛 Fix realm with post
This commit is contained in:
@ -15,14 +15,14 @@ import 'package:solian/widgets/channel/channel_list.dart';
|
||||
import 'package:solian/widgets/chat/call/chat_call_indicator.dart';
|
||||
import 'package:solian/widgets/current_state_action.dart';
|
||||
|
||||
class ContactScreen extends StatefulWidget {
|
||||
const ContactScreen({super.key});
|
||||
class ChatScreen extends StatefulWidget {
|
||||
const ChatScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ContactScreen> createState() => _ContactScreenState();
|
||||
State<ChatScreen> createState() => _ChatScreenState();
|
||||
}
|
||||
|
||||
class _ContactScreenState extends State<ContactScreen> {
|
||||
class _ChatScreenState extends State<ChatScreen> {
|
||||
bool _isBusy = true;
|
||||
int? _accountId;
|
||||
|
||||
@ -85,7 +85,7 @@ class _ContactScreenState extends State<ContactScreen> {
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
title: AppBarTitle('contact'.tr),
|
||||
title: AppBarTitle('chat'.tr),
|
||||
centerTitle: false,
|
||||
floating: true,
|
||||
titleSpacing: SolianTheme.titleSpacing(context),
|
@ -50,6 +50,7 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
||||
child: PostItem(
|
||||
item: item!,
|
||||
isClickable: true,
|
||||
isFullDate: true,
|
||||
isShowReply: false,
|
||||
),
|
||||
),
|
||||
|
@ -83,69 +83,67 @@ class _RealmViewScreenState extends State<RealmViewScreen> {
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
child: SafeArea(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
||||
return [
|
||||
SliverOverlapAbsorber(
|
||||
handle:
|
||||
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar(
|
||||
title: Text(_realm?.name ?? 'loading'.tr),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
onPressed: () {
|
||||
AppRouter.instance
|
||||
.pushNamed(
|
||||
'realmDetail',
|
||||
pathParameters: {'alias': widget.alias},
|
||||
extra: _realm,
|
||||
)
|
||||
.then((value) {
|
||||
if (value == false) AppRouter.instance.pop();
|
||||
if (value != null) {
|
||||
final resp =
|
||||
Realm.fromJson(value as Map<String, dynamic>);
|
||||
getRealm(overrideAlias: resp.alias);
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: SolianTheme.isLargeScreen(context) ? 8 : 16,
|
||||
),
|
||||
],
|
||||
bottom: const TabBar(
|
||||
isScrollable: true,
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.feed)),
|
||||
Tab(icon: Icon(Icons.chat)),
|
||||
],
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
||||
return [
|
||||
SliverOverlapAbsorber(
|
||||
handle:
|
||||
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar(
|
||||
title: Text(_realm?.name ?? 'loading'.tr),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
onPressed: () {
|
||||
AppRouter.instance
|
||||
.pushNamed(
|
||||
'realmDetail',
|
||||
pathParameters: {'alias': widget.alias},
|
||||
extra: _realm,
|
||||
)
|
||||
.then((value) {
|
||||
if (value == false) AppRouter.instance.pop();
|
||||
if (value != null) {
|
||||
final resp =
|
||||
Realm.fromJson(value as Map<String, dynamic>);
|
||||
getRealm(overrideAlias: resp.alias);
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
];
|
||||
},
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
if (_isBusy) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
return TabBarView(
|
||||
children: [
|
||||
RealmPostListWidget(realm: _realm!),
|
||||
RealmChannelListWidget(
|
||||
realm: _realm!,
|
||||
channels: _channels,
|
||||
onRefresh: () => getChannels(),
|
||||
SizedBox(
|
||||
width: SolianTheme.isLargeScreen(context) ? 8 : 16,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
bottom: const TabBar(
|
||||
isScrollable: true,
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.feed)),
|
||||
Tab(icon: Icon(Icons.chat)),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
];
|
||||
},
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
if (_isBusy) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
return TabBarView(
|
||||
children: [
|
||||
RealmPostListWidget(realm: _realm!),
|
||||
RealmChannelListWidget(
|
||||
realm: _realm!,
|
||||
channels: _channels,
|
||||
onRefresh: () => getChannels(),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -3,7 +3,6 @@ import 'package:get/get.dart';
|
||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||
import 'package:solian/models/pagination.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
import 'package:solian/platform.dart';
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/providers/content/post.dart';
|
||||
import 'package:solian/router.dart';
|
||||
|
Reference in New Issue
Block a user