Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/package_info_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.1.0

* Update package_info_plus to 9.0.1.
* Update package_info_plus_platform_interface to 3.2.1.
* Add support for `PackageInfo.installTime`.
* Update minimum Flutter and Dart version to 3.19 and 3.3.
* Update the example app and integration_test.

## 1.0.5

* Update the LICENSE file so that it is recognized by pub.dev.
Expand Down
7 changes: 5 additions & 2 deletions packages/package_info_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `package_info_plus`. Therefo

```yaml
dependencies:
package_info_plus: ^8.0.0
package_info_plus_tizen: ^1.0.5
package_info_plus: ^9.0.1
package_info_plus_tizen: ^1.1.0
```

Then you can import `package_info_plus` in your Dart code.
Expand All @@ -30,3 +30,6 @@ For detailed usage, see https://pub.dev/packages/package_info_plus#usage.
- [ ] `PackageInfo.buildNumber`
- [ ] `PackageInfo.buildSignature`
- [ ] `PackageInfo.installerStore`
- [x] `PackageInfo.installTime` // Uses Tizen [`package_info_get_installed_time()`](https://docs.tizen.org/application/native/api/iot-headed/6.0/group__CAPI__PACKAGE__INFO__MODULE.html#gada13d4c9b64e22f1c0a381f80b584835); may reflect last modified time after updates.
- [ ] `PackageInfo.updateTime`

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ void main() {
expect(info.appName, 'package_info_plus_tizen_example');
expect(info.buildNumber, isEmpty);
expect(info.buildSignature, isEmpty);
expect(info.installTime, isNotNull);
expect(info.packageName, 'org.tizen.package_info_plus_tizen_example');
expect(info.updateTime, isNull);
expect(info.version, '1.2.3');
expect(info.installerStore, null);
});
Expand All @@ -30,5 +32,6 @@ void main() {
findsOneWidget,
);
expect(find.text('1.2.3'), findsOneWidget);
expect(find.textContaining('Install time'), findsOneWidget);
});
}
16 changes: 14 additions & 2 deletions packages/package_info_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -30,7 +30,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
const MyHomePage({super.key});

@override
State<MyHomePage> createState() => _MyHomePageState();
Expand All @@ -44,6 +44,8 @@ class _MyHomePageState extends State<MyHomePage> {
buildNumber: 'Unknown',
buildSignature: 'Unknown',
installerStore: 'Unknown',
installTime: null,
updateTime: null,
);

@override
Expand Down Expand Up @@ -84,6 +86,16 @@ class _MyHomePageState extends State<MyHomePage> {
'Installer store',
_packageInfo.installerStore ?? 'not available',
),
_infoTile(
'Install time',
_packageInfo.installTime?.toIso8601String() ??
'Install time not available',
),
_infoTile(
'Update time',
_packageInfo.updateTime?.toIso8601String() ??
'Update time not available',
),
],
),
);
Expand Down
6 changes: 3 additions & 3 deletions packages/package_info_plus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ version: 1.2.3+4
publish_to: "none"

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

dependencies:
flutter:
sdk: flutter
package_info_plus: ^8.0.0
package_info_plus: ^9.0.1
package_info_plus_tizen:
path: ../

Expand Down
10 changes: 5 additions & 5 deletions packages/package_info_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: package_info_plus_tizen
description: Tizen implementation of the package_info_plus plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/package_info_plus
version: 1.0.5
version: 1.1.0

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

flutter:
plugin:
Expand All @@ -18,7 +18,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
package_info_plus_platform_interface: ^3.0.0
package_info_plus_platform_interface: ^3.2.1

dev_dependencies:
flutter_lints: ^2.0.1
flutter_lints: ^5.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ class PackageInfoPlusTizenPlugin : public flutter::Plugin {
map[flutter::EncodableValue("version")] =
flutter::EncodableValue(std::string(version));
free(version);

int installed_time = 0;
ret = package_info_get_installed_time(package_info, &installed_time);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
result->Error(std::to_string(ret),
"Failed to get the package install time.",
flutter::EncodableValue(get_error_message(ret)));
package_info_destroy(package_info);
return;
}
map[flutter::EncodableValue("installTime")] = flutter::EncodableValue(
std::to_string(static_cast<long long>(installed_time) * 1000));

package_info_destroy(package_info);

result->Success(flutter::EncodableValue(map));
Expand Down
Loading