Skip to content

Commit

Permalink
Merge pull request #61 from AmityCo/dev
Browse files Browse the repository at this point in the history
fix top tabbar size
  • Loading branch information
ThanakornThanom authored Oct 24, 2024
2 parents fcdefe8 + 743a4cb commit ded98f4
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 179 deletions.
279 changes: 141 additions & 138 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -549,150 +549,153 @@ class SocialPage extends StatelessWidget {
child: const Text("config"))
],
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ListTile(
title: const Text('Register push notification'),
onTap: () async {},
),
ListTile(
title: const Text('unregister'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
AmityUIKit().unRegisterDevice();
},
),
ListTile(
title: const Text('Custom Post Ranking Feed'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(
body: GlobalFeedScreen(
//isCustomPostRanking: true,
)),
));
},
),
ListTile(
title: const Text('User Profile'),
onTap: () {
// Navigate or perform action based on 'User Profile' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => UserProfileScreen(
amityUserId: username,
amityUser: null,
)));
},
),
ListTile(
title: const Text('Newsfeed'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
const Scaffold(body: GlobalFeedScreen()),
));
},
),
ListTile(
title: const Text('Create Community'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
const Scaffold(body: CreateCommunityPage()),
));
},
),
ListTile(
title: const Text('Create Post'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(body: PostToPage()),
));
},
),
ListTile(
title: const Text('My Community'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(
MaterialPageRoute(
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ListTile(
title: const Text('Register push notification'),
onTap: () async {},
),
ListTile(
title: const Text('unregister'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
AmityUIKit().unRegisterDevice();
},
),
ListTile(
title: const Text('Custom Post Ranking Feed'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(
body: MyCommunityPage(
canCreateCommunity: false,
body: GlobalFeedScreen(
//isCustomPostRanking: true,
)),
));
},
),
ListTile(
title: const Text('User Profile'),
onTap: () {
// Navigate or perform action based on 'User Profile' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => UserProfileScreen(
amityUserId: username,
amityUser: null,
)));
},
),
ListTile(
title: const Text('Newsfeed'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
const Scaffold(body: GlobalFeedScreen()),
));
},
),
ListTile(
title: const Text('Create Community'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) =>
const Scaffold(body: CreateCommunityPage()),
));
},
),
ListTile(
title: const Text('Create Post'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(body: PostToPage()),
));
},
),
ListTile(
title: const Text('My Community'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const Scaffold(
body: MyCommunityPage(
canCreateCommunity: false,
),
),
),
),
);
},
),
ListTile(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Community'),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: TextField(
decoration: const InputDecoration(
labelText: 'Community ID',
border: OutlineInputBorder(),
);
},
),
ListTile(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Community'),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: TextField(
decoration: const InputDecoration(
labelText: 'Community ID',
border: OutlineInputBorder(),
),
onChanged: (value) {
// Handle the community ID input
amityCommunityTextCon.text = value;
},
),
onChanged: (value) {
// Handle the community ID input
amityCommunityTextCon.text = value;
},
),
),
],
],
),
onTap: () async {
CommunityGetQueryBuilder communityGetQueryBuilder =
AmitySocialClient.newCommunityRepository()
.getCommunities();
AmityCommunity amityCommunity = await communityGetQueryBuilder
.useCase.communityRepo
.getCommunity(amityCommunityTextCon.text);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => CommunityScreen(
isFromFeed: true, community: amityCommunity),
),
);
},
),
onTap: () async {
CommunityGetQueryBuilder communityGetQueryBuilder =
AmitySocialClient.newCommunityRepository().getCommunities();
AmityCommunity amityCommunity = await communityGetQueryBuilder
.useCase.communityRepo
.getCommunity(amityCommunityTextCon.text);
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => CommunityScreen(
isFromFeed: true, community: amityCommunity),
),
);
},
),
ListTile(
title: const Text('Explore'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(body: CommunityPage()),
));
},
),
ListTile(
title: const Text('Version 4'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const SampleV4(),
));
},
),
ListTile(
title: const Text('Community v4 compatible'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const AmitySocialV4Compatible(),
));
},
),
],
ListTile(
title: const Text('Explore'),
onTap: () {
// Navigate or perform action based on 'Newsfeed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const Scaffold(body: CommunityPage()),
));
},
),
ListTile(
title: const Text('Version 4'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const SampleV4(),
));
},
),
ListTile(
title: const Text('Community v4 compatible'),
onTap: () {
// Navigate or perform action based on 'Global Feed' tap
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const AmitySocialV4Compatible(),
));
},
),
],
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.5"
version: "3.0.6"
animation_wrappers:
dependency: transitive
description:
Expand Down
61 changes: 21 additions & 40 deletions lib/view/UIKit/social/explore_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,47 +90,28 @@ class _CommunityPageState extends State<CommunityPage> {
},
)
],
bottom: PreferredSize(
preferredSize: const Size.fromHeight(
48.0), // Provide a height for the AppBar's bottom
child: Column(
children: [
Row(
children: [
TabBar(
tabAlignment: TabAlignment.start,
isScrollable:
true, // Ensure that the TabBar is scrollable
dividerColor: Provider.of<AmityUIConfiguration>(context)
.appColors
.baseBackground,
labelColor: Provider.of<AmityUIConfiguration>(context)
.appColors
.primary,
unselectedLabelColor: Colors.grey,
indicatorColor: Provider.of<AmityUIConfiguration>(context)
.appColors
.primary,
labelStyle: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
fontFamily: 'SF Pro Text',
),
tabs: const [
Tab(
text: "Newsfeed",
),
Tab(text: "Explore"),
],
),
],
),
// Divider(
// color: Colors.grey,
// height: 0,
// )
],
bottom: TabBar(
tabAlignment: TabAlignment.start,
isScrollable: true, // Ensure that the TabBar is scrollable
dividerColor: Provider.of<AmityUIConfiguration>(context)
.appColors
.baseBackground,
labelColor:
Provider.of<AmityUIConfiguration>(context).appColors.primary,
unselectedLabelColor: Colors.grey,
indicatorColor:
Provider.of<AmityUIConfiguration>(context).appColors.primary,
labelStyle: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
fontFamily: 'SF Pro Text',
),
tabs: const [
Tab(
text: "Newsfeed",
),
Tab(text: "Explore"),
],
),
),
body: TabBarView(
Expand Down

0 comments on commit ded98f4

Please sign in to comment.