Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
consumer_app
Commits
10ae9018
Commit
10ae9018
authored
2 years ago
by
Erfan Jazeb Nikoo
Browse files
Options
Download
Email Patches
Plain Diff
erfan/ui_2
new UI updates
parent
ea6db69c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/screens/threads_screen.dart
+40
-26
lib/screens/threads_screen.dart
lib/utilities/helpers/feed_helper.dart
+6
-2
lib/utilities/helpers/feed_helper.dart
lib/widgets/home/feed_bottom_navigation.dart
+3
-3
lib/widgets/home/feed_bottom_navigation.dart
lib/widgets/home/save_bottom_navigation.dart
+1
-1
lib/widgets/home/save_bottom_navigation.dart
with
50 additions
and
32 deletions
+50
-32
lib/screens/threads_screen.dart
+
40
-
26
View file @
10ae9018
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
lib/utilities/helpers/feed_helper.dart
+
6
-
2
View file @
10ae9018
...
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/home/feed_bottom_navigation.dart
+
3
-
3
View file @
10ae9018
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/home/save_bottom_navigation.dart
+
1
-
1
View file @
10ae9018
...
...
@@ -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') ?? '
U
nassigned';
// var categoryName = cluster?.get('category') ?? '
u
nassigned';
return
InkWell
(
onTap:
()
=
>
provider
.
selectSavedCategory
(
index
),
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment