build method

  1. @override
dynamic build(
  1. dynamic context,
  2. dynamic ref
)

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  final canSend = ref.watch(canSendProvider(roomId)).valueOrNull;
  if (canSend == null) {
    // we are still loading
    return loadingState(context);
  }
  if (canSend) {
    return _ChatInput(roomId: roomId, onTyping: onTyping);
  }

  return FrostEffect(
    child: Container(
      padding: const EdgeInsets.symmetric(vertical: 15),
      decoration: BoxDecoration(
        color: Theme.of(context).colorScheme.surface,
      ),
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 10),
        child: Row(
          children: [
            const SizedBox(width: 1),
            const Icon(
              Atlas.block_prohibited_thin,
              size: 14,
              color: Colors.grey,
            ),
            const SizedBox(width: 4),
            Text(
              key: noAccessKey,
              L10n.of(context).chatMissingPermissionsToSend,
              style: const TextStyle(color: Colors.grey, fontSize: 14),
            ),
          ],
        ),
      ),
    ),
  );
}