Skip to content

Instantly share code, notes, and snippets.

View Roaa94's full-sized avatar
💙

Roaa Roaa94

💙
View GitHub Profile
@craiglabenz
craiglabenz / chat_message_render_box.dart
Last active June 28, 2024 06:04
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
@immutable
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
ClipShadowPath({
@required this.shadow,