mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-24 23:20:41 +00:00
added release notes dialog to settings
This commit is contained in:
parent
2b600b2b2d
commit
845fa4e79c
1 changed files with 13 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
|
import 'package:lightmeter/screens/shared/release_notes_dialog/widget_dialog_release_notes.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
class VersionListTile extends StatelessWidget {
|
class VersionListTile extends StatelessWidget {
|
||||||
|
@ -7,12 +8,18 @@ class VersionListTile extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return FutureBuilder<PackageInfo>(
|
||||||
leading: const Icon(Icons.info_outline),
|
future: PackageInfo.fromPlatform(),
|
||||||
title: Text(S.of(context).version),
|
builder: (context, snapshot) => ListTile(
|
||||||
trailing: FutureBuilder<PackageInfo>(
|
leading: const Icon(Icons.info_outline),
|
||||||
future: PackageInfo.fromPlatform(),
|
title: Text(S.of(context).version),
|
||||||
builder: (context, snapshot) => snapshot.data != null
|
onTap: snapshot.data != null
|
||||||
|
? () => showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => ReleaseNotesDialog(version: snapshot.data!.version),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
trailing: snapshot.data != null
|
||||||
? Text(S.of(context).versionNumber(snapshot.data!.version, snapshot.data!.buildNumber))
|
? Text(S.of(context).versionNumber(snapshot.data!.version, snapshot.data!.buildNumber))
|
||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue