message about

This commit is contained in:
Valentin CZERYBA 2024-12-30 22:51:47 +01:00
parent 43d77f778b
commit 8adcd80306
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'alert.dart';
class MyDrawer extends StatelessWidget { class MyDrawer extends StatelessWidget with ShowAlertDialog {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Drawer( return Drawer(
@ -39,7 +40,8 @@ class MyDrawer extends StatelessWidget {
leading: Icon(Icons.info), leading: Icon(Icons.info),
title: Text('About'), title: Text('About'),
onTap: () { onTap: () {
Navigator.pop(context); // Close the drawer showAlertDialog(
context, 'About', "Version 0.0.1"); // Close the drawer
}, },
), ),
], ],

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
mixin ShowAlertDialog<T extends StatefulWidget> on State<T> { mixin ShowAlertDialog {
void showAlertDialog(BuildContext context, String title, String text) { void showAlertDialog(BuildContext context, String title, String text) {
// Create AlertDialog // Create AlertDialog
AlertDialog dialog = AlertDialog( AlertDialog dialog = AlertDialog(