From 8e8f23f1301187c713f743d856a77fe682d9cb07 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 26 Oct 2023 08:17:10 +0200 Subject: [PATCH] docs(neon): document neon pages Signed-off-by: Nikolas Rimikis --- .../neon/lib/src/pages/account_settings.dart | 7 +++++ packages/neon/neon/lib/src/pages/home.dart | 2 ++ .../neon/neon/lib/src/pages/settings.dart | 31 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index e41b507d..89341e13 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -17,15 +17,22 @@ import 'package:neon/src/widgets/error.dart'; import 'package:neon/src/widgets/linear_progress_indicator.dart'; import 'package:nextcloud/provisioning_api.dart' as provisioning_api; +/// Account settings page. +/// +/// Displays settings for an [Account]. Settings are specified as `Option`s. @internal class AccountSettingsPage extends StatelessWidget { + /// Creates a new account settings page for the given [account]. const AccountSettingsPage({ required this.bloc, required this.account, super.key, }); + /// The bloc managing the accounts and their settings. final AccountsBloc bloc; + + /// The account to display the settings for. final Account account; @override diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index 30d2e759..4d16bd9b 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -19,8 +19,10 @@ import 'package:neon/src/widgets/unified_search_results.dart'; import 'package:nextcloud/core.dart' as core; import 'package:provider/provider.dart'; +/// The home page of Neon. @internal class HomePage extends StatefulWidget { + /// Creates a new home page. const HomePage({ super.key, }); diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index 7dc71852..8f095a4a 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -26,25 +26,56 @@ import 'package:neon/src/widgets/error.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:url_launcher/url_launcher_string.dart'; +/// Categories of the [SettingsPage]. +/// +/// Used with [SettingsPage.initialCategory] to scroll to a specific section. +/// Values are in order of appearance but are not guaranteed to be included on +/// the settings page. @internal enum SettingsCategories { + /// `NextcloudAppOptions` category. + /// + /// Each activated `AppImplementation` has an entry if it has any options specified. apps, + + /// Theming category. theme, + + /// Device navigation category. navigation, + + /// Push notifications category. pushNotifications, + + /// Startup category. startup, + + /// System tray category. systemTray, + + /// Account management category. + /// + /// Also includes the `AccountSpecificOptions`. accounts, + + /// Other category. + /// + /// Contains legal information and various links. other, } +/// Settings page. +/// +/// Settings are specified as `Option`s. @internal class SettingsPage extends StatefulWidget { + /// Creates a new settings page. const SettingsPage({ this.initialCategory, super.key, }); + /// The optional initial category to show. final SettingsCategories? initialCategory; @override