Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.27 KB | None | 0 0
  1. import 'package:easytickets/src/backend/utils/design/textReferences.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
  4. import 'package:package_info/package_info.dart';
  5.  
  6. class DialogAppInformations {
  7.  
  8.   final Color _colorImage = Color(0xFF121212);
  9.   String _appVersion = "";
  10.  
  11.   Future dialog(BuildContext context) {
  12.     _getAppVersion();
  13.     return showDialog(
  14.         context: context,
  15.         barrierDismissible: true,
  16.         builder: (context) {
  17.           return _showAlertDialog(context);
  18.         }
  19.     );
  20.   }
  21.  
  22.   Widget _showAlertDialog(BuildContext context) {
  23.     return AlertDialog(
  24.         shape: RoundedRectangleBorder(
  25.             borderRadius: BorderRadius.all(
  26.                 Radius.circular(12)
  27.             )
  28.         ),
  29.         title: Text(
  30.             "Informazioni app",
  31.             style: TextReferences().textStyleTitleDialog(),
  32.             softWrap: true
  33.         ),
  34.         content: Container(
  35.           width: MediaQuery.of(context).size.width,
  36.           height: MediaQuery.of(context).size.height / 6,
  37.           child: Column(
  38.             mainAxisAlignment: MainAxisAlignment.start,
  39.             crossAxisAlignment: CrossAxisAlignment.start,
  40.             children: <Widget>[
  41.  
  42.               Row(
  43.                 mainAxisAlignment: MainAxisAlignment.start,
  44.                 crossAxisAlignment: CrossAxisAlignment.center,
  45.                 children: <Widget>[
  46.                   Icon(
  47.                     MdiIcons.informationOutline,
  48.                     color: _colorImage
  49.                   ),
  50.                   SizedBox(width: MediaQuery.of(context).size.width / 20),
  51.                   Text(
  52.                     "Versione app: $_appVersion",
  53.                     style: TextReferences().textStyleAppInformationDialog(),
  54.                     softWrap: true
  55.                   )
  56.                 ],
  57.               ),
  58.  
  59.               SizedBox(height: MediaQuery.of(context).size.height / 70),
  60.  
  61.               Row(
  62.                 mainAxisAlignment: MainAxisAlignment.start,
  63.                 crossAxisAlignment: CrossAxisAlignment.center,
  64.                 children: <Widget>[
  65.                   Icon(
  66.                       MdiIcons.accountOutline,
  67.                       color: _colorImage
  68.                   ),
  69.                   SizedBox(width: MediaQuery.of(context).size.width / 20),
  70.                   Text(
  71.                       "Autore: Luca Del Corona",
  72.                       style: TextReferences().textStyleAppInformationDialog(),
  73.                       softWrap: true
  74.                   )
  75.                 ]
  76.               ),
  77.  
  78.               SizedBox(height: MediaQuery.of(context).size.height / 70),
  79.  
  80.               Row(
  81.                 mainAxisAlignment: MainAxisAlignment.start,
  82.                 crossAxisAlignment: CrossAxisAlignment.center,
  83.                 children: <Widget>[
  84.                   Icon(
  85.                       MdiIcons.accountGroupOutline,
  86.                       color: _colorImage
  87.                   ),
  88.                   SizedBox(width: MediaQuery.of(context).size.width / 20),
  89.                   Text(
  90.                       "Azienda: Infinity Solutions",
  91.                       style: TextReferences().textStyleAppInformationDialog(),
  92.                       softWrap: true
  93.                   )
  94.                 ]
  95.               ),
  96.  
  97.               SizedBox(height: MediaQuery.of(context).size.height / 70),
  98.  
  99.               Row(
  100.                   mainAxisAlignment: MainAxisAlignment.start,
  101.                   crossAxisAlignment: CrossAxisAlignment.center,
  102.                   children: <Widget>[
  103.                     Icon(
  104.                         MdiIcons.copyright,
  105.                         color: _colorImage
  106.                     ),
  107.                     SizedBox(width: MediaQuery.of(context).size.width / 20),
  108.                     Text(
  109.                         "Tutti i diritti sono riservati",
  110.                         style: TextReferences().textStyleAppInformationDialog(),
  111.                         softWrap: true
  112.                     )
  113.                   ]
  114.               )
  115.  
  116.             ]
  117.           )
  118.         )
  119.     );
  120.   }
  121.  
  122.   Future _getAppVersion() async {
  123.     PackageInfo packageInfo = await PackageInfo.fromPlatform();
  124.     _appVersion = packageInfo.version;
  125.   }
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement