| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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<FriendsPage> createState() => _FriendsPageState();
- }
- class _FriendsPageState extends State<FriendsPage> {
- static const List<Widget> _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),
- ),
- ),
- ),
- );
- }
- }
|