Link
Use a link when its words name a place the reader can visit. A specific destination makes sense even when read out of the surrounding paragraph.
Read the guide
#Follow Reading guide to its own screen. Use Back to library to return and follow the link again.
components/link/appliance/read_guide.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class ReadGuide extends StatelessWidget {
const ReadGuide({super.key});
@override
Widget build(BuildContext context) => ApplianceLink(
'Reading guide',
onPressed: () => Navigator.of(context).push<void>(
PageRouteBuilder<void>(
pageBuilder: (context, animation, secondaryAnimation) => Padding(
padding: const EdgeInsets.all(20),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'Borrow a book for up to three weeks.',
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
ApplianceLink(
'Back to library',
onPressed: () => Navigator.of(context).pop(),
),
],
),
),
),
),
),
);
}
Parameters
ApplianceLink API ↗label- Destination name shown to the reader.
onPressed- Opens the guide or returns to the library.
Shared behaviour
- Keyboard and focus. Tab to the link and press Enter. The destination has its own return link.
- Screen readers. Read the destination name before following the link. At the destination, the guide text comes before the way back.
- Direction and type. Both screens keep the selected reading direction and text size. The destination text can wrap in the narrow frame.