Skip to content

Commit

Permalink
fix(screens): Fix notification bar background color on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Dec 15, 2023
1 parent bb67f17 commit 67f7f0b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 49 deletions.
4 changes: 2 additions & 2 deletions lib/screens/thread/post_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import 'package:universal_html/html.dart' as uh;
import 'package:universal_html/parsing.dart';
import 'package:url_launcher/url_launcher.dart';

const _headerMaxExtent = 60.0;
const _headerMinExtent = 60.0;
const _headerMaxExtent = 100.0;
const _headerMinExtent = 100.0;

// enum _MenuActions {
// refresh,
Expand Down
91 changes: 44 additions & 47 deletions lib/screens/thread/thread_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,58 +71,55 @@ class _ThreadPageState extends ConsumerState<ThreadPage> {
// 2. `title`: Title found in html document.
// 3. `context.t.appName`: Default application name.
// appBar: AppBar(title: Text(widget.title ?? title ?? '')),
body: SafeArea(
child: Column(
children: [
Expanded(
child: PostList<Post>(
widget.threadID,
widget._fetchUrl,
title: widget.title ?? title ?? '',
listBuilder: (document) {
final threadDataNode =
document.querySelector('div#postlist');
if (threadDataNode == null) {
debug('thread postlist not found');
return <Post>[];
}
if (!mounted) {
return <Post>[];
}
body: Column(
children: [
Expanded(
child: PostList<Post>(
widget.threadID,
widget._fetchUrl,
title: widget.title ?? title ?? '',
listBuilder: (document) {
final threadDataNode = document.querySelector('div#postlist');
if (threadDataNode == null) {
debug('thread postlist not found');
return <Post>[];
}
if (!mounted) {
return <Post>[];
}
setState(() {
_hasPost = true;
});

// Sometimes we do not know the web page title outside this widget,
// so here should use the title in html document as fallback.
//
// Note that the specified title (in widget constructor) is prior to
// this html document title, only use html title when that title is null.
if (widget.title == null && mounted) {
setState(() {
_hasPost = true;
title = document.querySelector('title')?.text;
});
}

// Sometimes we do not know the web page title outside this widget,
// so here should use the title in html document as fallback.
//
// Note that the specified title (in widget constructor) is prior to
// this html document title, only use html title when that title is null.
if (widget.title == null && mounted) {
setState(() {
title = document.querySelector('title')?.text;
});
}

return Post.buildListFromThreadDataNode(threadDataNode);
},
widgetBuilder: (context, post) => PostCard(
post,
replyCallback: replyPostCallback,
),
canFetchMorePages: true,
replyFormHashCallback: (replyParameters) {
_replyBarController.replyParameters = replyParameters;
},
useDivider: true,
return Post.buildListFromThreadDataNode(threadDataNode);
},
widgetBuilder: (context, post) => PostCard(
post,
replyCallback: replyPostCallback,
),
canFetchMorePages: true,
replyFormHashCallback: (replyParameters) {
_replyBarController.replyParameters = replyParameters;
},
useDivider: true,
),
if (_hasPost)
ReplyBar(
controller: _replyBarController,
),
],
),
),
if (_hasPost)
ReplyBar(
controller: _replyBarController,
),
],
),
);
}

0 comments on commit 67f7f0b

Please sign in to comment.