mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
As a proof of concept some widgets were seperated. The home screen now links to this instead of the recording editor.
26 lines
606 B
Dart
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();
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|