2024-02-08 12:30:19 +00:00
|
|
|
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: [
|
2024-03-17 12:22:46 +00:00
|
|
|
Text('SolarAgent',
|
2024-02-08 12:30:19 +00:00
|
|
|
style: Theme.of(context).textTheme.headlineMedium),
|
2024-03-17 12:22:46 +00:00
|
|
|
Text('Solarworks Official Mobile Helper',
|
2024-02-08 12:30:19 +00:00
|
|
|
style: Theme.of(context).textTheme.bodyLarge),
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
2024-02-08 12:40:45 +00:00
|
|
|
Text('Open sourced under AGPLv3', style: Theme.of(context).textTheme.bodyMedium),
|
2024-02-08 12:30:19 +00:00
|
|
|
const SizedBox(height: 10),
|
|
|
|
MaterialButton(
|
|
|
|
onPressed: () async {
|
2024-03-17 12:22:46 +00:00
|
|
|
await launchUrl(Uri.parse('https://solsynth.dev'));
|
2024-02-08 12:30:19 +00:00
|
|
|
},
|
|
|
|
child: const Text('Official Website'),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|