Skip to content

Commit

Permalink
added release notes dialog to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vodemn committed May 22, 2024
1 parent 2b600b2 commit 845fa4e
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import 'package:flutter/material.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';

class VersionListTile extends StatelessWidget {
const VersionListTile({super.key});

@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(Icons.info_outline),
title: Text(S.of(context).version),
trailing: FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) => snapshot.data != null
return FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) => ListTile(
leading: const Icon(Icons.info_outline),
title: Text(S.of(context).version),
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))
: const SizedBox.shrink(),
),
Expand Down

0 comments on commit 845fa4e

Please sign in to comment.