Skip to content

Commit

Permalink
Merge pull request #9 from Thuenen-Forest-Ecosystems/pages_workflow
Browse files Browse the repository at this point in the history
add version+buildNumber
  • Loading branch information
b-lack authored Sep 17, 2024
2 parents 1acdbff + 0f20ebd commit 30ca0b4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
31 changes: 29 additions & 2 deletions lib/screens/verticalbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,34 @@ import 'package:flutter/material.dart';
import 'package:terrestrial_forest_monitor/providers/map-state.dart';
import 'package:provider/provider.dart';
import 'package:terrestrial_forest_monitor/widgets/map-navigation.dart';
import 'package:package_info_plus/package_info_plus.dart';

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

@override
State<VertialBar> createState() => _VertialBarState();
}

class _VertialBarState extends State<VertialBar> {
PackageInfo? packageInfo;
String version = '';
String buildNumber = '';

@override
void initState() {
super.initState();
_initPackageInfo();
}

Future _initPackageInfo() async {
packageInfo = await PackageInfo.fromPlatform();
setState(() {
version = packageInfo!.version;
buildNumber = packageInfo!.buildNumber;
});
}

@override
Widget build(BuildContext context) {
return Container(
Expand Down Expand Up @@ -43,7 +67,10 @@ class VertialBar extends StatelessWidget {
IconButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(title: const Text('Thünen Institute'), content: const Text('AlertDialog description')),
builder: (BuildContext context) => AlertDialog(
title: const Text('Thünen Institute'),
content: Text('Version: ${'$version+$buildNumber'}'),
),
),
icon: const Icon(
Icons.contact_support,
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import connectivity_plus
import flutter_blue_plus
import flutter_libserialport
import geolocator_apple
import package_info_plus
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
FlutterBluePlusPlugin.register(with: registry.registrar(forPlugin: "FlutterBluePlusPlugin"))
FlutterLibserialportPlugin.register(with: registry.registrar(forPlugin: "FlutterLibserialportPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
24 changes: 24 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918
url: "https://pub.dev"
source: hosted
version: "8.0.2"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66
url: "https://pub.dev"
source: hosted
version: "3.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -1274,6 +1290,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.1"
win32:
dependency: transitive
description:
name: win32
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
url: "https://pub.dev"
source: hosted
version: "5.5.4"
wkt_parser:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies:
hive_flutter: ^1.1.0
libserialport: ^0.3.0+1
nmea: ^3.3.2
package_info_plus: ^8.0.2


#flutter_gen: any
Expand Down

0 comments on commit 30ca0b4

Please sign in to comment.