Skip to content

Instantly share code, notes, and snippets.

@bltavares
Created July 5, 2022 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bltavares/9c36cbdd3cb8b0079a92ff97b35eb7d5 to your computer and use it in GitHub Desktop.
Save bltavares/9c36cbdd3cb8b0079a92ff97b35eb7d5 to your computer and use it in GitHub Desktop.
elegant-sparkle-3214

elegant-sparkle-3214

Created with <3 with dartpad.dev.

import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(),
body: MyWidget(),
),
);
}
}
class NoisyText extends StatefulWidget {
final String text;
const NoisyText(this.text, {super.key});
@override
State<NoisyText> createState() => _NoisyTextState();
}
class _NoisyTextState extends State<NoisyText> {
@override
void initState() {
super.initState();
print(widget.text);
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
padding: const EdgeInsets.all(50),
child: Text(widget.text),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CustomScrollView(slivers: [
SliverList(
delegate: SliverChildListDelegate(
[
Column(
children: List.generate(
1000,
(index) => NoisyText('Hello $index'),
))
],
))
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment