Browse Source

docs(neon): document neon pages

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/1028/head
Nikolas Rimikis 1 year ago
parent
commit
8e8f23f130
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 7
      packages/neon/neon/lib/src/pages/account_settings.dart
  2. 2
      packages/neon/neon/lib/src/pages/home.dart
  3. 31
      packages/neon/neon/lib/src/pages/settings.dart

7
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:neon/src/widgets/linear_progress_indicator.dart';
import 'package:nextcloud/provisioning_api.dart' as provisioning_api; import 'package:nextcloud/provisioning_api.dart' as provisioning_api;
/// Account settings page.
///
/// Displays settings for an [Account]. Settings are specified as `Option`s.
@internal @internal
class AccountSettingsPage extends StatelessWidget { class AccountSettingsPage extends StatelessWidget {
/// Creates a new account settings page for the given [account].
const AccountSettingsPage({ const AccountSettingsPage({
required this.bloc, required this.bloc,
required this.account, required this.account,
super.key, super.key,
}); });
/// The bloc managing the accounts and their settings.
final AccountsBloc bloc; final AccountsBloc bloc;
/// The account to display the settings for.
final Account account; final Account account;
@override @override

2
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:nextcloud/core.dart' as core;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/// The home page of Neon.
@internal @internal
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
/// Creates a new home page.
const HomePage({ const HomePage({
super.key, super.key,
}); });

31
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:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher_string.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 @internal
enum SettingsCategories { enum SettingsCategories {
/// `NextcloudAppOptions` category.
///
/// Each activated `AppImplementation` has an entry if it has any options specified.
apps, apps,
/// Theming category.
theme, theme,
/// Device navigation category.
navigation, navigation,
/// Push notifications category.
pushNotifications, pushNotifications,
/// Startup category.
startup, startup,
/// System tray category.
systemTray, systemTray,
/// Account management category.
///
/// Also includes the `AccountSpecificOptions`.
accounts, accounts,
/// Other category.
///
/// Contains legal information and various links.
other, other,
} }
/// Settings page.
///
/// Settings are specified as `Option`s.
@internal @internal
class SettingsPage extends StatefulWidget { class SettingsPage extends StatefulWidget {
/// Creates a new settings page.
const SettingsPage({ const SettingsPage({
this.initialCategory, this.initialCategory,
super.key, super.key,
}); });
/// The optional initial category to show.
final SettingsCategories? initialCategory; final SettingsCategories? initialCategory;
@override @override

Loading…
Cancel
Save