From 8adcd803069d50b40a11360e9aa9084a9aa68f14 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 30 Dec 2024 22:51:47 +0100 Subject: [PATCH] message about --- covas_mobile/lib/classes/MyDrawer.dart | 6 ++++-- covas_mobile/lib/classes/alert.dart | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/covas_mobile/lib/classes/MyDrawer.dart b/covas_mobile/lib/classes/MyDrawer.dart index 4161c00..d8b6748 100644 --- a/covas_mobile/lib/classes/MyDrawer.dart +++ b/covas_mobile/lib/classes/MyDrawer.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; +import 'alert.dart'; -class MyDrawer extends StatelessWidget { +class MyDrawer extends StatelessWidget with ShowAlertDialog { @override Widget build(BuildContext context) { return Drawer( @@ -39,7 +40,8 @@ class MyDrawer extends StatelessWidget { leading: Icon(Icons.info), title: Text('About'), onTap: () { - Navigator.pop(context); // Close the drawer + showAlertDialog( + context, 'About', "Version 0.0.1"); // Close the drawer }, ), ], diff --git a/covas_mobile/lib/classes/alert.dart b/covas_mobile/lib/classes/alert.dart index 28a03e9..ed83093 100644 --- a/covas_mobile/lib/classes/alert.dart +++ b/covas_mobile/lib/classes/alert.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -mixin ShowAlertDialog on State { +mixin ShowAlertDialog { void showAlertDialog(BuildContext context, String title, String text) { // Create AlertDialog AlertDialog dialog = AlertDialog(