Skip to content

Instantly share code, notes, and snippets.

@xinthink
Created March 5, 2020 09:29
Show Gist options
  • Save xinthink/ea6cab070973d44c2c1bafebaf21b231 to your computer and use it in GitHub Desktop.
Save xinthink/ea6cab070973d44c2c1bafebaf21b231 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
final uid = Provider.of<CurrentUser>(context).data.uid;
return ChangeNotifierProvider.value(
value: _note,
child: Consumer<Note>(
builder: (_, __, ___) => Theme(
data: Theme.of(context).copyWith(
primaryColor: _noteColor,
...
),
child: AnnotatedRegion<SystemUiOverlayStyle>(
// tint the Android system navigation bar
value: SystemUiOverlayStyle.dark.copyWith(
statusBarColor: _noteColor,
systemNavigationBarColor: _noteColor,
systemNavigationBarIconBrightness: Brightness.dark,
),
child: Scaffold(
key: _scaffoldKey,
appBar: AppBar(
actions: _buildTopActions(context, uid),
),
body: WillPopScope(
onWillPop: () => _onPop(uid),
child: _buildBody(context, uid), // textfields for title/content
),
bottomNavigationBar: _buildBottomAppBar(context),
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment