2020-03-28 09:39:59 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import '../state/music_store.dart';
|
2020-03-28 11:08:43 +01:00
|
|
|
import 'albums_page.dart';
|
2020-04-03 13:55:15 +02:00
|
|
|
import 'songs_page.dart';
|
2020-03-28 09:39:59 +01:00
|
|
|
|
2020-04-03 13:55:15 +02:00
|
|
|
class LibraryPage extends StatefulWidget {
|
2020-03-28 09:39:59 +01:00
|
|
|
const LibraryPage({Key key, @required this.store}) : super(key: key);
|
|
|
|
|
|
|
|
final MusicStore store;
|
|
|
|
|
|
|
|
@override
|
2020-04-03 13:55:15 +02:00
|
|
|
_LibraryPageState createState() => _LibraryPageState();
|
|
|
|
}
|
|
|
|
|
2020-04-03 15:51:43 +02:00
|
|
|
class _LibraryPageState extends State<LibraryPage> {
|
2020-04-03 13:55:15 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
print('LibraryPage.build');
|
2020-04-03 15:51:43 +02:00
|
|
|
return DefaultTabController(
|
|
|
|
length: 3,
|
|
|
|
child: SafeArea(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
const TabBar(
|
|
|
|
tabs: <Tab>[
|
|
|
|
Tab(
|
|
|
|
text: 'Artists',
|
2020-04-03 13:55:15 +02:00
|
|
|
),
|
2020-04-03 15:51:43 +02:00
|
|
|
Tab(
|
|
|
|
text: 'Albums',
|
2020-04-03 13:55:15 +02:00
|
|
|
),
|
2020-04-03 15:51:43 +02:00
|
|
|
Tab(
|
|
|
|
text: 'Songs',
|
2020-04-03 13:55:15 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2020-04-03 15:51:43 +02:00
|
|
|
Expanded(
|
|
|
|
child: TabBarView(
|
|
|
|
children: <Widget>[
|
|
|
|
const Center(
|
|
|
|
child: Text('Artists'),
|
|
|
|
),
|
|
|
|
AlbumsPage(
|
|
|
|
key: const PageStorageKey('AlbumsPage'),
|
|
|
|
store: widget.store,
|
|
|
|
),
|
|
|
|
SongsPage(
|
|
|
|
key: const PageStorageKey('SongsPage'),
|
|
|
|
store: widget.store,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
2020-04-03 13:55:15 +02:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2020-03-28 09:39:59 +01:00
|
|
|
}
|