Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:easytickets/src/backend/utils/design/textReferences.dart';
- import 'package:flutter/material.dart';
- import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
- import 'package:package_info/package_info.dart';
- class DialogAppInformations {
- final Color _colorImage = Color(0xFF121212);
- String _appVersion = "";
- Future dialog(BuildContext context) {
- _getAppVersion();
- return showDialog(
- context: context,
- barrierDismissible: true,
- builder: (context) {
- return _showAlertDialog(context);
- }
- );
- }
- Widget _showAlertDialog(BuildContext context) {
- return AlertDialog(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.all(
- Radius.circular(12)
- )
- ),
- title: Text(
- "Informazioni app",
- style: TextReferences().textStyleTitleDialog(),
- softWrap: true
- ),
- content: Container(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height / 6,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Icon(
- MdiIcons.informationOutline,
- color: _colorImage
- ),
- SizedBox(width: MediaQuery.of(context).size.width / 20),
- Text(
- "Versione app: $_appVersion",
- style: TextReferences().textStyleAppInformationDialog(),
- softWrap: true
- )
- ],
- ),
- SizedBox(height: MediaQuery.of(context).size.height / 70),
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Icon(
- MdiIcons.accountOutline,
- color: _colorImage
- ),
- SizedBox(width: MediaQuery.of(context).size.width / 20),
- Text(
- "Autore: Luca Del Corona",
- style: TextReferences().textStyleAppInformationDialog(),
- softWrap: true
- )
- ]
- ),
- SizedBox(height: MediaQuery.of(context).size.height / 70),
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Icon(
- MdiIcons.accountGroupOutline,
- color: _colorImage
- ),
- SizedBox(width: MediaQuery.of(context).size.width / 20),
- Text(
- "Azienda: Infinity Solutions",
- style: TextReferences().textStyleAppInformationDialog(),
- softWrap: true
- )
- ]
- ),
- SizedBox(height: MediaQuery.of(context).size.height / 70),
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Icon(
- MdiIcons.copyright,
- color: _colorImage
- ),
- SizedBox(width: MediaQuery.of(context).size.width / 20),
- Text(
- "Tutti i diritti sono riservati",
- style: TextReferences().textStyleAppInformationDialog(),
- softWrap: true
- )
- ]
- )
- ]
- )
- )
- );
- }
- Future _getAppVersion() async {
- PackageInfo packageInfo = await PackageInfo.fromPlatform();
- _appVersion = packageInfo.version;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement