musicus_mobile/lib/widgets/person_text.dart
Elias Projahn 0438296bcc Add recording selector
As a proof of concept some widgets were seperated. The home screen now
links to this instead of the recording editor.
2020-04-05 19:31:46 +02:00

26 lines
606 B
Dart

import 'package:flutter/material.dart';
import '../backend.dart';
import '../database.dart';
class PersonText extends StatelessWidget {
final int personId;
PersonText(this.personId);
@override
Widget build(BuildContext context) {
final backend = Backend.of(context);
return StreamBuilder<Person>(
stream: backend.db.personById(personId).watchSingle(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Text('${snapshot.data.firstName} ${snapshot.data.lastName}');
} else {
return Container();
}
},
);
}
}