buildNavigationIndicatorPreview function
- @Preview(name: 'Navigation Indicator')
Widget
buildNavigationIndicatorPreview(
)
Implementation
@Preview(name: 'Navigation Indicator')
Widget buildNavigationIndicatorPreview() => MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3: true,
),
home: Scaffold(
appBar: AppBar(
title: const Text('Navigation Indicators'),
backgroundColor: Colors.green.shade50,
),
body: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildSectionTitle('Indicator Shapes'),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
VooNavigationIndicator(isSelected: true, child: Icon(Icons.home)),
VooNavigationIndicator(
isSelected: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: const Icon(Icons.search),
),
VooNavigationIndicator(
isSelected: true,
shape: CircleBorder(),
child: Icon(Icons.person),
),
],
),
const SizedBox(height: 32),
_buildSectionTitle('Custom Colors'),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
VooNavigationIndicator(
isSelected: true,
color: Colors.purple.shade100,
child: const Icon(Icons.favorite, color: Colors.purple),
),
VooNavigationIndicator(
isSelected: true,
color: Colors.orange.shade100,
child: const Icon(Icons.star, color: Colors.orange),
),
VooNavigationIndicator(
isSelected: true,
color: Colors.blue.shade100,
child: const Icon(Icons.bookmark, color: Colors.blue),
),
],
),
],
),
),
),
);