diff --git a/lib/app.dart b/lib/app.dart index c4e1a6c..e4e7a72 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -40,7 +40,7 @@ class _AppState extends State with WidgetsBindingObserver { // register global callbacks to the widget tree globalCallbackConnectionState = (update) { - context.read().updateConnectionState(update); + context.read().updateConnectionState(update); setupNotificationWithUsers(); }; @@ -49,6 +49,10 @@ class _AppState extends State with WidgetsBindingObserver { Future initAsync() async { apiProvider.connect(); + final user = await getUser(); + if (user != null && context.mounted) { + context.read().updatePlan(user.subscriptionPlan); + } } @override diff --git a/lib/main.dart b/lib/main.dart index ed366e7..f1ab66f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -43,7 +43,7 @@ void main() async { MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => settingsController), - ChangeNotifierProvider(create: (_) => ConnectionChangeProvider()), + ChangeNotifierProvider(create: (_) => CustomChangeProvider()), ], child: App(), ), diff --git a/lib/src/localization/app_de.arb b/lib/src/localization/app_de.arb index 9ded928..a811b57 100644 --- a/lib/src/localization/app_de.arb +++ b/lib/src/localization/app_de.arb @@ -38,6 +38,8 @@ "@shareImageSearchAllContacts": {}, "searchUsernameInput": "Benutzername", "searchUsernameTitle": "Benutzernamen suchen", + "searchUserNamePreview": "Um dich und andere twonly Benutzer vor Spam und Missbrauch zu schützen, ist es nicht möglich, im Preview-Modus nach anderen Personen zu suchen. Andere Benutzer können dich finden und deren Anfragen werden dann hier angezeigt!", + "selectSubscription": "Abo auswählen", "searchUsernameNotFound": "Benutzername nicht gefunden", "searchUsernameNotFoundBody": "Es wurde kein Benutzer mit dem Benutzernamen \"{username}\" gefunden.", "searchUsernameNewFollowerTitle": "Folgeanfragen", diff --git a/lib/src/localization/app_en.arb b/lib/src/localization/app_en.arb index 4fa0e65..a9445dc 100644 --- a/lib/src/localization/app_en.arb +++ b/lib/src/localization/app_en.arb @@ -79,7 +79,11 @@ "searchUsernameInput": "Username", "@searchUsernameInput": {}, "searchUsernameTitle": "Search username", + "searchUserNamePreview": "To protect you and other twonly users from spam and abuse, it is not possible to search for other people in preview mode. Other users can find you and their requests will be displayed here!", + "@searchUserNamePreview": {}, "@searchUsernameTitle": {}, + "selectSubscription": "Select subscription", + "@selectSubscription": {}, "searchUserNamePending": "Pending", "@searchUserNamePending": {}, "searchUserNameBlockUserTooltip": "Block the user without informing.", diff --git a/lib/src/localization/generated/app_localizations.dart b/lib/src/localization/generated/app_localizations.dart index 60c076c..036b24a 100644 --- a/lib/src/localization/generated/app_localizations.dart +++ b/lib/src/localization/generated/app_localizations.dart @@ -335,6 +335,18 @@ abstract class AppLocalizations { /// **'Search username'** String get searchUsernameTitle; + /// No description provided for @searchUserNamePreview. + /// + /// In en, this message translates to: + /// **'To protect you and other twonly users from spam and abuse, it is not possible to search for other people in preview mode. Other users can find you and their requests will be displayed here!'** + String get searchUserNamePreview; + + /// No description provided for @selectSubscription. + /// + /// In en, this message translates to: + /// **'Select subscription'** + String get selectSubscription; + /// No description provided for @searchUserNamePending. /// /// In en, this message translates to: diff --git a/lib/src/localization/generated/app_localizations_de.dart b/lib/src/localization/generated/app_localizations_de.dart index 4678684..27eeb2a 100644 --- a/lib/src/localization/generated/app_localizations_de.dart +++ b/lib/src/localization/generated/app_localizations_de.dart @@ -128,6 +128,12 @@ class AppLocalizationsDe extends AppLocalizations { @override String get searchUsernameTitle => 'Benutzernamen suchen'; + @override + String get searchUserNamePreview => 'Um dich und andere twonly Benutzer vor Spam und Missbrauch zu schützen, ist es nicht möglich, im Preview-Modus nach anderen Personen zu suchen. Andere Benutzer können dich finden und deren Anfragen werden dann hier angezeigt!'; + + @override + String get selectSubscription => 'Abo auswählen'; + @override String get searchUserNamePending => 'Ausstehend'; diff --git a/lib/src/localization/generated/app_localizations_en.dart b/lib/src/localization/generated/app_localizations_en.dart index 32e4505..ee91792 100644 --- a/lib/src/localization/generated/app_localizations_en.dart +++ b/lib/src/localization/generated/app_localizations_en.dart @@ -128,6 +128,12 @@ class AppLocalizationsEn extends AppLocalizations { @override String get searchUsernameTitle => 'Search username'; + @override + String get searchUserNamePreview => 'To protect you and other twonly users from spam and abuse, it is not possible to search for other people in preview mode. Other users can find you and their requests will be displayed here!'; + + @override + String get selectSubscription => 'Select subscription'; + @override String get searchUserNamePending => 'Pending'; diff --git a/lib/src/model/json/userdata.dart b/lib/src/model/json/userdata.dart index 2c52da5..339bc3d 100644 --- a/lib/src/model/json/userdata.dart +++ b/lib/src/model/json/userdata.dart @@ -4,11 +4,11 @@ part 'userdata.g.dart'; @JsonSerializable() class UserData { - UserData({ - required this.userId, - required this.username, - required this.displayName, - }); + UserData( + {required this.userId, + required this.username, + required this.displayName, + required this.subscriptionPlan}); String username; String displayName; @@ -19,6 +19,8 @@ class UserData { // settings int? defaultShowTime; + @JsonKey(defaultValue: "Preview") + String subscriptionPlan; bool? useHighQuality; List? preSelectedEmojies; ThemeMode? themeMode; diff --git a/lib/src/model/json/userdata.g.dart b/lib/src/model/json/userdata.g.dart index 7c06a10..1f8b170 100644 --- a/lib/src/model/json/userdata.g.dart +++ b/lib/src/model/json/userdata.g.dart @@ -10,6 +10,7 @@ UserData _$UserDataFromJson(Map json) => UserData( userId: (json['userId'] as num).toInt(), username: json['username'] as String, displayName: json['displayName'] as String, + subscriptionPlan: json['subscriptionPlan'] as String? ?? 'Preview', ) ..avatarSvg = json['avatarSvg'] as String? ..avatarJson = json['avatarJson'] as String? @@ -37,6 +38,7 @@ Map _$UserDataToJson(UserData instance) => { 'avatarJson': instance.avatarJson, 'avatarCounter': instance.avatarCounter, 'defaultShowTime': instance.defaultShowTime, + 'subscriptionPlan': instance.subscriptionPlan, 'useHighQuality': instance.useHighQuality, 'preSelectedEmojies': instance.preSelectedEmojies, 'themeMode': _$ThemeModeEnumMap[instance.themeMode], diff --git a/lib/src/model/protobuf/api/client_to_server.pb.dart b/lib/src/model/protobuf/api/client_to_server.pb.dart index 9567941..7c00faa 100644 --- a/lib/src/model/protobuf/api/client_to_server.pb.dart +++ b/lib/src/model/protobuf/api/client_to_server.pb.dart @@ -865,6 +865,170 @@ class ApplicationData_GetUserById extends $pb.GeneratedMessage { void clearUserId() => clearField(1); } +class ApplicationData_RedeemVoucher extends $pb.GeneratedMessage { + factory ApplicationData_RedeemVoucher({ + $core.String? voucher, + }) { + final $result = create(); + if (voucher != null) { + $result.voucher = voucher; + } + return $result; + } + ApplicationData_RedeemVoucher._() : super(); + factory ApplicationData_RedeemVoucher.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_RedeemVoucher.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.RedeemVoucher', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'voucher') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_RedeemVoucher clone() => ApplicationData_RedeemVoucher()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_RedeemVoucher copyWith(void Function(ApplicationData_RedeemVoucher) updates) => super.copyWith((message) => updates(message as ApplicationData_RedeemVoucher)) as ApplicationData_RedeemVoucher; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_RedeemVoucher create() => ApplicationData_RedeemVoucher._(); + ApplicationData_RedeemVoucher createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_RedeemVoucher getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_RedeemVoucher? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get voucher => $_getSZ(0); + @$pb.TagNumber(1) + set voucher($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasVoucher() => $_has(0); + @$pb.TagNumber(1) + void clearVoucher() => clearField(1); +} + +class ApplicationData_SwitchToPayedPlan extends $pb.GeneratedMessage { + factory ApplicationData_SwitchToPayedPlan({ + $core.String? planId, + $core.bool? payMonthly, + }) { + final $result = create(); + if (planId != null) { + $result.planId = planId; + } + if (payMonthly != null) { + $result.payMonthly = payMonthly; + } + return $result; + } + ApplicationData_SwitchToPayedPlan._() : super(); + factory ApplicationData_SwitchToPayedPlan.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_SwitchToPayedPlan.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.SwitchToPayedPlan', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'planId') + ..aOB(2, _omitFieldNames ? '' : 'payMonthly') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_SwitchToPayedPlan clone() => ApplicationData_SwitchToPayedPlan()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_SwitchToPayedPlan copyWith(void Function(ApplicationData_SwitchToPayedPlan) updates) => super.copyWith((message) => updates(message as ApplicationData_SwitchToPayedPlan)) as ApplicationData_SwitchToPayedPlan; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_SwitchToPayedPlan create() => ApplicationData_SwitchToPayedPlan._(); + ApplicationData_SwitchToPayedPlan createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_SwitchToPayedPlan getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_SwitchToPayedPlan? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get planId => $_getSZ(0); + @$pb.TagNumber(1) + set planId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPlanId() => $_has(0); + @$pb.TagNumber(1) + void clearPlanId() => clearField(1); + + @$pb.TagNumber(2) + $core.bool get payMonthly => $_getBF(1); + @$pb.TagNumber(2) + set payMonthly($core.bool v) { $_setBool(1, v); } + @$pb.TagNumber(2) + $core.bool hasPayMonthly() => $_has(1); + @$pb.TagNumber(2) + void clearPayMonthly() => clearField(2); +} + +class ApplicationData_CreateVoucher extends $pb.GeneratedMessage { + factory ApplicationData_CreateVoucher({ + $core.int? valueCents, + }) { + final $result = create(); + if (valueCents != null) { + $result.valueCents = valueCents; + } + return $result; + } + ApplicationData_CreateVoucher._() : super(); + factory ApplicationData_CreateVoucher.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_CreateVoucher.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.CreateVoucher', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..a<$core.int>(1, _omitFieldNames ? '' : 'valueCents', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_CreateVoucher clone() => ApplicationData_CreateVoucher()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_CreateVoucher copyWith(void Function(ApplicationData_CreateVoucher) updates) => super.copyWith((message) => updates(message as ApplicationData_CreateVoucher)) as ApplicationData_CreateVoucher; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_CreateVoucher create() => ApplicationData_CreateVoucher._(); + ApplicationData_CreateVoucher createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_CreateVoucher getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_CreateVoucher? _defaultInstance; + + @$pb.TagNumber(1) + $core.int get valueCents => $_getIZ(0); + @$pb.TagNumber(1) + set valueCents($core.int v) { $_setUnsignedInt32(0, v); } + @$pb.TagNumber(1) + $core.bool hasValueCents() => $_has(0); + @$pb.TagNumber(1) + void clearValueCents() => clearField(1); +} + class ApplicationData_GetLocation extends $pb.GeneratedMessage { factory ApplicationData_GetLocation() => create(); ApplicationData_GetLocation._() : super(); @@ -897,6 +1061,184 @@ class ApplicationData_GetLocation extends $pb.GeneratedMessage { static ApplicationData_GetLocation? _defaultInstance; } +class ApplicationData_GetVouchers extends $pb.GeneratedMessage { + factory ApplicationData_GetVouchers() => create(); + ApplicationData_GetVouchers._() : super(); + factory ApplicationData_GetVouchers.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_GetVouchers.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.GetVouchers', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_GetVouchers clone() => ApplicationData_GetVouchers()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_GetVouchers copyWith(void Function(ApplicationData_GetVouchers) updates) => super.copyWith((message) => updates(message as ApplicationData_GetVouchers)) as ApplicationData_GetVouchers; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_GetVouchers create() => ApplicationData_GetVouchers._(); + ApplicationData_GetVouchers createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_GetVouchers getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_GetVouchers? _defaultInstance; +} + +class ApplicationData_GetAvailablePlans extends $pb.GeneratedMessage { + factory ApplicationData_GetAvailablePlans() => create(); + ApplicationData_GetAvailablePlans._() : super(); + factory ApplicationData_GetAvailablePlans.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_GetAvailablePlans.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.GetAvailablePlans', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_GetAvailablePlans clone() => ApplicationData_GetAvailablePlans()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_GetAvailablePlans copyWith(void Function(ApplicationData_GetAvailablePlans) updates) => super.copyWith((message) => updates(message as ApplicationData_GetAvailablePlans)) as ApplicationData_GetAvailablePlans; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_GetAvailablePlans create() => ApplicationData_GetAvailablePlans._(); + ApplicationData_GetAvailablePlans createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_GetAvailablePlans getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_GetAvailablePlans? _defaultInstance; +} + +class ApplicationData_GetAddAccountsInvites extends $pb.GeneratedMessage { + factory ApplicationData_GetAddAccountsInvites() => create(); + ApplicationData_GetAddAccountsInvites._() : super(); + factory ApplicationData_GetAddAccountsInvites.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_GetAddAccountsInvites.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.GetAddAccountsInvites', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_GetAddAccountsInvites clone() => ApplicationData_GetAddAccountsInvites()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_GetAddAccountsInvites copyWith(void Function(ApplicationData_GetAddAccountsInvites) updates) => super.copyWith((message) => updates(message as ApplicationData_GetAddAccountsInvites)) as ApplicationData_GetAddAccountsInvites; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_GetAddAccountsInvites create() => ApplicationData_GetAddAccountsInvites._(); + ApplicationData_GetAddAccountsInvites createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_GetAddAccountsInvites getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_GetAddAccountsInvites? _defaultInstance; +} + +class ApplicationData_GetCurrentPlanInfos extends $pb.GeneratedMessage { + factory ApplicationData_GetCurrentPlanInfos() => create(); + ApplicationData_GetCurrentPlanInfos._() : super(); + factory ApplicationData_GetCurrentPlanInfos.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_GetCurrentPlanInfos.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.GetCurrentPlanInfos', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_GetCurrentPlanInfos clone() => ApplicationData_GetCurrentPlanInfos()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_GetCurrentPlanInfos copyWith(void Function(ApplicationData_GetCurrentPlanInfos) updates) => super.copyWith((message) => updates(message as ApplicationData_GetCurrentPlanInfos)) as ApplicationData_GetCurrentPlanInfos; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_GetCurrentPlanInfos create() => ApplicationData_GetCurrentPlanInfos._(); + ApplicationData_GetCurrentPlanInfos createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_GetCurrentPlanInfos getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_GetCurrentPlanInfos? _defaultInstance; +} + +class ApplicationData_RedeemAdditionalCode extends $pb.GeneratedMessage { + factory ApplicationData_RedeemAdditionalCode({ + $core.String? inviteCode, + }) { + final $result = create(); + if (inviteCode != null) { + $result.inviteCode = inviteCode; + } + return $result; + } + ApplicationData_RedeemAdditionalCode._() : super(); + factory ApplicationData_RedeemAdditionalCode.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ApplicationData_RedeemAdditionalCode.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData.RedeemAdditionalCode', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) + ..aOS(2, _omitFieldNames ? '' : 'inviteCode') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ApplicationData_RedeemAdditionalCode clone() => ApplicationData_RedeemAdditionalCode()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ApplicationData_RedeemAdditionalCode copyWith(void Function(ApplicationData_RedeemAdditionalCode) updates) => super.copyWith((message) => updates(message as ApplicationData_RedeemAdditionalCode)) as ApplicationData_RedeemAdditionalCode; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ApplicationData_RedeemAdditionalCode create() => ApplicationData_RedeemAdditionalCode._(); + ApplicationData_RedeemAdditionalCode createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ApplicationData_RedeemAdditionalCode getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ApplicationData_RedeemAdditionalCode? _defaultInstance; + + @$pb.TagNumber(2) + $core.String get inviteCode => $_getSZ(0); + @$pb.TagNumber(2) + set inviteCode($core.String v) { $_setString(0, v); } + @$pb.TagNumber(2) + $core.bool hasInviteCode() => $_has(0); + @$pb.TagNumber(2) + void clearInviteCode() => clearField(2); +} + class ApplicationData_GetPrekeysByUserId extends $pb.GeneratedMessage { factory ApplicationData_GetPrekeysByUserId({ $fixnum.Int64? userId, @@ -1163,6 +1505,14 @@ enum ApplicationData_ApplicationData { downloaddata, updategooglefcmtoken, getlocation, + getcurrentplaninfos, + redeemvoucher, + getavailableplans, + createvoucher, + getvouchers, + switchtopayedplan, + getaddaccountsinvites, + redeemadditionalcode, notSet } @@ -1177,6 +1527,14 @@ class ApplicationData extends $pb.GeneratedMessage { ApplicationData_DownloadData? downloaddata, ApplicationData_UpdateGoogleFcmToken? updategooglefcmtoken, ApplicationData_GetLocation? getlocation, + ApplicationData_GetCurrentPlanInfos? getcurrentplaninfos, + ApplicationData_RedeemVoucher? redeemvoucher, + ApplicationData_GetAvailablePlans? getavailableplans, + ApplicationData_CreateVoucher? createvoucher, + ApplicationData_GetVouchers? getvouchers, + ApplicationData_SwitchToPayedPlan? switchtopayedplan, + ApplicationData_GetAddAccountsInvites? getaddaccountsinvites, + ApplicationData_RedeemAdditionalCode? redeemadditionalcode, }) { final $result = create(); if (textmessage != null) { @@ -1206,6 +1564,30 @@ class ApplicationData extends $pb.GeneratedMessage { if (getlocation != null) { $result.getlocation = getlocation; } + if (getcurrentplaninfos != null) { + $result.getcurrentplaninfos = getcurrentplaninfos; + } + if (redeemvoucher != null) { + $result.redeemvoucher = redeemvoucher; + } + if (getavailableplans != null) { + $result.getavailableplans = getavailableplans; + } + if (createvoucher != null) { + $result.createvoucher = createvoucher; + } + if (getvouchers != null) { + $result.getvouchers = getvouchers; + } + if (switchtopayedplan != null) { + $result.switchtopayedplan = switchtopayedplan; + } + if (getaddaccountsinvites != null) { + $result.getaddaccountsinvites = getaddaccountsinvites; + } + if (redeemadditionalcode != null) { + $result.redeemadditionalcode = redeemadditionalcode; + } return $result; } ApplicationData._() : super(); @@ -1222,10 +1604,18 @@ class ApplicationData extends $pb.GeneratedMessage { 7 : ApplicationData_ApplicationData.downloaddata, 8 : ApplicationData_ApplicationData.updategooglefcmtoken, 9 : ApplicationData_ApplicationData.getlocation, + 10 : ApplicationData_ApplicationData.getcurrentplaninfos, + 11 : ApplicationData_ApplicationData.redeemvoucher, + 12 : ApplicationData_ApplicationData.getavailableplans, + 13 : ApplicationData_ApplicationData.createvoucher, + 14 : ApplicationData_ApplicationData.getvouchers, + 15 : ApplicationData_ApplicationData.switchtopayedplan, + 16 : ApplicationData_ApplicationData.getaddaccountsinvites, + 17 : ApplicationData_ApplicationData.redeemadditionalcode, 0 : ApplicationData_ApplicationData.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ApplicationData', package: const $pb.PackageName(_omitMessageNames ? '' : 'client_to_server'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9]) + ..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]) ..aOM(1, _omitFieldNames ? '' : 'textmessage', subBuilder: ApplicationData_TextMessage.create) ..aOM(2, _omitFieldNames ? '' : 'getuserbyusername', subBuilder: ApplicationData_GetUserByUsername.create) ..aOM(3, _omitFieldNames ? '' : 'getprekeysbyuserid', subBuilder: ApplicationData_GetPrekeysByUserId.create) @@ -1235,6 +1625,14 @@ class ApplicationData extends $pb.GeneratedMessage { ..aOM(7, _omitFieldNames ? '' : 'downloaddata', subBuilder: ApplicationData_DownloadData.create) ..aOM(8, _omitFieldNames ? '' : 'updategooglefcmtoken', subBuilder: ApplicationData_UpdateGoogleFcmToken.create) ..aOM(9, _omitFieldNames ? '' : 'getlocation', subBuilder: ApplicationData_GetLocation.create) + ..aOM(10, _omitFieldNames ? '' : 'getcurrentplaninfos', subBuilder: ApplicationData_GetCurrentPlanInfos.create) + ..aOM(11, _omitFieldNames ? '' : 'redeemvoucher', subBuilder: ApplicationData_RedeemVoucher.create) + ..aOM(12, _omitFieldNames ? '' : 'getavailableplans', subBuilder: ApplicationData_GetAvailablePlans.create) + ..aOM(13, _omitFieldNames ? '' : 'createvoucher', subBuilder: ApplicationData_CreateVoucher.create) + ..aOM(14, _omitFieldNames ? '' : 'getvouchers', subBuilder: ApplicationData_GetVouchers.create) + ..aOM(15, _omitFieldNames ? '' : 'Switchtopayedplan', protoName: 'Switchtopayedplan', subBuilder: ApplicationData_SwitchToPayedPlan.create) + ..aOM(16, _omitFieldNames ? '' : 'getaddaccountsinvites', subBuilder: ApplicationData_GetAddAccountsInvites.create) + ..aOM(17, _omitFieldNames ? '' : 'redeemadditionalcode', subBuilder: ApplicationData_RedeemAdditionalCode.create) ..hasRequiredFields = false ; @@ -1360,6 +1758,94 @@ class ApplicationData extends $pb.GeneratedMessage { void clearGetlocation() => clearField(9); @$pb.TagNumber(9) ApplicationData_GetLocation ensureGetlocation() => $_ensure(8); + + @$pb.TagNumber(10) + ApplicationData_GetCurrentPlanInfos get getcurrentplaninfos => $_getN(9); + @$pb.TagNumber(10) + set getcurrentplaninfos(ApplicationData_GetCurrentPlanInfos v) { setField(10, v); } + @$pb.TagNumber(10) + $core.bool hasGetcurrentplaninfos() => $_has(9); + @$pb.TagNumber(10) + void clearGetcurrentplaninfos() => clearField(10); + @$pb.TagNumber(10) + ApplicationData_GetCurrentPlanInfos ensureGetcurrentplaninfos() => $_ensure(9); + + @$pb.TagNumber(11) + ApplicationData_RedeemVoucher get redeemvoucher => $_getN(10); + @$pb.TagNumber(11) + set redeemvoucher(ApplicationData_RedeemVoucher v) { setField(11, v); } + @$pb.TagNumber(11) + $core.bool hasRedeemvoucher() => $_has(10); + @$pb.TagNumber(11) + void clearRedeemvoucher() => clearField(11); + @$pb.TagNumber(11) + ApplicationData_RedeemVoucher ensureRedeemvoucher() => $_ensure(10); + + @$pb.TagNumber(12) + ApplicationData_GetAvailablePlans get getavailableplans => $_getN(11); + @$pb.TagNumber(12) + set getavailableplans(ApplicationData_GetAvailablePlans v) { setField(12, v); } + @$pb.TagNumber(12) + $core.bool hasGetavailableplans() => $_has(11); + @$pb.TagNumber(12) + void clearGetavailableplans() => clearField(12); + @$pb.TagNumber(12) + ApplicationData_GetAvailablePlans ensureGetavailableplans() => $_ensure(11); + + @$pb.TagNumber(13) + ApplicationData_CreateVoucher get createvoucher => $_getN(12); + @$pb.TagNumber(13) + set createvoucher(ApplicationData_CreateVoucher v) { setField(13, v); } + @$pb.TagNumber(13) + $core.bool hasCreatevoucher() => $_has(12); + @$pb.TagNumber(13) + void clearCreatevoucher() => clearField(13); + @$pb.TagNumber(13) + ApplicationData_CreateVoucher ensureCreatevoucher() => $_ensure(12); + + @$pb.TagNumber(14) + ApplicationData_GetVouchers get getvouchers => $_getN(13); + @$pb.TagNumber(14) + set getvouchers(ApplicationData_GetVouchers v) { setField(14, v); } + @$pb.TagNumber(14) + $core.bool hasGetvouchers() => $_has(13); + @$pb.TagNumber(14) + void clearGetvouchers() => clearField(14); + @$pb.TagNumber(14) + ApplicationData_GetVouchers ensureGetvouchers() => $_ensure(13); + + @$pb.TagNumber(15) + ApplicationData_SwitchToPayedPlan get switchtopayedplan => $_getN(14); + @$pb.TagNumber(15) + set switchtopayedplan(ApplicationData_SwitchToPayedPlan v) { setField(15, v); } + @$pb.TagNumber(15) + $core.bool hasSwitchtopayedplan() => $_has(14); + @$pb.TagNumber(15) + void clearSwitchtopayedplan() => clearField(15); + @$pb.TagNumber(15) + ApplicationData_SwitchToPayedPlan ensureSwitchtopayedplan() => $_ensure(14); + + @$pb.TagNumber(16) + ApplicationData_GetAddAccountsInvites get getaddaccountsinvites => $_getN(15); + @$pb.TagNumber(16) + set getaddaccountsinvites(ApplicationData_GetAddAccountsInvites v) { setField(16, v); } + @$pb.TagNumber(16) + $core.bool hasGetaddaccountsinvites() => $_has(15); + @$pb.TagNumber(16) + void clearGetaddaccountsinvites() => clearField(16); + @$pb.TagNumber(16) + ApplicationData_GetAddAccountsInvites ensureGetaddaccountsinvites() => $_ensure(15); + + @$pb.TagNumber(17) + ApplicationData_RedeemAdditionalCode get redeemadditionalcode => $_getN(16); + @$pb.TagNumber(17) + set redeemadditionalcode(ApplicationData_RedeemAdditionalCode v) { setField(17, v); } + @$pb.TagNumber(17) + $core.bool hasRedeemadditionalcode() => $_has(16); + @$pb.TagNumber(17) + void clearRedeemadditionalcode() => clearField(17); + @$pb.TagNumber(17) + ApplicationData_RedeemAdditionalCode ensureRedeemadditionalcode() => $_ensure(16); } class Response_PreKey extends $pb.GeneratedMessage { diff --git a/lib/src/model/protobuf/api/client_to_server.pbjson.dart b/lib/src/model/protobuf/api/client_to_server.pbjson.dart index 016b0e3..0fd9875 100644 --- a/lib/src/model/protobuf/api/client_to_server.pbjson.dart +++ b/lib/src/model/protobuf/api/client_to_server.pbjson.dart @@ -145,8 +145,16 @@ const ApplicationData$json = { {'1': 'downloaddata', '3': 7, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.DownloadData', '9': 0, '10': 'downloaddata'}, {'1': 'updategooglefcmtoken', '3': 8, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.UpdateGoogleFcmToken', '9': 0, '10': 'updategooglefcmtoken'}, {'1': 'getlocation', '3': 9, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.GetLocation', '9': 0, '10': 'getlocation'}, + {'1': 'getcurrentplaninfos', '3': 10, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.GetCurrentPlanInfos', '9': 0, '10': 'getcurrentplaninfos'}, + {'1': 'redeemvoucher', '3': 11, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.RedeemVoucher', '9': 0, '10': 'redeemvoucher'}, + {'1': 'getavailableplans', '3': 12, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.GetAvailablePlans', '9': 0, '10': 'getavailableplans'}, + {'1': 'createvoucher', '3': 13, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.CreateVoucher', '9': 0, '10': 'createvoucher'}, + {'1': 'getvouchers', '3': 14, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.GetVouchers', '9': 0, '10': 'getvouchers'}, + {'1': 'Switchtopayedplan', '3': 15, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.SwitchToPayedPlan', '9': 0, '10': 'Switchtopayedplan'}, + {'1': 'getaddaccountsinvites', '3': 16, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.GetAddAccountsInvites', '9': 0, '10': 'getaddaccountsinvites'}, + {'1': 'redeemadditionalcode', '3': 17, '4': 1, '5': 11, '6': '.client_to_server.ApplicationData.RedeemAdditionalCode', '9': 0, '10': 'redeemadditionalcode'}, ], - '3': [ApplicationData_TextMessage$json, ApplicationData_GetUserByUsername$json, ApplicationData_UpdateGoogleFcmToken$json, ApplicationData_GetUserById$json, ApplicationData_GetLocation$json, ApplicationData_GetPrekeysByUserId$json, ApplicationData_GetUploadToken$json, ApplicationData_UploadData$json, ApplicationData_DownloadData$json], + '3': [ApplicationData_TextMessage$json, ApplicationData_GetUserByUsername$json, ApplicationData_UpdateGoogleFcmToken$json, ApplicationData_GetUserById$json, ApplicationData_RedeemVoucher$json, ApplicationData_SwitchToPayedPlan$json, ApplicationData_CreateVoucher$json, ApplicationData_GetLocation$json, ApplicationData_GetVouchers$json, ApplicationData_GetAvailablePlans$json, ApplicationData_GetAddAccountsInvites$json, ApplicationData_GetCurrentPlanInfos$json, ApplicationData_RedeemAdditionalCode$json, ApplicationData_GetPrekeysByUserId$json, ApplicationData_GetUploadToken$json, ApplicationData_UploadData$json, ApplicationData_DownloadData$json], '8': [ {'1': 'ApplicationData'}, ], @@ -189,11 +197,64 @@ const ApplicationData_GetUserById$json = { ], }; +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_RedeemVoucher$json = { + '1': 'RedeemVoucher', + '2': [ + {'1': 'voucher', '3': 1, '4': 1, '5': 9, '10': 'voucher'}, + ], +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_SwitchToPayedPlan$json = { + '1': 'SwitchToPayedPlan', + '2': [ + {'1': 'plan_id', '3': 1, '4': 1, '5': 9, '10': 'planId'}, + {'1': 'pay_monthly', '3': 2, '4': 1, '5': 8, '10': 'payMonthly'}, + ], +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_CreateVoucher$json = { + '1': 'CreateVoucher', + '2': [ + {'1': 'value_cents', '3': 1, '4': 1, '5': 13, '10': 'valueCents'}, + ], +}; + @$core.Deprecated('Use applicationDataDescriptor instead') const ApplicationData_GetLocation$json = { '1': 'GetLocation', }; +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_GetVouchers$json = { + '1': 'GetVouchers', +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_GetAvailablePlans$json = { + '1': 'GetAvailablePlans', +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_GetAddAccountsInvites$json = { + '1': 'GetAddAccountsInvites', +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_GetCurrentPlanInfos$json = { + '1': 'GetCurrentPlanInfos', +}; + +@$core.Deprecated('Use applicationDataDescriptor instead') +const ApplicationData_RedeemAdditionalCode$json = { + '1': 'RedeemAdditionalCode', + '2': [ + {'1': 'invite_code', '3': 2, '4': 1, '5': 9, '10': 'inviteCode'}, + ], +}; + @$core.Deprecated('Use applicationDataDescriptor instead') const ApplicationData_GetPrekeysByUserId$json = { '1': 'GetPrekeysByUserId', @@ -250,18 +311,38 @@ final $typed_data.Uint8List applicationDataDescriptor = $convert.base64Decode( 'b2tlbhgIIAEoCzI2LmNsaWVudF90b19zZXJ2ZXIuQXBwbGljYXRpb25EYXRhLlVwZGF0ZUdvb2' 'dsZUZjbVRva2VuSABSFHVwZGF0ZWdvb2dsZWZjbXRva2VuElEKC2dldGxvY2F0aW9uGAkgASgL' 'Mi0uY2xpZW50X3RvX3NlcnZlci5BcHBsaWNhdGlvbkRhdGEuR2V0TG9jYXRpb25IAFILZ2V0bG' - '9jYXRpb24aagoLVGV4dE1lc3NhZ2USFwoHdXNlcl9pZBgBIAEoA1IGdXNlcklkEhIKBGJvZHkY' - 'AyABKAxSBGJvZHkSIAoJcHVzaF9kYXRhGAQgASgMSABSCHB1c2hEYXRhiAEBQgwKCl9wdXNoX2' - 'RhdGEaLwoRR2V0VXNlckJ5VXNlcm5hbWUSGgoIdXNlcm5hbWUYASABKAlSCHVzZXJuYW1lGjUK' - 'FFVwZGF0ZUdvb2dsZUZjbVRva2VuEh0KCmdvb2dsZV9mY20YASABKAlSCWdvb2dsZUZjbRomCg' - 'tHZXRVc2VyQnlJZBIXCgd1c2VyX2lkGAEgASgDUgZ1c2VySWQaDQoLR2V0TG9jYXRpb24aLQoS' - 'R2V0UHJla2V5c0J5VXNlcklkEhcKB3VzZXJfaWQYASABKANSBnVzZXJJZBo7Cg5HZXRVcGxvYW' - 'RUb2tlbhIpChByZWNpcGllbnRzX2NvdW50GAEgASgNUg9yZWNpcGllbnRzQ291bnQaiQEKClVw' - 'bG9hZERhdGESIQoMdXBsb2FkX3Rva2VuGAEgASgMUgt1cGxvYWRUb2tlbhIWCg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lvbmFsQ29kZRIfCgtpbnZpdGVfY29kZRgCIAEoCVIKaW52aXRlQ29kZRotChJHZXRQ' + 'cmVrZXlzQnlVc2VySWQSFwoHdXNlcl9pZBgBIAEoA1IGdXNlcklkGjsKDkdldFVwbG9hZFRva2' + 'VuEikKEHJlY2lwaWVudHNfY291bnQYASABKA1SD3JlY2lwaWVudHNDb3VudBqJAQoKVXBsb2Fk' + 'RGF0YRIhCgx1cGxvYWRfdG9rZW4YASABKAxSC3VwbG9hZFRva2VuEhYKBm9mZnNldBgCIAEoDV' + 'IGb2Zmc2V0EhIKBGRhdGEYAyABKAxSBGRhdGESHwoIY2hlY2tzdW0YBCABKAxIAFIIY2hlY2tz' + 'dW2IAQFCCwoJX2NoZWNrc3VtGk0KDERvd25sb2FkRGF0YRIlCg5kb3dubG9hZF90b2tlbhgBIA' + 'EoDFINZG93bmxvYWRUb2tlbhIWCgZvZmZzZXQYAiABKA1SBm9mZnNldEIRCg9BcHBsaWNhdGlv' + 'bkRhdGE='); @$core.Deprecated('Use responseDescriptor instead') const Response$json = { diff --git a/lib/src/model/protobuf/api/error.pbenum.dart b/lib/src/model/protobuf/api/error.pbenum.dart index e098fff..50ddfc2 100644 --- a/lib/src/model/protobuf/api/error.pbenum.dart +++ b/lib/src/model/protobuf/api/error.pbenum.dart @@ -37,6 +37,11 @@ class ErrorCode extends $pb.ProtobufEnum { static const ErrorCode ApiEndpointNotFound = ErrorCode._(1018, _omitEnumNames ? '' : 'ApiEndpointNotFound'); static const ErrorCode AuthTokenNotValid = ErrorCode._(1019, _omitEnumNames ? '' : 'AuthTokenNotValid'); static const ErrorCode InvalidPreKeys = ErrorCode._(1020, _omitEnumNames ? '' : 'InvalidPreKeys'); + static const ErrorCode VoucherInValid = ErrorCode._(1021, _omitEnumNames ? '' : 'VoucherInValid'); + static const ErrorCode PlanNotAllowed = ErrorCode._(1022, _omitEnumNames ? '' : 'PlanNotAllowed'); + static const ErrorCode PlanLimitReached = ErrorCode._(1023, _omitEnumNames ? '' : 'PlanLimitReached'); + static const ErrorCode NotEnoughCredit = ErrorCode._(1024, _omitEnumNames ? '' : 'NotEnoughCredit'); + static const ErrorCode PlanDowngrade = ErrorCode._(1025, _omitEnumNames ? '' : 'PlanDowngrade'); static const $core.List values = [ Unknown, @@ -62,6 +67,11 @@ class ErrorCode extends $pb.ProtobufEnum { ApiEndpointNotFound, AuthTokenNotValid, InvalidPreKeys, + VoucherInValid, + PlanNotAllowed, + PlanLimitReached, + NotEnoughCredit, + PlanDowngrade, ]; static final $core.Map<$core.int, ErrorCode> _byValue = $pb.ProtobufEnum.initByValue(values); diff --git a/lib/src/model/protobuf/api/error.pbjson.dart b/lib/src/model/protobuf/api/error.pbjson.dart index ddf9c07..19b9ee3 100644 --- a/lib/src/model/protobuf/api/error.pbjson.dart +++ b/lib/src/model/protobuf/api/error.pbjson.dart @@ -40,6 +40,11 @@ const ErrorCode$json = { {'1': 'ApiEndpointNotFound', '2': 1018}, {'1': 'AuthTokenNotValid', '2': 1019}, {'1': 'InvalidPreKeys', '2': 1020}, + {'1': 'VoucherInValid', '2': 1021}, + {'1': 'PlanNotAllowed', '2': 1022}, + {'1': 'PlanLimitReached', '2': 1023}, + {'1': 'NotEnoughCredit', '2': 1024}, + {'1': 'PlanDowngrade', '2': 1025}, ], }; @@ -55,5 +60,7 @@ final $typed_data.Uint8List errorCodeDescriptor = $convert.base64Decode( 'V0EPUHEhoKFUludmFsaWRHb29nbGVGY21Ub2tlbhD2BxIZChRVcGxvYWRUb2tlbklzQmxvY2tl' 'ZBD3BxIaChVVcGxvYWRDaGVja3N1bUludmFsaWQQ+AcSGQoUSW52YWxpZERvd25sb2FkVG9rZW' '4Q+QcSGAoTQXBpRW5kcG9pbnROb3RGb3VuZBD6BxIWChFBdXRoVG9rZW5Ob3RWYWxpZBD7BxIT' - 'Cg5JbnZhbGlkUHJlS2V5cxD8Bw=='); + 'Cg5JbnZhbGlkUHJlS2V5cxD8BxITCg5Wb3VjaGVySW5WYWxpZBD9BxITCg5QbGFuTm90QWxsb3' + 'dlZBD+BxIVChBQbGFuTGltaXRSZWFjaGVkEP8HEhQKD05vdEVub3VnaENyZWRpdBCACBISCg1Q' + 'bGFuRG93bmdyYWRlEIEI'); diff --git a/lib/src/model/protobuf/api/server_to_client.pb.dart b/lib/src/model/protobuf/api/server_to_client.pb.dart index d422475..ee1e3d4 100644 --- a/lib/src/model/protobuf/api/server_to_client.pb.dart +++ b/lib/src/model/protobuf/api/server_to_client.pb.dart @@ -384,6 +384,787 @@ class DownloadData extends $pb.GeneratedMessage { void clearFin() => clearField(4); } +class Response_Authenticated extends $pb.GeneratedMessage { + factory Response_Authenticated({ + $core.String? plan, + }) { + final $result = create(); + if (plan != null) { + $result.plan = plan; + } + return $result; + } + Response_Authenticated._() : super(); + factory Response_Authenticated.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Authenticated.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Authenticated', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'plan') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Authenticated clone() => Response_Authenticated()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Authenticated copyWith(void Function(Response_Authenticated) updates) => super.copyWith((message) => updates(message as Response_Authenticated)) as Response_Authenticated; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Authenticated create() => Response_Authenticated._(); + Response_Authenticated createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Authenticated getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Authenticated? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get plan => $_getSZ(0); + @$pb.TagNumber(1) + set plan($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPlan() => $_has(0); + @$pb.TagNumber(1) + void clearPlan() => clearField(1); +} + +class Response_Plan extends $pb.GeneratedMessage { + factory Response_Plan({ + $core.String? planId, + $fixnum.Int64? uploadSizeLimit, + $fixnum.Int64? dailyMediaUploadLimit, + $fixnum.Int64? maximalUploadSizeOfSingleMediaSize, + $fixnum.Int64? additionalPlusAccounts, + $fixnum.Int64? additionalFreeAccounts, + $fixnum.Int64? monthlyCostsCent, + $fixnum.Int64? yearlyCostsCent, + $core.bool? allowedToSendTextMessages, + $core.bool? isAdditionalAccount, + }) { + final $result = create(); + if (planId != null) { + $result.planId = planId; + } + if (uploadSizeLimit != null) { + $result.uploadSizeLimit = uploadSizeLimit; + } + if (dailyMediaUploadLimit != null) { + $result.dailyMediaUploadLimit = dailyMediaUploadLimit; + } + if (maximalUploadSizeOfSingleMediaSize != null) { + $result.maximalUploadSizeOfSingleMediaSize = maximalUploadSizeOfSingleMediaSize; + } + if (additionalPlusAccounts != null) { + $result.additionalPlusAccounts = additionalPlusAccounts; + } + if (additionalFreeAccounts != null) { + $result.additionalFreeAccounts = additionalFreeAccounts; + } + if (monthlyCostsCent != null) { + $result.monthlyCostsCent = monthlyCostsCent; + } + if (yearlyCostsCent != null) { + $result.yearlyCostsCent = yearlyCostsCent; + } + if (allowedToSendTextMessages != null) { + $result.allowedToSendTextMessages = allowedToSendTextMessages; + } + if (isAdditionalAccount != null) { + $result.isAdditionalAccount = isAdditionalAccount; + } + return $result; + } + Response_Plan._() : super(); + factory Response_Plan.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Plan.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Plan', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'planId') + ..aInt64(2, _omitFieldNames ? '' : 'uploadSizeLimit') + ..aInt64(3, _omitFieldNames ? '' : 'dailyMediaUploadLimit') + ..aInt64(4, _omitFieldNames ? '' : 'maximalUploadSizeOfSingleMediaSize') + ..aInt64(5, _omitFieldNames ? '' : 'additionalPlusAccounts') + ..aInt64(6, _omitFieldNames ? '' : 'additionalFreeAccounts') + ..aInt64(7, _omitFieldNames ? '' : 'monthlyCostsCent') + ..aInt64(8, _omitFieldNames ? '' : 'yearlyCostsCent') + ..aOB(9, _omitFieldNames ? '' : 'allowedToSendTextMessages') + ..aOB(10, _omitFieldNames ? '' : 'isAdditionalAccount') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Plan clone() => Response_Plan()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Plan copyWith(void Function(Response_Plan) updates) => super.copyWith((message) => updates(message as Response_Plan)) as Response_Plan; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Plan create() => Response_Plan._(); + Response_Plan createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Plan getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Plan? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get planId => $_getSZ(0); + @$pb.TagNumber(1) + set planId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPlanId() => $_has(0); + @$pb.TagNumber(1) + void clearPlanId() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get uploadSizeLimit => $_getI64(1); + @$pb.TagNumber(2) + set uploadSizeLimit($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasUploadSizeLimit() => $_has(1); + @$pb.TagNumber(2) + void clearUploadSizeLimit() => clearField(2); + + @$pb.TagNumber(3) + $fixnum.Int64 get dailyMediaUploadLimit => $_getI64(2); + @$pb.TagNumber(3) + set dailyMediaUploadLimit($fixnum.Int64 v) { $_setInt64(2, v); } + @$pb.TagNumber(3) + $core.bool hasDailyMediaUploadLimit() => $_has(2); + @$pb.TagNumber(3) + void clearDailyMediaUploadLimit() => clearField(3); + + @$pb.TagNumber(4) + $fixnum.Int64 get maximalUploadSizeOfSingleMediaSize => $_getI64(3); + @$pb.TagNumber(4) + set maximalUploadSizeOfSingleMediaSize($fixnum.Int64 v) { $_setInt64(3, v); } + @$pb.TagNumber(4) + $core.bool hasMaximalUploadSizeOfSingleMediaSize() => $_has(3); + @$pb.TagNumber(4) + void clearMaximalUploadSizeOfSingleMediaSize() => clearField(4); + + @$pb.TagNumber(5) + $fixnum.Int64 get additionalPlusAccounts => $_getI64(4); + @$pb.TagNumber(5) + set additionalPlusAccounts($fixnum.Int64 v) { $_setInt64(4, v); } + @$pb.TagNumber(5) + $core.bool hasAdditionalPlusAccounts() => $_has(4); + @$pb.TagNumber(5) + void clearAdditionalPlusAccounts() => clearField(5); + + @$pb.TagNumber(6) + $fixnum.Int64 get additionalFreeAccounts => $_getI64(5); + @$pb.TagNumber(6) + set additionalFreeAccounts($fixnum.Int64 v) { $_setInt64(5, v); } + @$pb.TagNumber(6) + $core.bool hasAdditionalFreeAccounts() => $_has(5); + @$pb.TagNumber(6) + void clearAdditionalFreeAccounts() => clearField(6); + + @$pb.TagNumber(7) + $fixnum.Int64 get monthlyCostsCent => $_getI64(6); + @$pb.TagNumber(7) + set monthlyCostsCent($fixnum.Int64 v) { $_setInt64(6, v); } + @$pb.TagNumber(7) + $core.bool hasMonthlyCostsCent() => $_has(6); + @$pb.TagNumber(7) + void clearMonthlyCostsCent() => clearField(7); + + @$pb.TagNumber(8) + $fixnum.Int64 get yearlyCostsCent => $_getI64(7); + @$pb.TagNumber(8) + set yearlyCostsCent($fixnum.Int64 v) { $_setInt64(7, v); } + @$pb.TagNumber(8) + $core.bool hasYearlyCostsCent() => $_has(7); + @$pb.TagNumber(8) + void clearYearlyCostsCent() => clearField(8); + + @$pb.TagNumber(9) + $core.bool get allowedToSendTextMessages => $_getBF(8); + @$pb.TagNumber(9) + set allowedToSendTextMessages($core.bool v) { $_setBool(8, v); } + @$pb.TagNumber(9) + $core.bool hasAllowedToSendTextMessages() => $_has(8); + @$pb.TagNumber(9) + void clearAllowedToSendTextMessages() => clearField(9); + + @$pb.TagNumber(10) + $core.bool get isAdditionalAccount => $_getBF(9); + @$pb.TagNumber(10) + set isAdditionalAccount($core.bool v) { $_setBool(9, v); } + @$pb.TagNumber(10) + $core.bool hasIsAdditionalAccount() => $_has(9); + @$pb.TagNumber(10) + void clearIsAdditionalAccount() => clearField(10); +} + +class Response_Plans extends $pb.GeneratedMessage { + factory Response_Plans({ + $core.Iterable? plans, + }) { + final $result = create(); + if (plans != null) { + $result.plans.addAll(plans); + } + return $result; + } + Response_Plans._() : super(); + factory Response_Plans.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Plans.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Plans', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'plans', $pb.PbFieldType.PM, subBuilder: Response_Plan.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Plans clone() => Response_Plans()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Plans copyWith(void Function(Response_Plans) updates) => super.copyWith((message) => updates(message as Response_Plans)) as Response_Plans; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Plans create() => Response_Plans._(); + Response_Plans createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Plans getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Plans? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get plans => $_getList(0); +} + +class Response_AddAccountsInvite extends $pb.GeneratedMessage { + factory Response_AddAccountsInvite({ + $core.String? planId, + $core.String? inviteCode, + }) { + final $result = create(); + if (planId != null) { + $result.planId = planId; + } + if (inviteCode != null) { + $result.inviteCode = inviteCode; + } + return $result; + } + Response_AddAccountsInvite._() : super(); + factory Response_AddAccountsInvite.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_AddAccountsInvite.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.AddAccountsInvite', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'planId') + ..aOS(2, _omitFieldNames ? '' : 'inviteCode') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_AddAccountsInvite clone() => Response_AddAccountsInvite()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_AddAccountsInvite copyWith(void Function(Response_AddAccountsInvite) updates) => super.copyWith((message) => updates(message as Response_AddAccountsInvite)) as Response_AddAccountsInvite; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_AddAccountsInvite create() => Response_AddAccountsInvite._(); + Response_AddAccountsInvite createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_AddAccountsInvite getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_AddAccountsInvite? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get planId => $_getSZ(0); + @$pb.TagNumber(1) + set planId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPlanId() => $_has(0); + @$pb.TagNumber(1) + void clearPlanId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get inviteCode => $_getSZ(1); + @$pb.TagNumber(2) + set inviteCode($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasInviteCode() => $_has(1); + @$pb.TagNumber(2) + void clearInviteCode() => clearField(2); +} + +class Response_AddAccountsInvites extends $pb.GeneratedMessage { + factory Response_AddAccountsInvites({ + $core.Iterable? invites, + }) { + final $result = create(); + if (invites != null) { + $result.invites.addAll(invites); + } + return $result; + } + Response_AddAccountsInvites._() : super(); + factory Response_AddAccountsInvites.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_AddAccountsInvites.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.AddAccountsInvites', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'invites', $pb.PbFieldType.PM, subBuilder: Response_AddAccountsInvite.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_AddAccountsInvites clone() => Response_AddAccountsInvites()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_AddAccountsInvites copyWith(void Function(Response_AddAccountsInvites) updates) => super.copyWith((message) => updates(message as Response_AddAccountsInvites)) as Response_AddAccountsInvites; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_AddAccountsInvites create() => Response_AddAccountsInvites._(); + Response_AddAccountsInvites createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_AddAccountsInvites getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_AddAccountsInvites? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get invites => $_getList(0); +} + +class Response_Transaction extends $pb.GeneratedMessage { + factory Response_Transaction({ + $fixnum.Int64? depositCents, + $core.String? transactionType, + $fixnum.Int64? createdAtUnixTimestamp, + }) { + final $result = create(); + if (depositCents != null) { + $result.depositCents = depositCents; + } + if (transactionType != null) { + $result.transactionType = transactionType; + } + if (createdAtUnixTimestamp != null) { + $result.createdAtUnixTimestamp = createdAtUnixTimestamp; + } + return $result; + } + Response_Transaction._() : super(); + factory Response_Transaction.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Transaction.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Transaction', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aInt64(1, _omitFieldNames ? '' : 'depositCents') + ..aOS(2, _omitFieldNames ? '' : 'transactionType') + ..aInt64(3, _omitFieldNames ? '' : 'createdAtUnixTimestamp') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Transaction clone() => Response_Transaction()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Transaction copyWith(void Function(Response_Transaction) updates) => super.copyWith((message) => updates(message as Response_Transaction)) as Response_Transaction; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Transaction create() => Response_Transaction._(); + Response_Transaction createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Transaction getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Transaction? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get depositCents => $_getI64(0); + @$pb.TagNumber(1) + set depositCents($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasDepositCents() => $_has(0); + @$pb.TagNumber(1) + void clearDepositCents() => clearField(1); + + @$pb.TagNumber(2) + $core.String get transactionType => $_getSZ(1); + @$pb.TagNumber(2) + set transactionType($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasTransactionType() => $_has(1); + @$pb.TagNumber(2) + void clearTransactionType() => clearField(2); + + /// Represents seconds of UTC time since Unix epoch + /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + /// 9999-12-31T23:59:59Z inclusive. + @$pb.TagNumber(3) + $fixnum.Int64 get createdAtUnixTimestamp => $_getI64(2); + @$pb.TagNumber(3) + set createdAtUnixTimestamp($fixnum.Int64 v) { $_setInt64(2, v); } + @$pb.TagNumber(3) + $core.bool hasCreatedAtUnixTimestamp() => $_has(2); + @$pb.TagNumber(3) + void clearCreatedAtUnixTimestamp() => clearField(3); +} + +class Response_AdditionalAccount extends $pb.GeneratedMessage { + factory Response_AdditionalAccount({ + $fixnum.Int64? userId, + $core.String? planId, + }) { + final $result = create(); + if (userId != null) { + $result.userId = userId; + } + if (planId != null) { + $result.planId = planId; + } + return $result; + } + Response_AdditionalAccount._() : super(); + factory Response_AdditionalAccount.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_AdditionalAccount.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.AdditionalAccount', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aInt64(1, _omitFieldNames ? '' : 'userId') + ..aOS(3, _omitFieldNames ? '' : 'planId') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_AdditionalAccount clone() => Response_AdditionalAccount()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_AdditionalAccount copyWith(void Function(Response_AdditionalAccount) updates) => super.copyWith((message) => updates(message as Response_AdditionalAccount)) as Response_AdditionalAccount; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_AdditionalAccount create() => Response_AdditionalAccount._(); + Response_AdditionalAccount createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_AdditionalAccount getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_AdditionalAccount? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get userId => $_getI64(0); + @$pb.TagNumber(1) + set userId($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasUserId() => $_has(0); + @$pb.TagNumber(1) + void clearUserId() => clearField(1); + + @$pb.TagNumber(3) + $core.String get planId => $_getSZ(1); + @$pb.TagNumber(3) + set planId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(3) + $core.bool hasPlanId() => $_has(1); + @$pb.TagNumber(3) + void clearPlanId() => clearField(3); +} + +class Response_Voucher extends $pb.GeneratedMessage { + factory Response_Voucher({ + $core.String? voucherId, + $fixnum.Int64? valueCents, + $core.bool? redeemed, + $core.bool? requested, + $fixnum.Int64? createdAtUnixTimestamp, + }) { + final $result = create(); + if (voucherId != null) { + $result.voucherId = voucherId; + } + if (valueCents != null) { + $result.valueCents = valueCents; + } + if (redeemed != null) { + $result.redeemed = redeemed; + } + if (requested != null) { + $result.requested = requested; + } + if (createdAtUnixTimestamp != null) { + $result.createdAtUnixTimestamp = createdAtUnixTimestamp; + } + return $result; + } + Response_Voucher._() : super(); + factory Response_Voucher.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Voucher.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Voucher', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'voucherId') + ..aInt64(2, _omitFieldNames ? '' : 'valueCents') + ..aOB(3, _omitFieldNames ? '' : 'redeemed') + ..aOB(4, _omitFieldNames ? '' : 'requested') + ..aInt64(5, _omitFieldNames ? '' : 'createdAtUnixTimestamp') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Voucher clone() => Response_Voucher()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Voucher copyWith(void Function(Response_Voucher) updates) => super.copyWith((message) => updates(message as Response_Voucher)) as Response_Voucher; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Voucher create() => Response_Voucher._(); + Response_Voucher createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Voucher getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Voucher? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get voucherId => $_getSZ(0); + @$pb.TagNumber(1) + set voucherId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasVoucherId() => $_has(0); + @$pb.TagNumber(1) + void clearVoucherId() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get valueCents => $_getI64(1); + @$pb.TagNumber(2) + set valueCents($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasValueCents() => $_has(1); + @$pb.TagNumber(2) + void clearValueCents() => clearField(2); + + @$pb.TagNumber(3) + $core.bool get redeemed => $_getBF(2); + @$pb.TagNumber(3) + set redeemed($core.bool v) { $_setBool(2, v); } + @$pb.TagNumber(3) + $core.bool hasRedeemed() => $_has(2); + @$pb.TagNumber(3) + void clearRedeemed() => clearField(3); + + @$pb.TagNumber(4) + $core.bool get requested => $_getBF(3); + @$pb.TagNumber(4) + set requested($core.bool v) { $_setBool(3, v); } + @$pb.TagNumber(4) + $core.bool hasRequested() => $_has(3); + @$pb.TagNumber(4) + void clearRequested() => clearField(4); + + @$pb.TagNumber(5) + $fixnum.Int64 get createdAtUnixTimestamp => $_getI64(4); + @$pb.TagNumber(5) + set createdAtUnixTimestamp($fixnum.Int64 v) { $_setInt64(4, v); } + @$pb.TagNumber(5) + $core.bool hasCreatedAtUnixTimestamp() => $_has(4); + @$pb.TagNumber(5) + void clearCreatedAtUnixTimestamp() => clearField(5); +} + +class Response_Vouchers extends $pb.GeneratedMessage { + factory Response_Vouchers({ + $core.Iterable? vouchers, + }) { + final $result = create(); + if (vouchers != null) { + $result.vouchers.addAll(vouchers); + } + return $result; + } + Response_Vouchers._() : super(); + factory Response_Vouchers.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_Vouchers.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Vouchers', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'vouchers', $pb.PbFieldType.PM, subBuilder: Response_Voucher.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_Vouchers clone() => Response_Vouchers()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_Vouchers copyWith(void Function(Response_Vouchers) updates) => super.copyWith((message) => updates(message as Response_Vouchers)) as Response_Vouchers; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_Vouchers create() => Response_Vouchers._(); + Response_Vouchers createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_Vouchers getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_Vouchers? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get vouchers => $_getList(0); +} + +class Response_PlanBallance extends $pb.GeneratedMessage { + factory Response_PlanBallance({ + $fixnum.Int64? usedDailyMediaUploadLimit, + $fixnum.Int64? usedUploadMediaSizeLimit, + $fixnum.Int64? paymentPeriodDays, + $fixnum.Int64? lastPaymentDoneUnixTimestamp, + $core.Iterable? transactions, + $core.Iterable? additionalAccounts, + }) { + final $result = create(); + if (usedDailyMediaUploadLimit != null) { + $result.usedDailyMediaUploadLimit = usedDailyMediaUploadLimit; + } + if (usedUploadMediaSizeLimit != null) { + $result.usedUploadMediaSizeLimit = usedUploadMediaSizeLimit; + } + if (paymentPeriodDays != null) { + $result.paymentPeriodDays = paymentPeriodDays; + } + if (lastPaymentDoneUnixTimestamp != null) { + $result.lastPaymentDoneUnixTimestamp = lastPaymentDoneUnixTimestamp; + } + if (transactions != null) { + $result.transactions.addAll(transactions); + } + if (additionalAccounts != null) { + $result.additionalAccounts.addAll(additionalAccounts); + } + return $result; + } + Response_PlanBallance._() : super(); + factory Response_PlanBallance.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Response_PlanBallance.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.PlanBallance', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) + ..aInt64(1, _omitFieldNames ? '' : 'usedDailyMediaUploadLimit') + ..aInt64(2, _omitFieldNames ? '' : 'usedUploadMediaSizeLimit') + ..aInt64(3, _omitFieldNames ? '' : 'paymentPeriodDays') + ..aInt64(4, _omitFieldNames ? '' : 'lastPaymentDoneUnixTimestamp') + ..pc(5, _omitFieldNames ? '' : 'transactions', $pb.PbFieldType.PM, subBuilder: Response_Transaction.create) + ..pc(6, _omitFieldNames ? '' : 'additionalAccounts', $pb.PbFieldType.PM, subBuilder: Response_AdditionalAccount.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Response_PlanBallance clone() => Response_PlanBallance()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Response_PlanBallance copyWith(void Function(Response_PlanBallance) updates) => super.copyWith((message) => updates(message as Response_PlanBallance)) as Response_PlanBallance; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Response_PlanBallance create() => Response_PlanBallance._(); + Response_PlanBallance createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Response_PlanBallance getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Response_PlanBallance? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get usedDailyMediaUploadLimit => $_getI64(0); + @$pb.TagNumber(1) + set usedDailyMediaUploadLimit($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasUsedDailyMediaUploadLimit() => $_has(0); + @$pb.TagNumber(1) + void clearUsedDailyMediaUploadLimit() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get usedUploadMediaSizeLimit => $_getI64(1); + @$pb.TagNumber(2) + set usedUploadMediaSizeLimit($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasUsedUploadMediaSizeLimit() => $_has(1); + @$pb.TagNumber(2) + void clearUsedUploadMediaSizeLimit() => clearField(2); + + @$pb.TagNumber(3) + $fixnum.Int64 get paymentPeriodDays => $_getI64(2); + @$pb.TagNumber(3) + set paymentPeriodDays($fixnum.Int64 v) { $_setInt64(2, v); } + @$pb.TagNumber(3) + $core.bool hasPaymentPeriodDays() => $_has(2); + @$pb.TagNumber(3) + void clearPaymentPeriodDays() => clearField(3); + + @$pb.TagNumber(4) + $fixnum.Int64 get lastPaymentDoneUnixTimestamp => $_getI64(3); + @$pb.TagNumber(4) + set lastPaymentDoneUnixTimestamp($fixnum.Int64 v) { $_setInt64(3, v); } + @$pb.TagNumber(4) + $core.bool hasLastPaymentDoneUnixTimestamp() => $_has(3); + @$pb.TagNumber(4) + void clearLastPaymentDoneUnixTimestamp() => clearField(4); + + @$pb.TagNumber(5) + $core.List get transactions => $_getList(4); + + @$pb.TagNumber(6) + $core.List get additionalAccounts => $_getList(5); +} + class Response_Location extends $pb.GeneratedMessage { factory Response_Location({ $core.String? county, @@ -720,6 +1501,11 @@ enum Response_Ok_Ok { userdata, authtoken, location, + authenticated, + plans, + planballance, + vouchers, + addaccountsinvites, notSet } @@ -732,6 +1518,11 @@ class Response_Ok extends $pb.GeneratedMessage { Response_UserData? userdata, $core.List<$core.int>? authtoken, Response_Location? location, + Response_Authenticated? authenticated, + Response_Plans? plans, + Response_PlanBallance? planballance, + Response_Vouchers? vouchers, + Response_AddAccountsInvites? addaccountsinvites, }) { final $result = create(); if (none != null) { @@ -755,6 +1546,21 @@ class Response_Ok extends $pb.GeneratedMessage { if (location != null) { $result.location = location; } + if (authenticated != null) { + $result.authenticated = authenticated; + } + if (plans != null) { + $result.plans = plans; + } + if (planballance != null) { + $result.planballance = planballance; + } + if (vouchers != null) { + $result.vouchers = vouchers; + } + if (addaccountsinvites != null) { + $result.addaccountsinvites = addaccountsinvites; + } return $result; } Response_Ok._() : super(); @@ -769,10 +1575,15 @@ class Response_Ok extends $pb.GeneratedMessage { 5 : Response_Ok_Ok.userdata, 6 : Response_Ok_Ok.authtoken, 7 : Response_Ok_Ok.location, + 8 : Response_Ok_Ok.authenticated, + 9 : Response_Ok_Ok.plans, + 10 : Response_Ok_Ok.planballance, + 11 : Response_Ok_Ok.vouchers, + 12 : Response_Ok_Ok.addaccountsinvites, 0 : Response_Ok_Ok.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Response.Ok', package: const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4, 5, 6, 7]) + ..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) ..aOB(1, _omitFieldNames ? '' : 'None', protoName: 'None') ..aInt64(2, _omitFieldNames ? '' : 'userid') ..a<$core.List<$core.int>>(3, _omitFieldNames ? '' : 'authchallenge', $pb.PbFieldType.OY) @@ -780,6 +1591,11 @@ class Response_Ok extends $pb.GeneratedMessage { ..aOM(5, _omitFieldNames ? '' : 'userdata', subBuilder: Response_UserData.create) ..a<$core.List<$core.int>>(6, _omitFieldNames ? '' : 'authtoken', $pb.PbFieldType.OY) ..aOM(7, _omitFieldNames ? '' : 'location', subBuilder: Response_Location.create) + ..aOM(8, _omitFieldNames ? '' : 'authenticated', subBuilder: Response_Authenticated.create) + ..aOM(9, _omitFieldNames ? '' : 'plans', subBuilder: Response_Plans.create) + ..aOM(10, _omitFieldNames ? '' : 'planballance', subBuilder: Response_PlanBallance.create) + ..aOM(11, _omitFieldNames ? '' : 'vouchers', subBuilder: Response_Vouchers.create) + ..aOM(12, _omitFieldNames ? '' : 'addaccountsinvites', subBuilder: Response_AddAccountsInvites.create) ..hasRequiredFields = false ; @@ -875,6 +1691,61 @@ class Response_Ok extends $pb.GeneratedMessage { void clearLocation() => clearField(7); @$pb.TagNumber(7) Response_Location ensureLocation() => $_ensure(6); + + @$pb.TagNumber(8) + Response_Authenticated get authenticated => $_getN(7); + @$pb.TagNumber(8) + set authenticated(Response_Authenticated v) { setField(8, v); } + @$pb.TagNumber(8) + $core.bool hasAuthenticated() => $_has(7); + @$pb.TagNumber(8) + void clearAuthenticated() => clearField(8); + @$pb.TagNumber(8) + Response_Authenticated ensureAuthenticated() => $_ensure(7); + + @$pb.TagNumber(9) + Response_Plans get plans => $_getN(8); + @$pb.TagNumber(9) + set plans(Response_Plans v) { setField(9, v); } + @$pb.TagNumber(9) + $core.bool hasPlans() => $_has(8); + @$pb.TagNumber(9) + void clearPlans() => clearField(9); + @$pb.TagNumber(9) + Response_Plans ensurePlans() => $_ensure(8); + + @$pb.TagNumber(10) + Response_PlanBallance get planballance => $_getN(9); + @$pb.TagNumber(10) + set planballance(Response_PlanBallance v) { setField(10, v); } + @$pb.TagNumber(10) + $core.bool hasPlanballance() => $_has(9); + @$pb.TagNumber(10) + void clearPlanballance() => clearField(10); + @$pb.TagNumber(10) + Response_PlanBallance ensurePlanballance() => $_ensure(9); + + @$pb.TagNumber(11) + Response_Vouchers get vouchers => $_getN(10); + @$pb.TagNumber(11) + set vouchers(Response_Vouchers v) { setField(11, v); } + @$pb.TagNumber(11) + $core.bool hasVouchers() => $_has(10); + @$pb.TagNumber(11) + void clearVouchers() => clearField(11); + @$pb.TagNumber(11) + Response_Vouchers ensureVouchers() => $_ensure(10); + + @$pb.TagNumber(12) + Response_AddAccountsInvites get addaccountsinvites => $_getN(11); + @$pb.TagNumber(12) + set addaccountsinvites(Response_AddAccountsInvites v) { setField(12, v); } + @$pb.TagNumber(12) + $core.bool hasAddaccountsinvites() => $_has(11); + @$pb.TagNumber(12) + void clearAddaccountsinvites() => clearField(12); + @$pb.TagNumber(12) + Response_AddAccountsInvites ensureAddaccountsinvites() => $_ensure(11); } enum Response_Response { diff --git a/lib/src/model/protobuf/api/server_to_client.pbjson.dart b/lib/src/model/protobuf/api/server_to_client.pbjson.dart index a6015fd..84d73c4 100644 --- a/lib/src/model/protobuf/api/server_to_client.pbjson.dart +++ b/lib/src/model/protobuf/api/server_to_client.pbjson.dart @@ -92,12 +92,118 @@ const Response$json = { {'1': 'ok', '3': 1, '4': 1, '5': 11, '6': '.server_to_client.Response.Ok', '9': 0, '10': 'ok'}, {'1': 'error', '3': 2, '4': 1, '5': 14, '6': '.error.ErrorCode', '9': 0, '10': 'error'}, ], - '3': [Response_Location$json, Response_PreKey$json, Response_UserData$json, Response_UploadToken$json, Response_Ok$json], + '3': [Response_Authenticated$json, Response_Plan$json, Response_Plans$json, Response_AddAccountsInvite$json, Response_AddAccountsInvites$json, Response_Transaction$json, Response_AdditionalAccount$json, Response_Voucher$json, Response_Vouchers$json, Response_PlanBallance$json, Response_Location$json, Response_PreKey$json, Response_UserData$json, Response_UploadToken$json, Response_Ok$json], '8': [ {'1': 'Response'}, ], }; +@$core.Deprecated('Use responseDescriptor instead') +const Response_Authenticated$json = { + '1': 'Authenticated', + '2': [ + {'1': 'plan', '3': 1, '4': 1, '5': 9, '10': 'plan'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_Plan$json = { + '1': 'Plan', + '2': [ + {'1': 'plan_id', '3': 1, '4': 1, '5': 9, '10': 'planId'}, + {'1': 'upload_size_limit', '3': 2, '4': 1, '5': 3, '10': 'uploadSizeLimit'}, + {'1': 'daily_media_upload_limit', '3': 3, '4': 1, '5': 3, '10': 'dailyMediaUploadLimit'}, + {'1': 'maximal_upload_size_of_single_media_size', '3': 4, '4': 1, '5': 3, '10': 'maximalUploadSizeOfSingleMediaSize'}, + {'1': 'additional_plus_accounts', '3': 5, '4': 1, '5': 3, '10': 'additionalPlusAccounts'}, + {'1': 'additional_free_accounts', '3': 6, '4': 1, '5': 3, '10': 'additionalFreeAccounts'}, + {'1': 'monthly_costs_cent', '3': 7, '4': 1, '5': 3, '10': 'monthlyCostsCent'}, + {'1': 'yearly_costs_cent', '3': 8, '4': 1, '5': 3, '10': 'yearlyCostsCent'}, + {'1': 'allowed_to_send_text_messages', '3': 9, '4': 1, '5': 8, '10': 'allowedToSendTextMessages'}, + {'1': 'is_additional_account', '3': 10, '4': 1, '5': 8, '10': 'isAdditionalAccount'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_Plans$json = { + '1': 'Plans', + '2': [ + {'1': 'plans', '3': 1, '4': 3, '5': 11, '6': '.server_to_client.Response.Plan', '10': 'plans'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_AddAccountsInvite$json = { + '1': 'AddAccountsInvite', + '2': [ + {'1': 'plan_id', '3': 1, '4': 1, '5': 9, '10': 'planId'}, + {'1': 'invite_code', '3': 2, '4': 1, '5': 9, '10': 'inviteCode'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_AddAccountsInvites$json = { + '1': 'AddAccountsInvites', + '2': [ + {'1': 'invites', '3': 1, '4': 3, '5': 11, '6': '.server_to_client.Response.AddAccountsInvite', '10': 'invites'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_Transaction$json = { + '1': 'Transaction', + '2': [ + {'1': 'deposit_cents', '3': 1, '4': 1, '5': 3, '10': 'depositCents'}, + {'1': 'transaction_type', '3': 2, '4': 1, '5': 9, '10': 'transactionType'}, + {'1': 'created_at_unix_timestamp', '3': 3, '4': 1, '5': 3, '10': 'createdAtUnixTimestamp'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_AdditionalAccount$json = { + '1': 'AdditionalAccount', + '2': [ + {'1': 'user_id', '3': 1, '4': 1, '5': 3, '10': 'userId'}, + {'1': 'plan_id', '3': 3, '4': 1, '5': 9, '10': 'planId'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_Voucher$json = { + '1': 'Voucher', + '2': [ + {'1': 'voucher_id', '3': 1, '4': 1, '5': 9, '10': 'voucherId'}, + {'1': 'value_cents', '3': 2, '4': 1, '5': 3, '10': 'valueCents'}, + {'1': 'redeemed', '3': 3, '4': 1, '5': 8, '10': 'redeemed'}, + {'1': 'requested', '3': 4, '4': 1, '5': 8, '10': 'requested'}, + {'1': 'created_at_unix_timestamp', '3': 5, '4': 1, '5': 3, '10': 'createdAtUnixTimestamp'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_Vouchers$json = { + '1': 'Vouchers', + '2': [ + {'1': 'vouchers', '3': 1, '4': 3, '5': 11, '6': '.server_to_client.Response.Voucher', '10': 'vouchers'}, + ], +}; + +@$core.Deprecated('Use responseDescriptor instead') +const Response_PlanBallance$json = { + '1': 'PlanBallance', + '2': [ + {'1': 'used_daily_media_upload_limit', '3': 1, '4': 1, '5': 3, '10': 'usedDailyMediaUploadLimit'}, + {'1': 'used_upload_media_size_limit', '3': 2, '4': 1, '5': 3, '10': 'usedUploadMediaSizeLimit'}, + {'1': 'payment_period_days', '3': 3, '4': 1, '5': 3, '9': 0, '10': 'paymentPeriodDays', '17': true}, + {'1': 'last_payment_done_unix_timestamp', '3': 4, '4': 1, '5': 3, '9': 1, '10': 'lastPaymentDoneUnixTimestamp', '17': true}, + {'1': 'transactions', '3': 5, '4': 3, '5': 11, '6': '.server_to_client.Response.Transaction', '10': 'transactions'}, + {'1': 'additional_accounts', '3': 6, '4': 3, '5': 11, '6': '.server_to_client.Response.AdditionalAccount', '10': 'additionalAccounts'}, + ], + '8': [ + {'1': '_payment_period_days'}, + {'1': '_last_payment_done_unix_timestamp'}, + ], +}; + @$core.Deprecated('Use responseDescriptor instead') const Response_Location$json = { '1': 'Location', @@ -158,6 +264,11 @@ const Response_Ok$json = { {'1': 'userdata', '3': 5, '4': 1, '5': 11, '6': '.server_to_client.Response.UserData', '9': 0, '10': 'userdata'}, {'1': 'authtoken', '3': 6, '4': 1, '5': 12, '9': 0, '10': 'authtoken'}, {'1': 'location', '3': 7, '4': 1, '5': 11, '6': '.server_to_client.Response.Location', '9': 0, '10': 'location'}, + {'1': 'authenticated', '3': 8, '4': 1, '5': 11, '6': '.server_to_client.Response.Authenticated', '9': 0, '10': 'authenticated'}, + {'1': 'plans', '3': 9, '4': 1, '5': 11, '6': '.server_to_client.Response.Plans', '9': 0, '10': 'plans'}, + {'1': 'planballance', '3': 10, '4': 1, '5': 11, '6': '.server_to_client.Response.PlanBallance', '9': 0, '10': 'planballance'}, + {'1': 'vouchers', '3': 11, '4': 1, '5': 11, '6': '.server_to_client.Response.Vouchers', '9': 0, '10': 'vouchers'}, + {'1': 'addaccountsinvites', '3': 12, '4': 1, '5': 11, '6': '.server_to_client.Response.AddAccountsInvites', '9': 0, '10': 'addaccountsinvites'}, ], '8': [ {'1': 'Ok'}, @@ -167,24 +278,63 @@ const Response_Ok$json = { /// Descriptor for `Response`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List responseDescriptor = $convert.base64Decode( 'CghSZXNwb25zZRIvCgJvaxgBIAEoCzIdLnNlcnZlcl90b19jbGllbnQuUmVzcG9uc2UuT2tIAF' - 'ICb2sSKAoFZXJyb3IYAiABKA4yEC5lcnJvci5FcnJvckNvZGVIAFIFZXJyb3IaTgoITG9jYXRp' - 'b24SFgoGY291bnR5GAEgASgJUgZjb3VudHkSFgoGcmVnaW9uGAIgASgJUgZyZWdpb24SEgoEY2' - 'l0eRgDIAEoCVIEY2l0eRowCgZQcmVLZXkSDgoCaWQYASABKANSAmlkEhYKBnByZWtleRgCIAEo' - 'DFIGcHJla2V5GrQDCghVc2VyRGF0YRIXCgd1c2VyX2lkGAEgASgDUgZ1c2VySWQSOwoHcHJla2' - 'V5cxgCIAMoCzIhLnNlcnZlcl90b19jbGllbnQuUmVzcG9uc2UuUHJlS2V5UgdwcmVrZXlzEh8K' - 'CHVzZXJuYW1lGAcgASgMSABSCHVzZXJuYW1liAEBEjMKE3B1YmxpY19pZGVudGl0eV9rZXkYAy' - 'ABKAxIAVIRcHVibGljSWRlbnRpdHlLZXmIAQESKAoNc2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lLlZvdWNoZXJzSABSCHZvdWNoZXJzEl8KEmFkZGFjY291' + 'bnRzaW52aXRlcxgMIAEoCzItLnNlcnZlcl90b19jbGllbnQuUmVzcG9uc2UuQWRkQWNjb3VudH' + 'NJbnZpdGVzSABSEmFkZGFjY291bnRzaW52aXRlc0IECgJPa0IKCghSZXNwb25zZQ=='); diff --git a/lib/src/providers/api_provider.dart b/lib/src/providers/api_provider.dart index 412d0bf..cb8c49d 100644 --- a/lib/src/providers/api_provider.dart +++ b/lib/src/providers/api_provider.dart @@ -11,10 +11,12 @@ import 'package:mutex/mutex.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:twonly/globals.dart'; import 'package:twonly/app.dart'; +import 'package:twonly/src/model/json/userdata.dart'; import 'package:twonly/src/model/protobuf/api/client_to_server.pbserver.dart'; import 'package:twonly/src/model/protobuf/api/error.pb.dart'; import 'package:twonly/src/model/protobuf/api/server_to_client.pb.dart' as server; +import 'package:twonly/src/model/protobuf/api/server_to_client.pbserver.dart'; import 'package:twonly/src/providers/api/api.dart'; import 'package:twonly/src/providers/api/api_utils.dart'; import 'package:twonly/src/providers/api/media_received.dart'; @@ -242,6 +244,15 @@ class ApiProvider { final result = await sendRequestSync(req, authenticated: false); if (result.isSuccess) { + server.Response_Ok ok = result.value; + if (ok.hasAuthenticated()) { + server.Response_Authenticated authenticated = ok.authenticated; + UserData? user = await getUser(); + if (user != null) { + user.subscriptionPlan = authenticated.plan; + await updateUser(user); + } + } log.info("Authenticated using api_auth_token"); onAuthenticated(); return true; @@ -394,6 +405,20 @@ class ApiProvider { return await sendRequestSync(req); } + Future getPlanBallance() async { + var get = ApplicationData_GetCurrentPlanInfos(); + var appData = ApplicationData()..getcurrentplaninfos = get; + var req = createClientToServerFromApplicationData(appData); + Result res = await sendRequestSync(req); + if (res.isSuccess) { + server.Response_Ok ok = res.value; + if (ok.hasPlanballance()) { + return ok.planballance; + } + } + return null; + } + Future updateFCMToken(String googleFcm) async { var get = ApplicationData_UpdateGoogleFcmToken()..googleFcm = googleFcm; var appData = ApplicationData()..updategooglefcmtoken = get; diff --git a/lib/src/providers/connection_provider.dart b/lib/src/providers/connection_provider.dart index c47795f..68586e2 100644 --- a/lib/src/providers/connection_provider.dart +++ b/lib/src/providers/connection_provider.dart @@ -1,10 +1,16 @@ import 'package:flutter/foundation.dart'; -class ConnectionChangeProvider with ChangeNotifier, DiagnosticableTreeMixin { +class CustomChangeProvider with ChangeNotifier, DiagnosticableTreeMixin { bool _isConnected = false; bool get isConnected => _isConnected; + String plan = ""; Future updateConnectionState(bool update) async { _isConnected = update; notifyListeners(); } + + Future updatePlan(String newPlan) async { + plan = newPlan; + notifyListeners(); + } } diff --git a/lib/src/views/chats/chat_list_view.dart b/lib/src/views/chats/chat_list_view.dart index a7cbaac..a4dad2c 100644 --- a/lib/src/views/chats/chat_list_view.dart +++ b/lib/src/views/chats/chat_list_view.dart @@ -21,6 +21,7 @@ import 'package:twonly/src/views/chats/start_new_chat.dart'; import 'package:twonly/src/views/settings/settings_main_view.dart'; import 'package:twonly/src/views/chats/search_username_view.dart'; import 'package:flutter/material.dart'; +import 'package:twonly/src/views/settings/subscription/subscription_view.dart'; class ChatListView extends StatefulWidget { const ChatListView({super.key}); @@ -31,10 +32,34 @@ class ChatListView extends StatefulWidget { class _ChatListViewState extends State { @override Widget build(BuildContext context) { - bool isConnected = context.watch().isConnected; + bool isConnected = context.watch().isConnected; return Scaffold( appBar: AppBar( - title: Text("twonly"), + title: Row(children: [ + Text("twonly "), + GestureDetector( + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return SubscriptionView(); + })); + }, + child: Container( + decoration: BoxDecoration( + color: context.color.primary, + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 3), + child: Text( + context.watch().plan, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + ), + ), + ]), actions: [ StreamBuilder( stream: twonlyDatabase.contactsDao.watchContactsRequested(), diff --git a/lib/src/views/chats/search_username_view.dart b/lib/src/views/chats/search_username_view.dart index 73e6a43..f0f9363 100644 --- a/lib/src/views/chats/search_username_view.dart +++ b/lib/src/views/chats/search_username_view.dart @@ -3,6 +3,8 @@ import 'package:drift/drift.dart' hide Column; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; +import 'package:twonly/src/providers/connection_provider.dart'; import 'package:twonly/src/views/components/alert_dialog.dart'; import 'package:twonly/src/database/daos/contacts_dao.dart'; import 'package:twonly/src/database/tables/messages_table.dart'; @@ -17,6 +19,7 @@ import 'package:twonly/src/providers/api/api.dart'; // ignore: library_prefixes import 'package:twonly/src/utils/signal.dart' as SignalHelper; import 'package:twonly/src/utils/storage.dart'; +import 'package:twonly/src/views/settings/subscription/subscription_view.dart'; class SearchUsernameView extends StatefulWidget { const SearchUsernameView({super.key}); @@ -113,26 +116,27 @@ class _SearchUsernameView extends State { }); } + InputDecoration getInputDecoration(hintText) { + final primaryColor = + Theme.of(context).colorScheme.primary; // Get the primary color + return InputDecoration( + hintText: hintText, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(9.0), + borderSide: BorderSide(color: primaryColor, width: 1.0), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + borderSide: BorderSide( + color: Theme.of(context).colorScheme.outline, width: 1.0), + ), + contentPadding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0), + ); + } + @override Widget build(BuildContext context) { - InputDecoration getInputDecoration(hintText) { - final primaryColor = - Theme.of(context).colorScheme.primary; // Get the primary color - return InputDecoration( - hintText: hintText, - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(9.0), - borderSide: BorderSide(color: primaryColor, width: 1.0), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.0), - borderSide: BorderSide( - color: Theme.of(context).colorScheme.outline, width: 1.0), - ), - contentPadding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0), - ); - } - + bool isPreview = context.read().plan == "Preview"; return Scaffold( appBar: AppBar( title: Text(context.lang.searchUsernameTitle), @@ -142,37 +146,50 @@ class _SearchUsernameView extends State { padding: EdgeInsets.only(bottom: 20, left: 10, top: 20, right: 10), child: Column( children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 10), - child: TextField( - onSubmitted: (_) { - _addNewUser(context); - }, - onChanged: (value) { - searchUserName.text = value.toLowerCase(); - searchUserName.selection = TextSelection.fromPosition( - TextPosition(offset: searchUserName.text.length), - ); - }, - inputFormatters: [ - LengthLimitingTextInputFormatter(12), - FilteringTextInputFormatter.allow(RegExp(r'[a-z0-9A-Z]')), - ], - controller: searchUserName, - decoration: - getInputDecoration(context.lang.searchUsernameInput), + if (isPreview) ...[ + Padding( + padding: EdgeInsets.all(20), + child: Text( + context.lang.searchUserNamePreview, + textAlign: TextAlign.center, + ), ), - ), + FilledButton.icon( + icon: FaIcon(FontAwesomeIcons.shieldHeart), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return SubscriptionView(); + })); + }, + label: Text(context.lang.selectSubscription), + ), + SizedBox(height: 30), + ], + if (!isPreview) ...[ + Padding( + padding: EdgeInsets.symmetric(horizontal: 10), + child: TextField( + onSubmitted: (_) { + _addNewUser(context); + }, + onChanged: (value) { + searchUserName.text = value.toLowerCase(); + searchUserName.selection = TextSelection.fromPosition( + TextPosition(offset: searchUserName.text.length), + ); + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(12), + FilteringTextInputFormatter.allow(RegExp(r'[a-z0-9A-Z]')), + ], + controller: searchUserName, + decoration: + getInputDecoration(context.lang.searchUsernameInput), + ), + ), + ], const SizedBox(height: 20), - OutlinedButton.icon( - icon: Icon(Icons.qr_code), - onPressed: () { - showAlertDialog(context, "Coming soon", - "This feature is not yet implemented!"); - }, - label: Text(context.lang.searchUsernameQrCodeBtn), - ), - SizedBox(height: 30), if (contacts.isNotEmpty) HeadLineComponent( context.lang.searchUsernameNewFollowerTitle, @@ -184,18 +201,20 @@ class _SearchUsernameView extends State { ), ), ), - floatingActionButton: Padding( - padding: const EdgeInsets.only(bottom: 30.0), - child: FloatingActionButton( - foregroundColor: Colors.white, - onPressed: () { - if (!_isLoading) _addNewUser(context); - }, - child: (_isLoading) - ? const Center(child: CircularProgressIndicator()) - : FaIcon(FontAwesomeIcons.magnifyingGlassPlus), - ), - ), + floatingActionButton: (isPreview) + ? null + : Padding( + padding: const EdgeInsets.only(bottom: 30.0), + child: FloatingActionButton( + foregroundColor: Colors.white, + onPressed: () { + if (!_isLoading) _addNewUser(context); + }, + child: (_isLoading) + ? const Center(child: CircularProgressIndicator()) + : FaIcon(FontAwesomeIcons.magnifyingGlassPlus), + ), + ), ); } } diff --git a/lib/src/views/onboarding/register_view.dart b/lib/src/views/onboarding/register_view.dart index eafacf0..56cabde 100644 --- a/lib/src/views/onboarding/register_view.dart +++ b/lib/src/views/onboarding/register_view.dart @@ -43,6 +43,7 @@ class _RegisterViewState extends State { userId: res.value.userid.toInt(), username: username, displayName: username, + subscriptionPlan: "Preview", ); storage.write(key: "userData", value: jsonEncode(userData)); } diff --git a/lib/src/views/settings/help/help_view.dart b/lib/src/views/settings/help/help_view.dart index 495bf08..511e54a 100644 --- a/lib/src/views/settings/help/help_view.dart +++ b/lib/src/views/settings/help/help_view.dart @@ -12,79 +12,78 @@ class HelpView extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(context.lang.settingsHelp), - ), - body: ListView( - children: [ - ListTile( - title: Text(context.lang.settingsHelpSupport), - onTap: () { - launchUrl(Uri.parse("https://twonly.eu/support")); - }, - trailing: - FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15), + appBar: AppBar( + title: Text(context.lang.settingsHelp), + ), + body: ListView( + children: [ + ListTile( + title: Text(context.lang.settingsHelpSupport), + onTap: () { + launchUrl(Uri.parse("https://twonly.eu/support")); + }, + trailing: FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15), + ), + ListTile( + title: Text(context.lang.settingsHelpContactUs), + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return ContactUsView(); + })); + }, + ), + Divider(), + FutureBuilder( + future: PackageInfo.fromPlatform(), + builder: (context, snap) { + if (snap.hasData) { + return ListTile( + title: Text(context.lang.settingsHelpVersion), + subtitle: Text(snap.data!.version), + ); + } else { + return Container(); + } + }, + ), + ListTile( + title: Text(context.lang.settingsHelpLicenses), + onTap: () { + showLicensePage(context: context); + }, + ), + ListTile( + title: Text(context.lang.settingsHelpCredits), + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return CreditsView(); + })); + }, + ), + ListTile( + title: Text(context.lang.settingsHelpDiagnostics), + onTap: () async { + await Navigator.push(context, + MaterialPageRoute(builder: (context) { + return DiagnosticsView(); + })); + }, + ), + ListTile( + title: Text(context.lang.settingsHelpLegal), + onTap: () { + launchUrl(Uri.parse("https://twonly.eu/legal")); + }, + trailing: FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15), + ), + ListTile( + title: Text( + "Copyright twonly", + style: TextStyle(color: Colors.grey, fontSize: 13), ), - ListTile( - title: Text(context.lang.settingsHelpContactUs), - onTap: () { - Navigator.push(context, MaterialPageRoute(builder: (context) { - return ContactUsView(); - })); - }, - ), - Divider(), - FutureBuilder( - future: PackageInfo.fromPlatform(), - builder: (context, snap) { - if (snap.hasData) { - return ListTile( - title: Text(context.lang.settingsHelpVersion), - subtitle: Text(snap.data!.version), - ); - } else { - return Container(); - } - }, - ), - ListTile( - title: Text(context.lang.settingsHelpLicenses), - onTap: () { - showLicensePage(context: context); - }, - ), - ListTile( - title: Text(context.lang.settingsHelpCredits), - onTap: () { - Navigator.push(context, MaterialPageRoute(builder: (context) { - return CreditsView(); - })); - }, - ), - ListTile( - title: Text(context.lang.settingsHelpDiagnostics), - onTap: () async { - await Navigator.push(context, - MaterialPageRoute(builder: (context) { - return DiagnosticsView(); - })); - }, - ), - ListTile( - title: Text(context.lang.settingsHelpLegal), - onTap: () { - launchUrl(Uri.parse("https://twonly.eu/legal")); - }, - trailing: - FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15), - ), - ListTile( - title: Text( - "Copyright twonly", - style: TextStyle(color: Colors.grey, fontSize: 13), - ), - ), - ], - )); + ), + ], + ), + ); } } diff --git a/lib/src/views/settings/settings_main_view.dart b/lib/src/views/settings/settings_main_view.dart index ca255b3..d7037ea 100644 --- a/lib/src/views/settings/settings_main_view.dart +++ b/lib/src/views/settings/settings_main_view.dart @@ -13,6 +13,7 @@ import 'package:twonly/src/views/settings/notification_view.dart'; import 'package:twonly/src/views/settings/profile/profile_view.dart'; import 'package:twonly/src/views/settings/help/help_view.dart'; import 'package:twonly/src/views/settings/privacy_view.dart'; +import 'package:twonly/src/views/settings/subscription/subscription_view.dart'; class SettingsMainView extends StatefulWidget { const SettingsMainView({super.key}); @@ -109,7 +110,12 @@ class _SettingsMainViewState extends State { BetterListTile( icon: FontAwesomeIcons.shieldHeart, text: context.lang.settingsSubscription, - onTap: () {}, + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return SubscriptionView(); + })); + }, ), const Divider(), BetterListTile( diff --git a/lib/src/views/settings/subscription/subscription_view.dart b/lib/src/views/settings/subscription/subscription_view.dart new file mode 100644 index 0000000..06bbbcc --- /dev/null +++ b/lib/src/views/settings/subscription/subscription_view.dart @@ -0,0 +1,217 @@ +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:twonly/globals.dart'; +import 'package:twonly/src/model/protobuf/api/server_to_client.pb.dart'; +import 'package:twonly/src/providers/connection_provider.dart'; +import 'package:twonly/src/utils/misc.dart'; +import 'package:twonly/src/views/components/better_list_title.dart'; + +class SubscriptionView extends StatefulWidget { + const SubscriptionView({super.key}); + + @override + State createState() => _SubscriptionViewState(); +} + +class _SubscriptionViewState extends State { + bool hasInternet = true; + int ballanceInCents = 0; + + @override + void initState() { + super.initState(); + initAsync(); + } + + Future initAsync() async { + // userData = await getUser(); + // setState(() {}); + + Response_PlanBallance? ballance = await apiProvider.getPlanBallance(); + if (ballance == null) { + setState(() { + hasInternet = false; + }); + return; + } + } + + @override + Widget build(BuildContext context) { + String formattedBalance = NumberFormat.currency( + locale: 'de_DE', // Locale for Euro formatting + symbol: '€', + decimalDigits: 2, + ).format(ballanceInCents / 100); + + return Scaffold( + appBar: AppBar( + title: Text(context.lang.settingsSubscription), + ), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(32.0), + child: Center( + child: Container( + decoration: BoxDecoration( + color: context.color.primary, + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 3), + child: Text( + context.watch().plan, + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + ), + ), + ), + Expanded( + child: ListView( + children: [ + Center( + child: Text("Upgrade your current plan."), + ), + SizedBox(height: 10), + PlanCard( + title: 'Pro', + yearlyPrice: '10€/year', + monthlyPrice: '1€/month', + features: [ + '✓ Unlimited media files', + '1 additional Plus user', + '3 additional Free users', + ], + ), + SizedBox(height: 10), + PlanCard( + title: 'Family', + yearlyPrice: '20€/year', + monthlyPrice: '2€/month', + features: [ + '✓ All from Pro', + '4 additional Plus users', + '5 additional Free users', + ], + ), + SizedBox(height: 10), + Divider(), + BetterListTile( + icon: FontAwesomeIcons.ticket, + text: "Redeem code for additional user", + onTap: () {}, + ), + BetterListTile( + icon: FontAwesomeIcons.moneyBillTransfer, + text: "Your transaction history", + subtitle: Text("Current ballance: $formattedBalance"), + onTap: () {}, + ), + BetterListTile( + icon: FontAwesomeIcons.userPlus, + text: "Manage your additional users", + subtitle: Text("Open: 3"), + onTap: () {}, + ), + BetterListTile( + icon: FontAwesomeIcons.gift, + text: "Create or redeem voucher", + onTap: () {}, + ), + SizedBox(height: 30) + ], + // tranaction + ), + ) + ], + ), + ); + } +} + +class PlanCard extends StatelessWidget { + final String title; + final String yearlyPrice; + final String monthlyPrice; + final List features; + + const PlanCard({ + super.key, + required this.title, + required this.yearlyPrice, + required this.monthlyPrice, + required this.features, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(left: 16, right: 16), + child: Card( + elevation: 4, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text( + title, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Column( + children: [ + Text( + yearlyPrice, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + Text( + monthlyPrice, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + color: Colors.grey, + ), + ), + ], + ) + ], + ), + SizedBox(height: 10), + ...features.map( + (feature) => Padding( + padding: const EdgeInsets.symmetric(vertical: 2.0), + child: Text( + feature, + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + ), + ); + } +}