diff options
| author | Mica White <botahamec@outlook.com> | 2025-12-29 00:13:51 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2025-12-29 00:13:51 -0500 |
| commit | eda099834e8c1cf028cc21d20266fde589fb2ef7 (patch) | |
| tree | 08c4df4708fe834e9baa3bf98b1e3a50f1329f3f | |
| parent | 74f9c14eb1918624725267947e3366b6f465ea0e (diff) | |
Add build date to about
| -rw-r--r-- | lib/about.dart | 41 | ||||
| -rwxr-xr-x | linux/flutter/generated_plugin_registrant.cc | 4 | ||||
| -rwxr-xr-x | linux/flutter/generated_plugins.cmake | 1 | ||||
| -rwxr-xr-x | macos/Flutter/GeneratedPluginRegistrant.swift | 2 | ||||
| -rwxr-xr-x | pubspec.lock | 80 | ||||
| -rwxr-xr-x | pubspec.yaml | 2 | ||||
| -rwxr-xr-x | windows/flutter/generated_plugin_registrant.cc | 3 | ||||
| -rwxr-xr-x | windows/flutter/generated_plugins.cmake | 1 |
8 files changed, 119 insertions, 15 deletions
diff --git a/lib/about.dart b/lib/about.dart index 6e829dc..7dbaaf4 100644 --- a/lib/about.dart +++ b/lib/about.dart @@ -1,3 +1,4 @@ +import 'package:build_info/build_info.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:package_info_plus/package_info_plus.dart'; @@ -11,7 +12,7 @@ class AboutPage extends StatefulWidget { } class _AboutPageState extends State<AboutPage> { - Future<(PackageInfo, String)>? _loadedData; + Future<(PackageInfo, String, BuildInfoData?)>? _loadedData; @override void initState() { @@ -19,7 +20,8 @@ class _AboutPageState extends State<AboutPage> { _loadedData = Future(() async { var packageInfo = await PackageInfo.fromPlatform(); var license = await rootBundle.loadString('LICENSE'); - return (packageInfo, license); + var buildInfo = await BuildInfo.fromPlatform(); + return (packageInfo, license, buildInfo); }); } @@ -50,21 +52,30 @@ class _AboutPageState extends State<AboutPage> { ), FutureBuilder( future: _loadedData, - builder: (context, snapshot) => TextButton.icon( - icon: Icon(Icons.copyright), - label: Text('View licenses'), - onPressed: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => LicensePage( - applicationIcon: Icon(Icons.speed), - applicationName: snapshot.data?.$1.appName, - applicationVersion: snapshot.data?.$1.version, - applicationLegalese: snapshot.data?.$2, + builder: (context, snapshot) { + final appName = snapshot.data?.$1.appName; + final version = snapshot.data?.$1.version; + final legalese = snapshot.data?.$2; + final buildDate = snapshot.data?.$3?.buildDate; + + return TextButton.icon( + icon: Icon(Icons.copyright), + label: Text('View licenses'), + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LicensePage( + applicationIcon: Icon(Icons.speed), + applicationName: appName, + applicationVersion: snapshot.hasData + ? '$version (${buildDate?.year}-${buildDate?.month}-${buildDate?.day})' + : null, + applicationLegalese: legalese, + ), ), ), - ), - ), + ); + }, ), ], ), diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index f6f23bf..6e93894 100755 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,13 @@ #include "generated_plugin_registrant.h" +#include <build_info_linux/build_info_linux_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h> void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) build_info_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "BuildInfoLinuxPlugin"); + build_info_linux_plugin_register_with_registrar(build_info_linux_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f16b4c3..e2aa19b 100755 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + build_info_linux url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index cae8434..d6094b9 100755 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,11 +5,13 @@ import FlutterMacOS import Foundation +import build_info_macos import geolocator_apple import package_info_plus import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + BuildInfoPlugin.register(with: registry.registrar(forPlugin: "BuildInfoPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 90cad5f..e30d5e2 100755 --- a/pubspec.lock +++ b/pubspec.lock @@ -33,6 +33,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + build_info: + dependency: "direct main" + description: + name: build_info + sha256: "4505d9be2619f4e2e2057318e337e942e7884fecff68bf96e3f31f1e40c7c073" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_android: + dependency: transitive + description: + name: build_info_android + sha256: "4456fc1dca26250c09c2a785013568d9e2b4b123990532eb1e0fb7b4f92edbcb" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_ios: + dependency: transitive + description: + name: build_info_ios + sha256: "53ec53920aa86720fd109765978c2975abdeebc818cecefaeb0ff56cb475a78d" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_linux: + dependency: transitive + description: + name: build_info_linux + sha256: cf6cf5064781d6cba57c654be1b506d106087b1c1ee3f394549b49dfd0124f9b + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_macos: + dependency: transitive + description: + name: build_info_macos + sha256: "3393e70bde4845429bb58f329d30a68c1386da10a8239bb25ad361f983f24346" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_platform_interface: + dependency: transitive + description: + name: build_info_platform_interface + sha256: "65a835059475e60fb31eb2941c12e038da44b31968520ab09da7fbcdda76c7f2" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_web: + dependency: transitive + description: + name: build_info_web + sha256: "33ab5c4e2be539bb905783ad79bdb242d65d052d6fb08a512c0f17910a25ccfa" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + build_info_windows: + dependency: transitive + description: + name: build_info_windows + sha256: "407c7ab25b47c31f70cb57b00a3e559b376f34c5dc737dff0a1a2bdc3d222693" + url: "https://pub.dev" + source: hosted + version: "1.1.0" characters: dependency: transitive description: @@ -240,6 +304,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.7.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" json_annotation: dependency: transitive description: @@ -352,6 +424,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.3" + region_settings: + dependency: "direct main" + description: + name: region_settings + sha256: "5d7cf36e613d1248d5998fb6bac74cd6435825cb43e4b4489015834c95bdb5df" + url: "https://pub.dev" + source: hosted + version: "1.5.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 14cd1f1..7b4aa5e 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,10 +9,12 @@ environment: sdk: ^3.9.2
dependencies:
+ build_info: ^1.1.0
flutter:
sdk: flutter
geolocator: ^14.0.2
package_info_plus: ^8.3.1
+ region_settings: ^1.5.0
url_launcher: ^6.3.2
dev_dependencies:
diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 94586cc..82fe8d4 100755 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,10 +6,13 @@ #include "generated_plugin_registrant.h" +#include <build_info_windows/build_info_windows_plugin_c_api.h> #include <geolocator_windows/geolocator_windows.h> #include <url_launcher_windows/url_launcher_windows.h> void RegisterPlugins(flutter::PluginRegistry* registry) { + BuildInfoWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("BuildInfoWindowsPluginCApi")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index f0bcafd..cc1dc0e 100755 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + build_info_windows geolocator_windows url_launcher_windows ) |
