App bar
An app bar identifies the current screen and keeps its most relevant actions close. Save belongs here when it applies to the whole note.
Save a note from the app bar
#Use Save in the Notes bar. The status changes from Unsaved to Saved.
components/app-bar/appliance/save_note.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class SaveNote extends StatefulWidget {
const SaveNote({super.key});
@override
State<SaveNote> createState() => _SaveNoteState();
}
class _SaveNoteState extends State<SaveNote> {
bool saved = false;
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
ApplianceAppBar(
title: 'Notes',
actions: [
ApplianceButton(
'Save',
onPressed: () => setState(() => saved = true),
),
],
),
const SizedBox(height: 12),
Text(saved ? 'Saved' : 'Unsaved'),
],
);
}
Parameters
ApplianceAppBar API ↗title- Identifies the current screen.
actions- Widgets at the action end of the bar.
Shared behaviour
- Keyboard and focus. Tab to Save and activate it. Read the result below the bar.
- Screen readers. Inspect the bar’s title and the name of its action, then move past the bar to the saved state.
- Direction and type. Change direction to see which edge holds Save. At phone width and 200% text, inspect the space shared by the title and action.