mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Add recording tile
This commit is contained in:
parent
e834abe1e0
commit
0145206ed2
1 changed files with 56 additions and 0 deletions
56
lib/widgets/recording_tile.dart
Normal file
56
lib/widgets/recording_tile.dart
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../backend.dart';
|
||||||
|
import '../database.dart';
|
||||||
|
|
||||||
|
import 'texts.dart';
|
||||||
|
|
||||||
|
class RecordingTile extends StatelessWidget {
|
||||||
|
final int recordingId;
|
||||||
|
final void Function() onTap;
|
||||||
|
|
||||||
|
RecordingTile({
|
||||||
|
this.recordingId,
|
||||||
|
this.onTap,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final backend = Backend.of(context);
|
||||||
|
final textTheme = Theme.of(context).textTheme;
|
||||||
|
|
||||||
|
return StreamBuilder<Recording>(
|
||||||
|
stream: backend.db.recordingById(recordingId).watchSingle(),
|
||||||
|
builder: (context, snapshot) => ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
if (snapshot.hasData) ...[
|
||||||
|
DefaultTextStyle(
|
||||||
|
style: textTheme.subtitle1,
|
||||||
|
child: ComposersText(snapshot.data.work),
|
||||||
|
),
|
||||||
|
DefaultTextStyle(
|
||||||
|
style: textTheme.headline6,
|
||||||
|
child: WorkText(snapshot.data.work),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
const SizedBox(
|
||||||
|
height: 4.0,
|
||||||
|
),
|
||||||
|
DefaultTextStyle(
|
||||||
|
style: textTheme.bodyText1,
|
||||||
|
child: PerformancesText(recordingId),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: onTap,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue