import 'package:flutter/material.dart'; import 'widgets/friends_list.dart'; import 'widgets/requests.dart'; class FriendsPage extends StatefulWidget { const FriendsPage({Key? key}) : super(key: key); @override State createState() => _FriendsPageState(); } class _FriendsPageState extends State { static const List _widgets = [ FriendsList(), Requests(), ]; @override Widget build(BuildContext context) { return DefaultTabController( length: 2, child: Scaffold( appBar: AppBar( automaticallyImplyLeading: false, bottom: TabBar( tabs: [ Tab( child: Column( children: const [ Icon(Icons.people), Text("Friends"), ], ), ), Tab( child: Column( children: const [ Icon(Icons.notifications), Text("Requests"), ], ), ), ], ), ), body: const Center( child: Padding( padding: EdgeInsets.all(32.0), child: TabBarView(children: _widgets), ), ), ), ); } }