1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Created inline user picker

This commit is contained in:
2019-04-27 14:40:27 +02:00
parent 09d43ab5c0
commit 765ca82300
3 changed files with 179 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import 'package:comunic/models/user.dart';
import 'package:comunic/ui/widgets/account_image_widget.dart';
import 'package:flutter/material.dart';
/// Simple user tile
///
/// Basically this only shows the name of the user + its account image
///
/// @author Pierre HUBERT
typedef OnUserTap = void Function(User);
class SimpleUserTile extends StatelessWidget {
final User user;
final OnUserTap onTap;
const SimpleUserTile({Key key, this.user, this.onTap})
: assert(user != null),
super(key: key);
@override
Widget build(BuildContext context) {
return ListTile(
onTap: onTap == null ? null : () => onTap(user),
leading: AccountImageWidget(
user: user,
),
title: Text(user.fullName),
);
}
}