Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions example/lib/app_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import 'package:solidui/solidui.dart';

import 'constants/app.dart';
import 'home.dart';
import 'screens/settings_page.dart';
import 'screens/sample_page.dart';

final _scaffoldController = SolidScaffoldController();

Expand Down Expand Up @@ -73,18 +73,6 @@ class AppScaffold extends StatelessWidget {
''',
child: SolidFile(),
),
SolidMenuItem(
icon: Icons.info,
title: 'About',
tooltip: '''
**About:** Tap here to learn more about this application.
''',
child: Center(
child: Text('About Page', style: TextStyle(fontSize: 24)),
),
),
],

// APP BAR.
Expand All @@ -105,18 +93,18 @@ class AppScaffold extends StatelessWidget {

actions: [
SolidAppBarAction(
icon: Icons.folder_open,
icon: Icons.folder,
onPressed: () => _scaffoldController.navigateToSubpage(
const SolidFile(),
),
tooltip: 'Files',
),
SolidAppBarAction(
icon: Icons.settings,
icon: Icons.article,
onPressed: () => _scaffoldController.navigateToSubpage(
const SettingsPage(),
const SamplePage(),
),
tooltip: 'Settings',
tooltip: 'Sample Page',
),
],
),
Expand Down
91 changes: 91 additions & 0 deletions example/lib/screens/sample_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/// Sample page - Demonstrates AppBar-only navigation pattern.
///
/// Copyright (C) 2026, Software Innovation Institute, ANU.
///
/// Licensed under the MIT License (the "License").
///
/// License: https://choosealicense.com/licenses/mit/.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
///
/// Authors: Tony Chen
library;

import 'package:flutter/material.dart';

/// Sample page widget demonstrating AppBar-only navigation.
class SamplePage extends StatelessWidget {
const SamplePage({super.key});

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

return Center(
child: Card(
margin: const EdgeInsets.all(32.0),
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.article_outlined,
size: 64,
color: theme.colorScheme.primary,
),
const SizedBox(height: 24),
Text(
'Sample Page',
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 16),
Text(
'AppBar-Only Navigation Demo',
style: theme.textTheme.titleMedium?.copyWith(
color: theme.colorScheme.primary,
),
),
const SizedBox(height: 32),
Container(
constraints: const BoxConstraints(maxWidth: 500),
child: Text(
'The navigation buttons for this page are only placed on '
'the app bar, so no buttons on the navigation rail will be '
'highlighted when entering this page. In contrast, when '
'the Files button on the app bar is clicked, the '
'Files button on the navigation rail will be highlighted '
'as well, since it is laid out in both places. This button '
'also demonstrates the usage of the navigateToSubpage() '
'function.',
style: theme.textTheme.bodyLarge,
textAlign: TextAlign.left,
),
),
],
),
),
),
);
}
}
224 changes: 0 additions & 224 deletions example/lib/screens/settings_page.dart

This file was deleted.

Loading