mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-25 15:40:40 +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>(
|
||||||
|
future: PackageInfo.fromPlatform(),
|
||||||
|
builder: (context, snapshot) => ListTile(
|
||||||
leading: const Icon(Icons.info_outline),
|
leading: const Icon(Icons.info_outline),
|
||||||
title: Text(S.of(context).version),
|
title: Text(S.of(context).version),
|
||||||
trailing: FutureBuilder<PackageInfo>(
|
onTap: snapshot.data != null
|
||||||
future: PackageInfo.fromPlatform(),
|
? () => showDialog(
|
||||||
builder: (context, snapshot) => snapshot.data != null
|
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