Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit cdb8b6c

Browse files
authored
Merge pull request #535 from OkunaOrg/hotfix/freezing-screen
🐛 fix freezing screen
2 parents 44bf89f + d36b9a7 commit cdb8b6c

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

lib/pages/home/pages/profile/profile.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class OBProfilePageState extends State<OBProfilePage> {
4343
OBPostDisplayContext _postsDisplayContext;
4444

4545
List<Community> _recentlyExcludedCommunities;
46-
GlobalKey<RefreshIndicatorState> _protectedProfileRefreshIndicatorKey = GlobalKey();
46+
GlobalKey<RefreshIndicatorState> _protectedProfileRefreshIndicatorKey =
47+
GlobalKey();
4748
bool _needsProtectedProfileBootstrap;
4849

4950
@override
@@ -77,6 +78,7 @@ class OBProfilePageState extends State<OBProfilePage> {
7778
navigationBar: OBProfileNavBar(_user),
7879
child: OBPrimaryColorContainer(
7980
child: StreamBuilder(
81+
initialData: widget.user,
8082
stream: widget.user.updateSubject,
8183
builder: (BuildContext context, AsyncSnapshot<User> snapshot) {
8284
User user = snapshot.data;
@@ -117,14 +119,13 @@ class OBProfilePageState extends State<OBProfilePage> {
117119
}
118120

119121
Widget _buildProtectedProfileContent() {
120-
if(_needsProtectedProfileBootstrap){
122+
if (_needsProtectedProfileBootstrap) {
121123
Future.delayed(Duration(milliseconds: 100), () {
122124
_protectedProfileRefreshIndicatorKey.currentState.show();
123125
});
124126
_needsProtectedProfileBootstrap = false;
125127
}
126128

127-
128129
List<Widget> profileDetails = _buildProfileContentDetails();
129130

130131
profileDetails.addAll([
@@ -179,13 +180,16 @@ class OBProfilePageState extends State<OBProfilePage> {
179180
StreamBuilder(
180181
stream: widget.user.updateSubject,
181182
builder: (BuildContext context, AsyncSnapshot<User> snapshot) {
182-
if (snapshot.data == null || snapshot.data.isFollowRequested == null) return const SizedBox();
183+
if (snapshot.data == null ||
184+
snapshot.data.isFollowRequested == null)
185+
return const SizedBox();
183186
User user = snapshot.data;
184187
return OBSecondaryText((user.isFollowRequested
185188
? _localizationService
186189
.user__protected_account_instructions_complete
187190
: _localizationService
188-
.user__protected_account_instructions(getFollowButtonText())));
191+
.user__protected_account_instructions(
192+
getFollowButtonText())));
189193
},
190194
),
191195
],
@@ -239,7 +243,7 @@ class OBProfilePageState extends State<OBProfilePage> {
239243
);
240244
}
241245

242-
String getFollowButtonText(){
246+
String getFollowButtonText() {
243247
return widget.user.isFollowed != null && widget.user.isFollowed
244248
? _localizationService.user__follow_button_follow_back_text
245249
: _localizationService.user__follow_button_follow_text;

pubspec.lock

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ packages:
6464
url: "https://pub.dartlang.org"
6565
source: hosted
6666
version: "1.1.3"
67-
clock:
68-
dependency: transitive
69-
description:
70-
name: clock
71-
url: "https://pub.dartlang.org"
72-
source: hosted
73-
version: "1.0.1"
7467
collection:
7568
dependency: transitive
7669
description:
@@ -169,13 +162,6 @@ packages:
169162
url: "https://pub.dartlang.org"
170163
source: hosted
171164
version: "2.2.3"
172-
fake_async:
173-
dependency: transitive
174-
description:
175-
name: fake_async
176-
url: "https://pub.dartlang.org"
177-
source: hosted
178-
version: "1.1.0"
179165
file_picker:
180166
dependency: "direct main"
181167
description:
@@ -377,7 +363,7 @@ packages:
377363
name: intl_translation
378364
url: "https://pub.dartlang.org"
379365
source: hosted
380-
version: "0.17.10"
366+
version: "0.17.9"
381367
inview_notifier_list:
382368
dependency: "direct main"
383369
description:
@@ -498,7 +484,7 @@ packages:
498484
name: path
499485
url: "https://pub.dartlang.org"
500486
source: hosted
501-
version: "1.7.0"
487+
version: "1.6.4"
502488
path_drawing:
503489
dependency: transitive
504490
description:
@@ -547,7 +533,7 @@ packages:
547533
name: petitparser
548534
url: "https://pub.dartlang.org"
549535
source: hosted
550-
version: "3.0.2"
536+
version: "2.4.0"
551537
photo_view:
552538
dependency: "direct main"
553539
description:
@@ -946,7 +932,7 @@ packages:
946932
name: xml
947933
url: "https://pub.dartlang.org"
948934
source: hosted
949-
version: "3.7.0"
935+
version: "3.6.1"
950936
yaml:
951937
dependency: transitive
952938
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dependencies:
7171
image_cropper: 1.1.2
7272
shimmer: ^1.0.0
7373
share: ^0.6.4
74-
path: ^1.7.0
74+
path: ^1.6.4
7575
package_info: ^0.4.0
7676
flutter:
7777
sdk: flutter

0 commit comments

Comments
 (0)