| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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: _widgets.length,
- child: Scaffold(
- appBar: AppBar(
- automaticallyImplyLeading: false,
- bottom: const TabBar(
- tabs: [
- Tab(child: Text("Friends", style: TextStyle(fontSize: 18))),
- Tab(child: Text("Requests", style: TextStyle(fontSize: 18))),
- ],
- ),
- ),
- body: const Center(
- child: Padding(
- padding: EdgeInsets.all(32.0),
- child: TabBarView(children: _widgets),
- ),
- ),
- ),
- );
- }
- }
|