Commit 10ae9018 authored by Erfan Jazeb Nikoo's avatar Erfan Jazeb Nikoo
Browse files

erfan/ui_2

new UI updates
parent ea6db69c
Showing with 50 additions and 32 deletions
+50 -32
......@@ -37,13 +37,12 @@ class _ThreadsScreenState extends State<ThreadsScreen> {
body: Consumer<ThreadProvider>(builder: (context, provider, __) {
var tweet = feed.selectedPost!;
bool isSaved = feed.savedPosts.contains(tweet.id);
bool isLiked = tweet.get('liked') != null && tweet.get('liked') == true;
bool isRetweeted =
tweet.get('retweeted') != null && tweet.get('retweeted') == true;
// bool isLiked = tweet.get('liked') != null && tweet.get('liked') == true;
// bool isRetweeted =
// tweet.get('retweeted') != null && tweet.get('retweeted') == true;
return Container(
decoration: BoxDecoration(
color: app.colors.scaffoldBackground,
border: Border.all(width: 1, color: app.colors.lineDivider),
borderRadius: BorderRadius.vertical(top: Radius.circular(30)),
),
child: Stack(
......@@ -64,32 +63,47 @@ class _ThreadsScreenState extends State<ThreadsScreen> {
),
color: app.colors.white,
),
SizedBox(width: 8),
RoundButton(
onTap: () => provider.openMLFeedback(context, tweet),
icon: app.icons.edit(color: app.colors.white, height: 38),
icon: Row(
children: [
app.icons.edit(color: app.colors.white, height: 38),
SizedBox(width: 5),
Text(
'Edit',
style: app.styles.postBody.copyWith(
color: app.colors.white,
),
),
],
),
padding: EdgeInsets.fromLTRB(
isSaved ? 9.5 : 10, 9.5, isSaved ? 15 : 20, 9.5),
color: app.colors.brandPink,
),
RoundButton(
onTap: () => provider.toggleLikeTweet(tweet),
icon: app.icons.heart(
height: 38,
color: isLiked
? app.colors.brandOrange
: app.colors.white),
color:
isLiked ? app.colors.white : app.colors.brandOrange,
),
RoundButton(
onTap: () => provider.toggleRetweet(tweet),
icon: app.icons.retweet(
height: 38,
color: isRetweeted
? app.colors.brandYellow
: app.colors.white),
color: isRetweeted
? app.colors.white
: app.colors.brandYellow,
),
SizedBox(width: 8),
// RoundButton(
// onTap: () => provider.toggleLikeTweet(tweet),
// icon: app.icons.heart(
// height: 38,
// color: isLiked
// ? app.colors.brandOrange
// : app.colors.white),
// color:
// isLiked ? app.colors.white : app.colors.brandOrange,
// ),
// RoundButton(
// onTap: () => provider.toggleRetweet(tweet),
// icon: app.icons.retweet(
// height: 38,
// color: isRetweeted
// ? app.colors.brandYellow
// : app.colors.white),
// color: isRetweeted
// ? app.colors.white
// : app.colors.brandYellow,
// ),
RoundButton(
onTap: () => provider.savePost(tweet.id),
icon: Row(
......
......@@ -74,8 +74,12 @@ class FeedHelper {
String shortenCategoryName(String categoryName) {
String name = categoryName;
name = name.replaceAll('Technology', 'Tech');
name = name.replaceAll('Business', 'Biz');
name = name.replaceAll('Sports & Gaming', 'Sports & Gaming');
name = name.replaceAll('Science & Technology', 'Science & Tech');
name = name.replaceAll('News & Politics', 'Politics');
name = name.replaceAll('Daily Life', 'Lifestyle');
name = name.replaceAll('Business & Entrepreneurs', 'Business');
name = name.replaceAll('Arts & Culture', 'Culture');
return name;
}
}
......
......@@ -136,8 +136,8 @@ class _FeedBottomNavigationState extends State<FeedBottomNavigation>
feed.subcategories[index],
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: app.styles.headline1
.copyWith(color: app.colors.white),
style: app.styles.headline1.copyWith(
color: app.colors.white, fontSize: 24),
),
),
),
......@@ -185,7 +185,7 @@ class _FeedBottomNavigationState extends State<FeedBottomNavigation>
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: Text(
categoryName,
feed.shortenCategoryName(categoryName),
maxLines: 1,
style: app.styles.headline1.copyWith(
color: selected
......
......@@ -61,7 +61,7 @@ class _SaveBottomNavigationState extends State<SaveBottomNavigation>
itemBuilder: (_, index) {
var categoryName = feed.savedPostsCategories.elementAt(index);
// var cluster = provider.getClusterById(clusterId);
// var categoryName = cluster?.get('category') ?? 'Unassigned';
// var categoryName = cluster?.get('category') ?? 'unassigned';
return InkWell(
onTap: () => provider.selectSavedCategory(index),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment