Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions lib/feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ class _Feed extends State<Feed> with AutomaticKeepAliveClientMixin<Feed> {
}

buildFeed() {
if (feedData != null) {
return ListView(
children: feedData,
);
} else {
return Container(
alignment: FractionalOffset.center,
child: CircularProgressIndicator());
return ListView(
children: feedData,
);
}
}

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -62,17 +56,13 @@ class _Feed extends State<Feed> with AutomaticKeepAliveClientMixin<Feed> {
SharedPreferences prefs = await SharedPreferences.getInstance();
String json = prefs.getString("feed");

if (json != null) {
List<Map<String, dynamic>> data =
jsonDecode(json).cast<Map<String, dynamic>>();
List<ImagePost> listOfPosts = _generateFeed(data);
setState(() {
feedData = listOfPosts;
});
} else {
_getFeed();
List<Map<String, dynamic>> data =
jsonDecode(json).cast<Map<String, dynamic>>();
List<ImagePost> listOfPosts = _generateFeed(data);
setState(() {
feedData = listOfPosts;
});
}
}

_getFeed() async {
print("Staring getFeed");
Expand Down
4 changes: 0 additions & 4 deletions lib/image_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ class _ImagePost extends State<ImagePost> {
}

buildPostHeader({String ownerId}) {
if (ownerId == null) {
return Text("owner error");
}

return FutureBuilder(
future: FirebaseFirestore.instance
.collection('insta_users')
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class _HomePageState extends State<HomePage> {
silentLogin(context);
}

if (setupNotifications == false && currentUserModel != null) {
if (setupNotifications == false) {
setUpNotifications();
}

Expand All @@ -231,7 +231,7 @@ class _HomePageState extends State<HomePage> {
}
});

return (googleSignIn.currentUser == null || currentUserModel == null)
return (googleSignIn.currentUser == null)
? buildLoginPage()
: Scaffold(
body: PageView(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter application.
version: 1.2.3+1

environment:
sdk: '>=2.10.0 <3.0.0'
sdk: '>=3.4.3 <4.0.0'

dependencies:
flutter:
Expand Down