import 'package:flutter/material.dart'; import 'albums_page.dart'; import 'songs_page.dart'; class LibraryTabContainer extends StatelessWidget { const LibraryTabContainer({Key key}) : super(key: key); @override Widget build(BuildContext context) { return DefaultTabController( length: 3, child: SafeArea( child: Column( children: [ Container( color: Colors.grey[900], child: TabBar( tabs: [ Tab( text: 'Artists', ), Tab( text: 'Albums', ), Tab( text: 'Songs', ), ], ), ), Expanded( child: TabBarView( children: [ Center( child: Text('Artists'), ), AlbumsPage( key: PageStorageKey('AlbumsPage'), ), SongsPage( key: PageStorageKey('SongsPage'), ), ], ), ) ], ), ), ); } }