Created
December 4, 2025 08:34
-
-
Save hawkkiller/21aaa3cdbf74ad347ab18c3be32770af to your computer and use it in GitHub Desktop.
A heavy card to simulate performance problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class _SomeHeavyCard extends StatelessWidget { | |
| const _SomeHeavyCard({required this.index}); | |
| final int index; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Card( | |
| elevation: 10, | |
| margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), | |
| shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)), | |
| child: ClipRRect( | |
| borderRadius: BorderRadius.circular(24), | |
| child: Stack( | |
| children: [ | |
| // Gradient background | |
| Container( | |
| height: 180, | |
| decoration: const BoxDecoration( | |
| gradient: LinearGradient( | |
| colors: [Color(0xFF7F53AC), Color(0xFF647DEE), Color(0xFFFFA69E)], | |
| begin: Alignment.topLeft, | |
| end: Alignment.bottomRight, | |
| ), | |
| ), | |
| ), | |
| // Radial light blur effect | |
| Positioned.fill( | |
| child: Align( | |
| alignment: Alignment.topRight, | |
| child: ClipOval( | |
| child: Container( | |
| width: 110, | |
| height: 110, | |
| decoration: BoxDecoration( | |
| gradient: RadialGradient( | |
| colors: [Colors.white.withOpacity(0.32), Colors.transparent], | |
| radius: 0.8, | |
| ), | |
| ), | |
| ), | |
| ), | |
| ), | |
| ), | |
| // Content | |
| Padding( | |
| padding: const EdgeInsets.all(32.0), | |
| child: Row( | |
| children: [ | |
| ClipRRect( | |
| borderRadius: BorderRadius.circular(16), | |
| child: Container( | |
| width: 56, | |
| height: 56, | |
| decoration: BoxDecoration( | |
| gradient: SweepGradient( | |
| colors: [ | |
| Colors.deepPurpleAccent, | |
| Colors.blue, | |
| Colors.cyan, | |
| Colors.deepPurpleAccent, | |
| ], | |
| startAngle: 0.1, | |
| endAngle: 3.2, | |
| ), | |
| ), | |
| child: const Icon(Icons.stars, color: Colors.white, size: 36), | |
| ), | |
| ), | |
| const SizedBox(width: 30), | |
| Expanded( | |
| child: ClipRRect( | |
| borderRadius: BorderRadius.circular(12), | |
| child: BackdropFilter( | |
| filter: ImageFilter.blur(sigmaX: 1.5, sigmaY: 1.5), | |
| child: Container( | |
| padding: const EdgeInsets.all(12.0), | |
| decoration: BoxDecoration( | |
| color: Colors.white.withOpacity(0.2), | |
| borderRadius: BorderRadius.circular(12), | |
| ), | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| Text( | |
| 'Item $index', | |
| style: Theme.of(context).textTheme.headlineSmall?.copyWith( | |
| fontWeight: FontWeight.bold, | |
| color: Colors.white, | |
| shadows: [ | |
| const Shadow( | |
| blurRadius: 8, | |
| color: Colors.black26, | |
| offset: Offset(1, 2), | |
| ), | |
| ], | |
| ), | |
| ), | |
| const SizedBox(height: 10), | |
| Container( | |
| decoration: BoxDecoration( | |
| borderRadius: BorderRadius.circular(8), | |
| gradient: const LinearGradient( | |
| colors: [Color(0xFF6A11CB), Color(0xFF2575FC)], | |
| begin: Alignment.bottomLeft, | |
| end: Alignment.topRight, | |
| ), | |
| ), | |
| padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), | |
| child: Text( | |
| 'Heavy Stuff', | |
| style: Theme.of(context).textTheme.titleSmall?.copyWith( | |
| color: Colors.white, | |
| fontWeight: FontWeight.w600, | |
| ), | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ), | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment