Browse Source

neon: Mark things we never want to export as internal

pull/436/head
jld3103 1 year ago
parent
commit
8a7470cdaa
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/neon/neon/lib/src/blocs/apps.dart
  2. 2
      packages/neon/neon/lib/src/blocs/capabilities.dart
  3. 2
      packages/neon/neon/lib/src/blocs/first_launch.dart
  4. 2
      packages/neon/neon/lib/src/blocs/login.dart
  5. 2
      packages/neon/neon/lib/src/blocs/next_push.dart
  6. 2
      packages/neon/neon/lib/src/blocs/push_notifications.dart
  7. 2
      packages/neon/neon/lib/src/blocs/user_details.dart
  8. 2
      packages/neon/neon/lib/src/blocs/user_statuses.dart
  9. 3
      packages/neon/neon/lib/src/models/push_notification.dart
  10. 2
      packages/neon/neon/lib/src/platform/android.dart
  11. 2
      packages/neon/neon/lib/src/platform/linux.dart
  12. 2
      packages/neon/neon/lib/src/settings/models/option.dart
  13. 2
      packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart
  14. 2
      packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart
  15. 2
      packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart
  16. 2
      packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart
  17. 2
      packages/neon/neon/lib/src/settings/widgets/label_builder.dart
  18. 2
      packages/neon/neon/lib/src/settings/widgets/settings_category.dart
  19. 2
      packages/neon/neon/lib/src/settings/widgets/settings_list.dart
  20. 3
      packages/neon/neon/lib/src/settings/widgets/settings_tile.dart
  21. 2
      packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart
  22. 2
      packages/neon/neon/lib/src/utils/account_options.dart
  23. 2
      packages/neon/neon/lib/src/utils/global.dart
  24. 2
      packages/neon/neon/lib/src/utils/global_options.dart
  25. 2
      packages/neon/neon/lib/src/utils/global_popups.dart
  26. 2
      packages/neon/neon/lib/src/utils/localizations.dart
  27. 2
      packages/neon/neon/lib/src/utils/push_utils.dart
  28. 2
      packages/neon/neon/lib/src/utils/settings_export_helper.dart
  29. 3
      packages/neon/neon/lib/src/utils/theme.dart
  30. 2
      packages/neon/neon/lib/src/widgets/account_tile.dart
  31. 2
      packages/neon/neon/lib/src/widgets/app_implementation_icon.dart
  32. 7
      packages/neon/neon/lib/src/widgets/drawer_destination.dart

2
packages/neon/neon/lib/src/blocs/apps.dart

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/blocs/accounts.dart';
@ -34,6 +35,7 @@ abstract class AppsBlocStates {
BehaviorSubject<Iterable<(String, Object?)>?> get appVersions;
}
@internal
class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates {
AppsBloc(
this._requestManager,

2
packages/neon/neon/lib/src/blocs/capabilities.dart

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/models/account.dart';
@ -16,6 +17,7 @@ abstract class CapabilitiesBlocStates {
BehaviorSubject<Result<Capabilities>> get capabilities;
}
@internal
class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents, CapabilitiesBlocStates {
CapabilitiesBloc(
this._requestManager,

2
packages/neon/neon/lib/src/blocs/first_launch.dart

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -10,6 +11,7 @@ abstract class FirstLaunchBlocStates {
BehaviorSubject get onFirstLaunch;
}
@internal
class FirstLaunchBloc extends Bloc implements FirstLaunchBlocEvents, FirstLaunchBlocStates {
FirstLaunchBloc(
this._sharedPreferences, {

2
packages/neon/neon/lib/src/blocs/login.dart

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/models/account.dart';
import 'package:nextcloud/nextcloud.dart';
@ -21,6 +22,7 @@ abstract class LoginBlocStates {
BehaviorSubject<CoreLoginFlowResult?> get loginFlowResult;
}
@internal
class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocStates {
LoginBloc(this._packageInfo);

2
packages/neon/neon/lib/src/blocs/next_push.dart

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
@ -13,6 +14,7 @@ abstract class NextPushBlocStates {
BehaviorSubject get onNextPushSupported;
}
@internal
class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocStates {
NextPushBloc(
this._accountsBloc,

2
packages/neon/neon/lib/src/blocs/push_notifications.dart

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
@ -20,6 +21,7 @@ abstract class PushNotificationsBlocStates {
Stream<PushNotification> get notifications;
}
@internal
class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, PushNotificationsBlocStates {
PushNotificationsBloc(
this._accountsBloc,

2
packages/neon/neon/lib/src/blocs/user_details.dart

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/models/account.dart';
@ -13,6 +14,7 @@ abstract class UserDetailsBlocStates {
BehaviorSubject<Result<ProvisioningApiUserDetails>> get userDetails;
}
@internal
class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, UserDetailsBlocStates {
UserDetailsBloc(
this._requestManager,

2
packages/neon/neon/lib/src/blocs/user_statuses.dart

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/bloc.dart';
import 'package:neon/src/bloc/result.dart';
import 'package:neon/src/blocs/timer.dart';
@ -18,6 +19,7 @@ abstract class UserStatusesBlocStates {
BehaviorSubject<Map<String, Result<UserStatusPublicStatus?>>> get statuses;
}
@internal
class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents, UserStatusesBlocStates {
UserStatusesBloc(
this._platform,

3
packages/neon/neon/lib/src/models/push_notification.dart

@ -1,11 +1,12 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
import 'package:nextcloud/nextcloud.dart';
part 'push_notification.g.dart';
@JsonSerializable()
@immutable
@internal
class PushNotification {
const PushNotification({
required this.accountID,

2
packages/neon/neon/lib/src/platform/android.dart

@ -1,9 +1,11 @@
import 'package:meta/meta.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:neon/src/utils/exceptions.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
@internal
class AndroidNeonPlatform extends NeonPlatform {
AndroidNeonPlatform()
: super(

2
packages/neon/neon/lib/src/platform/linux.dart

@ -1,10 +1,12 @@
import 'dart:io';
import 'package:meta/meta.dart';
import 'package:neon/src/platform/platform.dart';
import 'package:path/path.dart' as p;
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:xdg_directories/xdg_directories.dart' as xdg;
@internal
class LinuxNeonPlatform extends NeonPlatform {
LinuxNeonPlatform()
: super(

2
packages/neon/neon/lib/src/settings/models/option.dart

@ -6,9 +6,11 @@ import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:rxdart/rxdart.dart';
@internal
class OptionDisableException implements Exception {}
@immutable
@internal
abstract class Option<T> {
Option({
required this.storage,

2
packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart

@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
import 'package:neon/src/widgets/account_tile.dart';
@internal
class AccountSettingsTile extends SettingsTile {
const AccountSettingsTile({
required this.account,

2
packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart

@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/toggle_option.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class CheckBoxSettingsTile extends InputSettingsTile<ToggleOption> {
const CheckBoxSettingsTile({
required super.option,

2
packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class CustomSettingsTile extends SettingsTile {
const CustomSettingsTile({
this.title,

2
packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/select_option.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:neon/src/settings/widgets/option_builder.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class DropdownButtonSettingsTile<T> extends InputSettingsTile<SelectOption<T>> {
const DropdownButtonSettingsTile({
required super.option,

2
packages/neon/neon/lib/src/settings/widgets/label_builder.dart

@ -1,3 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
@internal
typedef LabelBuilder = String Function(BuildContext);

2
packages/neon/neon/lib/src/settings/widgets/settings_category.dart

@ -1,7 +1,9 @@
import 'package:flutter/widgets.dart';
import 'package:intersperse/intersperse.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class SettingsCategory extends StatelessWidget {
const SettingsCategory({
required this.tiles,

2
packages/neon/neon/lib/src/settings/widgets/settings_list.dart

@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:intersperse/intersperse.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_category.dart';
@internal
class SettingsList extends StatelessWidget {
const SettingsList({
required this.categories,

3
packages/neon/neon/lib/src/settings/widgets/settings_tile.dart

@ -1,12 +1,15 @@
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/models/option.dart';
@internal
abstract class SettingsTile extends StatelessWidget {
const SettingsTile({
super.key,
});
}
@internal
abstract class InputSettingsTile<T extends Option> extends SettingsTile {
const InputSettingsTile({
required this.option,

2
packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/settings/widgets/settings_tile.dart';
@internal
class TextSettingsTile extends SettingsTile {
const TextSettingsTile({
required this.text,

2
packages/neon/neon/lib/src/utils/account_options.dart

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/apps.dart';
import 'package:neon/src/settings/models/option.dart';
@ -8,6 +9,7 @@ import 'package:neon/src/settings/models/storage.dart';
import 'package:neon/src/settings/widgets/label_builder.dart';
import 'package:rxdart/rxdart.dart';
@internal
class AccountSpecificOptions {
AccountSpecificOptions(
this._storage,

2
packages/neon/neon/lib/src/utils/global.dart

@ -1,5 +1,7 @@
import 'package:meta/meta.dart';
import 'package:neon/src/models/push_notification.dart';
@internal
class Global {
static Function(String accountID)? onPushNotificationReceived;
static Function(PushNotification notification)? onPushNotificationClicked;

2
packages/neon/neon/lib/src/utils/global_options.dart

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/settings/models/option.dart';
@ -16,6 +17,7 @@ import 'package:shared_preferences/shared_preferences.dart';
const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush';
@internal
class GlobalOptions {
GlobalOptions(
this._sharedPreferences,

2
packages/neon/neon/lib/src/utils/global_popups.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
import 'package:neon/src/blocs/first_launch.dart';
import 'package:neon/src/blocs/next_push.dart';
@ -7,6 +8,7 @@ import 'package:neon/src/utils/global_options.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
@internal
class GlobalPopups {
factory GlobalPopups() => instance ??= GlobalPopups._();

2
packages/neon/neon/lib/src/utils/localizations.dart

@ -1,11 +1,13 @@
import 'dart:ui';
import 'package:intl/intl_standalone.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
/// Loads the [AppLocalizations] for the system [Locale].
///
/// When the system locale is not supported [fallbackLocale] will be used.
@internal
Future<AppLocalizations> appLocalizationsFromSystem([final Locale fallbackLocale = const Locale('en', 'US')]) async {
final systemLocale = await findSystemLocale();
final parts = systemLocale.split('_').map((final a) => a.split('.')).expand((final e) => e).toList();

2
packages/neon/neon/lib/src/utils/push_utils.dart

@ -8,6 +8,7 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart' show SvgFileLoader, vg;
import 'package:meta/meta.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/push_notification.dart';
@ -20,6 +21,7 @@ import 'package:neon/src/utils/theme.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:shared_preferences/shared_preferences.dart';
@internal
class PushUtils {
static Future<RSAKeypair> loadRSAKeypair(final AppStorage storage) async {
const keyDevicePrivateKey = 'device-private-key';

2
packages/neon/neon/lib/src/utils/settings_export_helper.dart

@ -1,8 +1,10 @@
import 'package:meta/meta.dart';
import 'package:neon/src/models/account.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/settings/models/option.dart';
import 'package:neon/src/utils/global_options.dart';
@internal
class SettingsExportHelper {
SettingsExportHelper({
required this.globalOptions,

3
packages/neon/neon/lib/src/utils/theme.dart

@ -1,9 +1,12 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/utils/hex_color.dart';
import 'package:nextcloud/nextcloud.dart';
@internal
const themePrimaryColor = Color(0xFFF37736);
@internal
ThemeData getThemeFromNextcloudTheme(
final CoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme,
final Brightness brightness, {

2
packages/neon/neon/lib/src/widgets/account_tile.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/bloc/result_builder.dart';
import 'package:neon/src/blocs/accounts.dart';
import 'package:neon/src/models/account.dart';
@ -8,6 +9,7 @@ import 'package:neon/src/widgets/user_avatar.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:provider/provider.dart';
@internal
class NeonAccountTile extends StatelessWidget {
const NeonAccountTile({
required this.account,

2
packages/neon/neon/lib/src/widgets/app_implementation_icon.dart

@ -1,7 +1,9 @@
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/models/app_implementation.dart';
import 'package:neon/src/widgets/user_avatar.dart';
@internal
class NeonAppImplementationIcon extends StatelessWidget {
const NeonAppImplementationIcon({
required this.appImplementation,

7
packages/neon/neon/lib/src/widgets/drawer_destination.dart

@ -1,9 +1,12 @@
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/src/widgets/user_avatar.dart';
import 'package:rxdart/subjects.dart';
@internal
typedef DestinationIconBuilder = Widget Function({Size size, Color color});
@internal
class NeonNavigationDestination {
const NeonNavigationDestination({
required this.label,
@ -18,6 +21,7 @@ class NeonNavigationDestination {
final BehaviorSubject<int>? notificationCount;
}
@internal
extension NavigationDestinationExtension on NavigationDestination {
static NavigationDestination fromNeonDestination(final NeonNavigationDestination neonDestination) =>
NavigationDestination(
@ -27,6 +31,7 @@ extension NavigationDestinationExtension on NavigationDestination {
);
}
@internal
extension NavigationRailDestinationExtension on NavigationRailDestination {
static NavigationRailDestination fromNeonDestination(final NeonNavigationDestination neonDestination) {
final iconWIdget = StreamBuilder(
@ -79,6 +84,7 @@ extension NavigationRailDestinationExtension on NavigationRailDestination {
}
}
@internal
extension NavigationDrawerDestinationExtension on NavigationDrawerDestination {
static NavigationDrawerDestination fromNeonDestination(final NeonNavigationDestination neonDestination) {
final labelWidget = StreamBuilder(
@ -129,6 +135,7 @@ extension NavigationDrawerDestinationExtension on NavigationDrawerDestination {
}
}
@internal
extension TabExtension on Tab {
static Tab fromNeonDestination(final NeonNavigationDestination neonDestination) => Tab(
text: neonDestination.label,

Loading…
Cancel
Save