Skip to content

Commit

Permalink
fix: Fix sample app UI
Browse files Browse the repository at this point in the history
  • Loading branch information
kornsitti committed Aug 15, 2024
1 parent d8e02c4 commit adfd309
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
11 changes: 4 additions & 7 deletions lib/core/widget/community_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ class CommunityWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (amityCommunity.isDeleted ?? false) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(color: Colors.grey.withOpacity(.05)),
child: Text('Community Deleted - ${amityCommunity.communityId}'),
);
}
return StreamBuilder<AmityCommunity>(
stream: amityCommunity.listen.stream,
initialData: amityCommunity,
Expand Down Expand Up @@ -114,6 +107,10 @@ class _CommunityInfoWidget extends StatelessWidget {
'Public: ${amityCommunity.isPublic}',
style: themeData.textTheme.bodySmall,
),
Text(
'isDeleted: ${amityCommunity.isDeleted}',
style: themeData.textTheme.bodySmall,
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,11 @@ class _ChannelProfileScreenState extends State<ChannelProfileScreen>
),
const PopupMenuItem(
value: 2,
child: Text("Delete (Soft)"),
),
const PopupMenuItem(
value: 3,
enabled: false,
child: Text("Delete (Hard)"),
),
const PopupMenuItem(
value: 4,
enabled: true,
child: Text("Check my permission"),
),
PopupMenuItem(
value: 5,
value: 3,
child: Text((_amityChannel.isMuted ?? false)
? 'Unmute'
: 'Mute'),
Expand All @@ -116,11 +107,6 @@ class _ChannelProfileScreenState extends State<ChannelProfileScreen>
queryParams: {'channelId': widget.channelId});
}
if (index == 2) {
//Delete Channel
// AmitySocialClient.newChannelRepository()
// .deleteChannel(widget.channelId);
}
if (index == 4) {
EditTextDialog.show(context,
title:
'Check my permission in this community',
Expand All @@ -145,7 +131,7 @@ class _ChannelProfileScreenState extends State<ChannelProfileScreen>
}
});
}
if (index == 5) {
if (index == 3) {
///Mute/Unmute Channel
if (_amityChannel.isMuted ?? false) {
AmityChatClient.newChannelRepository()
Expand Down
11 changes: 7 additions & 4 deletions lib/presentation/screen/dashboard/dashboard_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';

import 'package:amity_sdk/amity_sdk.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -348,8 +349,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
TextButton(
onPressed: () {
EditTextDialog.show(context,
hintText: 'Enter Channel Name',
buttonText: 'Join', onPress: (value) {
title: 'Go to Chat Screen',
hintText: 'Enter Channel ID',
buttonText: 'Submit', onPress: (value) {
GoRouter.of(context)
.goNamed(AppRoute.chat, params: {'channelId': value});
});
Expand All @@ -360,9 +362,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
TextButton(
onPressed: () {
EditTextDialog.show(context,
hintText: 'Enter Channel Name',
title: 'Get Channel',
hintText: 'Enter Channel ID',
// defString: 'live200',
buttonText: 'Join', onPress: (value) {
buttonText: 'Submit', onPress: (value) {
GoRouter.of(context).pushNamed(AppRoute.channelProfile,
params: {'channelId': value});
// AmityChatClient.newChannelRepository().getChannel(value);
Expand Down

0 comments on commit adfd309

Please sign in to comment.