Skip to content

Instantly share code, notes, and snippets.

@flar
Created February 4, 2026 09:25
Show Gist options
  • Select an option

  • Save flar/f85c3ccf48386e6e72b3abe762277643 to your computer and use it in GitHub Desktop.

Select an option

Save flar/f85c3ccf48386e6e72b3abe762277643 to your computer and use it in GitHub Desktop.
Attempt to demonstrate issue with caching FrameData in TextFrame in Impeller
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
Widget text = RepaintBoundary(
child: Center(
child: SizedBox(
width: 40,
height: 40,
child: Center(
child: SizedBox(
width: 30,
height: 30,
child: DecoratedBox(
decoration: BoxDecoration(
border: BoxBorder.all(
color: Colors.blue,
width: 2,
),
),
child: Center(
child: Text('hi'),
),
),
),
),
),
),
);
Random random = Random();
random.nextDouble();
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: .center,
children: [
for (int i = 0; i < 8; i++)
Row(
mainAxisAlignment: .center,
children: [
for (int j = 0; j < 16; j++)
Transform.scale(
scale: random.nextDouble() * 0.75 + 0.5,
child: text,
),
],
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment