From 8a7470cdaa4089d61937411205ad81f9138cbe3d Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 2 Jul 2023 12:18:36 +0200 Subject: [PATCH] neon: Mark things we never want to export as internal --- packages/neon/neon/lib/src/blocs/apps.dart | 2 ++ packages/neon/neon/lib/src/blocs/capabilities.dart | 2 ++ packages/neon/neon/lib/src/blocs/first_launch.dart | 2 ++ packages/neon/neon/lib/src/blocs/login.dart | 2 ++ packages/neon/neon/lib/src/blocs/next_push.dart | 2 ++ packages/neon/neon/lib/src/blocs/push_notifications.dart | 2 ++ packages/neon/neon/lib/src/blocs/user_details.dart | 2 ++ packages/neon/neon/lib/src/blocs/user_statuses.dart | 2 ++ packages/neon/neon/lib/src/models/push_notification.dart | 3 ++- packages/neon/neon/lib/src/platform/android.dart | 2 ++ packages/neon/neon/lib/src/platform/linux.dart | 2 ++ packages/neon/neon/lib/src/settings/models/option.dart | 2 ++ .../lib/src/settings/widgets/account_settings_tile.dart | 2 ++ .../lib/src/settings/widgets/checkbox_settings_tile.dart | 2 ++ .../lib/src/settings/widgets/custom_settings_tile.dart | 2 ++ .../settings/widgets/dropdown_button_settings_tile.dart | 2 ++ .../neon/neon/lib/src/settings/widgets/label_builder.dart | 2 ++ .../neon/lib/src/settings/widgets/settings_category.dart | 2 ++ .../neon/neon/lib/src/settings/widgets/settings_list.dart | 2 ++ .../neon/neon/lib/src/settings/widgets/settings_tile.dart | 3 +++ .../neon/lib/src/settings/widgets/text_settings_tile.dart | 2 ++ packages/neon/neon/lib/src/utils/account_options.dart | 2 ++ packages/neon/neon/lib/src/utils/global.dart | 2 ++ packages/neon/neon/lib/src/utils/global_options.dart | 2 ++ packages/neon/neon/lib/src/utils/global_popups.dart | 2 ++ packages/neon/neon/lib/src/utils/localizations.dart | 2 ++ packages/neon/neon/lib/src/utils/push_utils.dart | 2 ++ .../neon/neon/lib/src/utils/settings_export_helper.dart | 2 ++ packages/neon/neon/lib/src/utils/theme.dart | 3 +++ packages/neon/neon/lib/src/widgets/account_tile.dart | 2 ++ .../neon/neon/lib/src/widgets/app_implementation_icon.dart | 2 ++ packages/neon/neon/lib/src/widgets/drawer_destination.dart | 7 +++++++ 32 files changed, 71 insertions(+), 1 deletion(-) diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index c44850b7..383178dd 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/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?> get appVersions; } +@internal class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates { AppsBloc( this._requestManager, diff --git a/packages/neon/neon/lib/src/blocs/capabilities.dart b/packages/neon/neon/lib/src/blocs/capabilities.dart index 8d1b74fe..adc265db 100644 --- a/packages/neon/neon/lib/src/blocs/capabilities.dart +++ b/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> get capabilities; } +@internal class CapabilitiesBloc extends InteractiveBloc implements CapabilitiesBlocEvents, CapabilitiesBlocStates { CapabilitiesBloc( this._requestManager, diff --git a/packages/neon/neon/lib/src/blocs/first_launch.dart b/packages/neon/neon/lib/src/blocs/first_launch.dart index 77e7e5ac..ed7c63f4 100644 --- a/packages/neon/neon/lib/src/blocs/first_launch.dart +++ b/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, { diff --git a/packages/neon/neon/lib/src/blocs/login.dart b/packages/neon/neon/lib/src/blocs/login.dart index 8ed9266c..9ce3dd6c 100644 --- a/packages/neon/neon/lib/src/blocs/login.dart +++ b/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 get loginFlowResult; } +@internal class LoginBloc extends InteractiveBloc implements LoginBlocEvents, LoginBlocStates { LoginBloc(this._packageInfo); diff --git a/packages/neon/neon/lib/src/blocs/next_push.dart b/packages/neon/neon/lib/src/blocs/next_push.dart index e68651f5..04e8c297 100644 --- a/packages/neon/neon/lib/src/blocs/next_push.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/blocs/push_notifications.dart b/packages/neon/neon/lib/src/blocs/push_notifications.dart index 9503d40e..d2e03cf9 100644 --- a/packages/neon/neon/lib/src/blocs/push_notifications.dart +++ b/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 get notifications; } +@internal class PushNotificationsBloc extends Bloc implements PushNotificationsBlocEvents, PushNotificationsBlocStates { PushNotificationsBloc( this._accountsBloc, diff --git a/packages/neon/neon/lib/src/blocs/user_details.dart b/packages/neon/neon/lib/src/blocs/user_details.dart index 1905f00a..94d31ab7 100644 --- a/packages/neon/neon/lib/src/blocs/user_details.dart +++ b/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> get userDetails; } +@internal class UserDetailsBloc extends InteractiveBloc implements UserDetailsBlocEvents, UserDetailsBlocStates { UserDetailsBloc( this._requestManager, diff --git a/packages/neon/neon/lib/src/blocs/user_statuses.dart b/packages/neon/neon/lib/src/blocs/user_statuses.dart index 66d181fe..cf3fe553 100644 --- a/packages/neon/neon/lib/src/blocs/user_statuses.dart +++ b/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>> get statuses; } +@internal class UserStatusesBloc extends InteractiveBloc implements UserStatusesBlocEvents, UserStatusesBlocStates { UserStatusesBloc( this._platform, diff --git a/packages/neon/neon/lib/src/models/push_notification.dart b/packages/neon/neon/lib/src/models/push_notification.dart index 2fe353a8..5ac8176b 100644 --- a/packages/neon/neon/lib/src/models/push_notification.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/platform/android.dart b/packages/neon/neon/lib/src/platform/android.dart index 5fadb329..53f96543 100644 --- a/packages/neon/neon/lib/src/platform/android.dart +++ b/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( diff --git a/packages/neon/neon/lib/src/platform/linux.dart b/packages/neon/neon/lib/src/platform/linux.dart index e5b92506..471c8db1 100644 --- a/packages/neon/neon/lib/src/platform/linux.dart +++ b/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( diff --git a/packages/neon/neon/lib/src/settings/models/option.dart b/packages/neon/neon/lib/src/settings/models/option.dart index 444143f7..9c4be651 100644 --- a/packages/neon/neon/lib/src/settings/models/option.dart +++ b/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 { Option({ required this.storage, diff --git a/packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart index d7e6e286..ae62dbe2 100644 --- a/packages/neon/neon/lib/src/settings/widgets/account_settings_tile.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart index 6193d79a..adcad0a0 100644 --- a/packages/neon/neon/lib/src/settings/widgets/checkbox_settings_tile.dart +++ b/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 { const CheckBoxSettingsTile({ required super.option, diff --git a/packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart index fd015a5c..f042bcc6 100644 --- a/packages/neon/neon/lib/src/settings/widgets/custom_settings_tile.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart index 378c9ac1..81b2e795 100644 --- a/packages/neon/neon/lib/src/settings/widgets/dropdown_button_settings_tile.dart +++ b/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 extends InputSettingsTile> { const DropdownButtonSettingsTile({ required super.option, diff --git a/packages/neon/neon/lib/src/settings/widgets/label_builder.dart b/packages/neon/neon/lib/src/settings/widgets/label_builder.dart index 82baa178..76f20caf 100644 --- a/packages/neon/neon/lib/src/settings/widgets/label_builder.dart +++ b/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); diff --git a/packages/neon/neon/lib/src/settings/widgets/settings_category.dart b/packages/neon/neon/lib/src/settings/widgets/settings_category.dart index 60a35834..674d3432 100644 --- a/packages/neon/neon/lib/src/settings/widgets/settings_category.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/settings/widgets/settings_list.dart b/packages/neon/neon/lib/src/settings/widgets/settings_list.dart index 83570326..dd0c6c7f 100644 --- a/packages/neon/neon/lib/src/settings/widgets/settings_list.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/settings/widgets/settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/settings_tile.dart index 267eae42..af1b770d 100644 --- a/packages/neon/neon/lib/src/settings/widgets/settings_tile.dart +++ b/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 extends SettingsTile { const InputSettingsTile({ required this.option, diff --git a/packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart b/packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart index c4bafb55..d09aeb3c 100644 --- a/packages/neon/neon/lib/src/settings/widgets/text_settings_tile.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/utils/account_options.dart b/packages/neon/neon/lib/src/utils/account_options.dart index 7da00ffa..31da3211 100644 --- a/packages/neon/neon/lib/src/utils/account_options.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/utils/global.dart b/packages/neon/neon/lib/src/utils/global.dart index aea4b4be..8b8968b5 100644 --- a/packages/neon/neon/lib/src/utils/global.dart +++ b/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; diff --git a/packages/neon/neon/lib/src/utils/global_options.dart b/packages/neon/neon/lib/src/utils/global_options.dart index dbc84773..d428e841 100644 --- a/packages/neon/neon/lib/src/utils/global_options.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/utils/global_popups.dart b/packages/neon/neon/lib/src/utils/global_popups.dart index 3b7608a7..05a732a7 100644 --- a/packages/neon/neon/lib/src/utils/global_popups.dart +++ b/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._(); diff --git a/packages/neon/neon/lib/src/utils/localizations.dart b/packages/neon/neon/lib/src/utils/localizations.dart index df87e801..f9e3b0a4 100644 --- a/packages/neon/neon/lib/src/utils/localizations.dart +++ b/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 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(); diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index f55f5554..d9003f3a 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/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 loadRSAKeypair(final AppStorage storage) async { const keyDevicePrivateKey = 'device-private-key'; diff --git a/packages/neon/neon/lib/src/utils/settings_export_helper.dart b/packages/neon/neon/lib/src/utils/settings_export_helper.dart index 011e76bd..dbaa93ca 100644 --- a/packages/neon/neon/lib/src/utils/settings_export_helper.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/utils/theme.dart b/packages/neon/neon/lib/src/utils/theme.dart index 45d90776..242f0a36 100644 --- a/packages/neon/neon/lib/src/utils/theme.dart +++ b/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, { diff --git a/packages/neon/neon/lib/src/widgets/account_tile.dart b/packages/neon/neon/lib/src/widgets/account_tile.dart index 9ec66ef1..136b484e 100644 --- a/packages/neon/neon/lib/src/widgets/account_tile.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart b/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart index 293e59d5..457f35b2 100644 --- a/packages/neon/neon/lib/src/widgets/app_implementation_icon.dart +++ b/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, diff --git a/packages/neon/neon/lib/src/widgets/drawer_destination.dart b/packages/neon/neon/lib/src/widgets/drawer_destination.dart index 70ea94ec..57e3bc62 100644 --- a/packages/neon/neon/lib/src/widgets/drawer_destination.dart +++ b/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? 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,