|
|
@ -9,7 +9,7 @@ class ProfileTab extends StatelessWidget {
|
|
|
|
static const androidIcon = Icon(Icons.person);
|
|
|
|
static const androidIcon = Icon(Icons.person);
|
|
|
|
static const iosIcon = Icon(CupertinoIcons.profile_circled);
|
|
|
|
static const iosIcon = Icon(CupertinoIcons.profile_circled);
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildBody(context) {
|
|
|
|
Widget _buildBody(BuildContext context) {
|
|
|
|
return SafeArea(
|
|
|
|
return SafeArea(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(24.0),
|
|
|
|
padding: const EdgeInsets.all(24.0),
|
|
|
@ -63,7 +63,7 @@ class ProfileTab extends StatelessWidget {
|
|
|
|
// the profile tab as a button in the nav bar.
|
|
|
|
// the profile tab as a button in the nav bar.
|
|
|
|
// ===========================================================================
|
|
|
|
// ===========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildAndroid(context) {
|
|
|
|
Widget _buildAndroid(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text(title),
|
|
|
|
title: Text(title),
|
|
|
@ -72,7 +72,7 @@ class ProfileTab extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildIos(context) {
|
|
|
|
Widget _buildIos(BuildContext context) {
|
|
|
|
return CupertinoPageScaffold(
|
|
|
|
return CupertinoPageScaffold(
|
|
|
|
navigationBar: CupertinoNavigationBar(
|
|
|
|
navigationBar: CupertinoNavigationBar(
|
|
|
|
trailing: CupertinoButton(
|
|
|
|
trailing: CupertinoButton(
|
|
|
@ -81,7 +81,7 @@ class ProfileTab extends StatelessWidget {
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// This pushes the settings page as a full page modal dialog on top
|
|
|
|
// This pushes the settings page as a full page modal dialog on top
|
|
|
|
// of the tab bar and everything.
|
|
|
|
// of the tab bar and everything.
|
|
|
|
Navigator.of(context, rootNavigator: true).push(
|
|
|
|
Navigator.of(context, rootNavigator: true).push<void>(
|
|
|
|
CupertinoPageRoute(
|
|
|
|
CupertinoPageRoute(
|
|
|
|
title: SettingsTab.title,
|
|
|
|
title: SettingsTab.title,
|
|
|
|
fullscreenDialog: true,
|
|
|
|
fullscreenDialog: true,
|
|
|
@ -172,13 +172,13 @@ class LogOutButton extends StatelessWidget {
|
|
|
|
// app.
|
|
|
|
// app.
|
|
|
|
// ===========================================================================
|
|
|
|
// ===========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildAndroid(context) {
|
|
|
|
Widget _buildAndroid(BuildContext context) {
|
|
|
|
return RaisedButton(
|
|
|
|
return RaisedButton(
|
|
|
|
child: Text('LOG OUT', style: TextStyle(color: Colors.red)),
|
|
|
|
child: Text('LOG OUT', style: TextStyle(color: Colors.red)),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// You should do something with the result of the dialog prompt in a
|
|
|
|
// You should do something with the result of the dialog prompt in a
|
|
|
|
// real app but this is just a demo.
|
|
|
|
// real app but this is just a demo.
|
|
|
|
showDialog(
|
|
|
|
showDialog<void>(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
return AlertDialog(
|
|
|
|
return AlertDialog(
|
|
|
@ -201,14 +201,14 @@ class LogOutButton extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildIos(context) {
|
|
|
|
Widget _buildIos(BuildContext context) {
|
|
|
|
return CupertinoButton(
|
|
|
|
return CupertinoButton(
|
|
|
|
color: CupertinoColors.destructiveRed,
|
|
|
|
color: CupertinoColors.destructiveRed,
|
|
|
|
child: Text('Log out'),
|
|
|
|
child: Text('Log out'),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// You should do something with the result of the action sheet prompt
|
|
|
|
// You should do something with the result of the action sheet prompt
|
|
|
|
// in a real app but this is just a demo.
|
|
|
|
// in a real app but this is just a demo.
|
|
|
|
showCupertinoModalPopup(
|
|
|
|
showCupertinoModalPopup<void>(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
return CupertinoActionSheet(
|
|
|
|
return CupertinoActionSheet(
|
|
|
|