import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:meincantor/const.dart'; import 'package:meincantor/main.dart'; import 'package:url_launcher/url_launcher.dart'; class InfoSettings extends StatelessWidget { const InfoSettings({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Informationen"), centerTitle: true, ), body: ListView( padding: const EdgeInsets.fromLTRB(5, 5, 5, 5), children: [ const ListTile( leading: Icon(Icons.info_outlined), title: Text("Version"), subtitle: Text(version)), ListTile( leading: Icon(Icons.person_outlined), title: Text("Autor"), subtitle: Text(author), onTap: () => launch("https://git.cantorgymnasium.de/denyskon"), ), ListTile( leading: const Icon(Icons.source_outlined), title: const Text("Quellcode"), subtitle: Linkify( onOpen: (link) async { if (await canLaunch(link.url)) { await launch(link.url); } else { throw 'Could not launch $link'; } }, text: "https://git.cantorgymnasium.de/cantortechnik/meincantor-app", linkStyle: const TextStyle(color: Palette.accent), ), ), ListTile( leading: const Icon(Icons.settings_backup_restore_outlined), title: const Text("Änderungsverlauf"), subtitle: const Text("Was ist neu?"), onTap: () { showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext context) { return SizedBox( height: 400, child: Column( children: [ AppBar( title: const Text("Änderungsverlauf"), ), const Padding( padding: EdgeInsets.all(10), child: Text("1.0 --\nErste Release-Version!"), ), ], ), ); }, ); }, ), ListTile( leading: const Icon(Icons.copyright_outlined), title: const Text("Lizenzen"), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => LicensePage( applicationIcon: Image.asset( "assets/images/meincantor_r.png", height: 64, width: 64), applicationVersion: version, )), ); }, ), ], )); } }