mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Separated the build number from version
This commit is contained in:
parent
c4f33e5039
commit
930b223fe8
5 changed files with 222 additions and 32 deletions
|
|
@ -1,37 +1,30 @@
|
|||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'application_info.freezed.dart';
|
||||
|
||||
final applicationInfoProvider = StateProvider<ApplicationInfo>((ref) {
|
||||
return ApplicationInfo(
|
||||
name: "",
|
||||
version: "",
|
||||
buildNumber: "",
|
||||
os: "",
|
||||
);
|
||||
});
|
||||
|
||||
class ApplicationInfo {
|
||||
final String name;
|
||||
final String version;
|
||||
final String os;
|
||||
ApplicationInfo({
|
||||
required this.name,
|
||||
required this.version,
|
||||
required this.os,
|
||||
});
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
class ApplicationInfo with _$ApplicationInfo {
|
||||
const ApplicationInfo._();
|
||||
|
||||
ApplicationInfo copyWith({
|
||||
String? name,
|
||||
String? version,
|
||||
String? os,
|
||||
}) {
|
||||
return ApplicationInfo(
|
||||
name: name ?? this.name,
|
||||
version: version ?? this.version,
|
||||
os: os ?? this.os,
|
||||
);
|
||||
}
|
||||
factory ApplicationInfo({
|
||||
required String name,
|
||||
required String version,
|
||||
required String buildNumber,
|
||||
required String os,
|
||||
}) = _ApplicationInfo;
|
||||
|
||||
String get versionAndPlatform => "$version ($os)";
|
||||
String get versionAndPlatform => "$version ($os)\n#$buildNumber";
|
||||
|
||||
@override
|
||||
String toString() => 'ApplicationInfo(name: $name, version: $version, os: $os)';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue