50 lines
1.6 KiB
Dart
50 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
class AboutScreen extends StatelessWidget {
|
|
const AboutScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('About'),
|
|
),
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Text('SolarAgent',
|
|
style: Theme.of(context).textTheme.headlineMedium),
|
|
Text('Solar Networks Official Mobile Application',
|
|
style: Theme.of(context).textTheme.bodyMedium),
|
|
const SizedBox(height: 20),
|
|
FutureBuilder(
|
|
future: PackageInfo.fromPlatform(),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.hasData) {
|
|
var version = snapshot.data!.version;
|
|
return Text('v$version',
|
|
style: Theme.of(context).textTheme.bodyLarge);
|
|
} else {
|
|
return Container();
|
|
}
|
|
},
|
|
),
|
|
Text('Open sourced under AGPLv3', style: Theme.of(context).textTheme.bodyMedium),
|
|
const SizedBox(height: 10),
|
|
MaterialButton(
|
|
onPressed: () async {
|
|
await launchUrl(Uri.parse('https://solsynth.dev'));
|
|
},
|
|
child: const Text('Official Website'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|