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:
31
lib/ui/tiles/simple_user_tile.dart
Normal file
31
lib/ui/tiles/simple_user_tile.dart
Normal 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),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user