import 'package:flutter/material.dart'; import 'package:forui/forui.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( builder: (context, child) => FTheme(data: FThemes.green.light, child: child!), home: const FTabExamplePage(), ); } } class FTabExamplePage extends StatefulWidget { const FTabExamplePage({super.key}); @override State createState() => _FTabExamplePageState(); } class _FTabExamplePageState extends State with SingleTickerProviderStateMixin { late final FTabController _tabController = FTabController( length: 3, vsync: this, ); @override Widget build(BuildContext context) { return FScaffold( header: FHeader.nested( title: Text('FTabs Example'), prefixActions: [FHeaderAction.back(onPress: () {})], ), content: FTabs( controller: _tabController, tabs: [ FTabEntry( label: Text('One'), content: Column( children: [ FCard(title: Text('One'), subtitle: Text('Content for one.')), SizedBox(height: 16), SizedBox( width: 300, child: FButton( suffix: FIcon(FAssets.icons.chevronRight), label: Text('Move to Two'), onPress: () { _tabController.animateTo(1); }, ), ), ], ), ), FTabEntry( label: Text('Two'), content: Column( children: [ FCard(title: Text('Two'), subtitle: Text('Content for two.')), SizedBox(height: 16), SizedBox( width: 300, child: FButton( suffix: FIcon(FAssets.icons.chevronRight), label: Text('Move to Three'), onPress: () { _tabController.animateTo(2); }, ), ), ], ), ), FTabEntry( label: Text('Three'), content: Column( children: [ FCard( title: Text('Three'), subtitle: Text('Content for Three.'), ), SizedBox(height: 16), SizedBox( width: 300, child: FButton( suffix: FIcon(FAssets.icons.chevronLeft), label: Text('Move to One'), onPress: () { _tabController.animateTo(0); }, ), ), ], ), ), ], ), ); } }