mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Add about dialog
This commit is contained in:
parent
302e5f22ce
commit
ec1732088a
@ -90,6 +90,11 @@ class _HomeRouteState extends HomeController {
|
||||
_openAppSettings();
|
||||
break;
|
||||
|
||||
/// Show about dialog
|
||||
case BarCallbackActions.OPEN_ABOUT_DIALOG:
|
||||
showAboutAppDialog(context);
|
||||
break;
|
||||
|
||||
/// Logout user
|
||||
case BarCallbackActions.ACTION_LOGOUT:
|
||||
_logoutRequested();
|
||||
|
@ -18,6 +18,7 @@ enum BarCallbackActions {
|
||||
OPEN_GROUPS,
|
||||
OPEN_GROUP_PAGE,
|
||||
OPEN_APP_SETTINGS,
|
||||
OPEN_ABOUT_DIALOG,
|
||||
NONE,
|
||||
ACTION_LOGOUT
|
||||
}
|
||||
@ -86,6 +87,8 @@ final _menuActionsItem = <_ActionMenuItem>[
|
||||
_ActionMenuItem(label: tr("Groups"), action: BarCallbackActions.OPEN_GROUPS),
|
||||
_ActionMenuItem(
|
||||
label: tr("App settings"), action: BarCallbackActions.OPEN_APP_SETTINGS),
|
||||
_ActionMenuItem(
|
||||
label: tr("About Comunic"), action: BarCallbackActions.OPEN_ABOUT_DIALOG),
|
||||
_ActionMenuItem(
|
||||
label: tr("Sign out"), action: BarCallbackActions.ACTION_LOGOUT),
|
||||
];
|
||||
|
@ -31,10 +31,9 @@ Widget buildLoadingPage({
|
||||
}
|
||||
|
||||
/// Build and return an error card
|
||||
Widget buildErrorCard(String message, {List<Widget> actions, bool hide = false}) {
|
||||
|
||||
if(hide)
|
||||
return Container();
|
||||
Widget buildErrorCard(String message,
|
||||
{List<Widget> actions, bool hide = false}) {
|
||||
if (hide) return Container();
|
||||
|
||||
return Card(
|
||||
elevation: 2.0,
|
||||
@ -190,3 +189,23 @@ const darkerAccentColor = Colors.white30;
|
||||
|
||||
/// Check out whether dark theme is enabled or not
|
||||
bool darkTheme() => preferences().getBool(PreferencesKeyList.ENABLE_DARK_THEME);
|
||||
|
||||
/// Show about Comunic dialog
|
||||
void showAboutAppDialog(BuildContext context) {
|
||||
showAboutDialog(
|
||||
context: context,
|
||||
applicationName: "Comunic",
|
||||
children: <Widget>[
|
||||
Text(
|
||||
tr("Comunic is a free and OpenSource social network that respect your privacy."),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Application built by Pierre Hubert",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user