Skip to content

Commit

Permalink
docs(example): make add_many example more understandable
Browse files Browse the repository at this point in the history
  • Loading branch information
benthillerkus committed Apr 18, 2022
1 parent 35583f7 commit 5cadfb8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions example/add_many/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ class _MyAppState extends State<MyApp> {
setState(() {});

icon.setImage(
pixels:
(await img?.toByteData(format: ui.ImageByteFormat.rawRgba))?.buffer,
// asset: "assets/flutter.ico",
winIcon: WinIcon.shield);
pixels:
(await img?.toByteData(format: ui.ImageByteFormat.rawRgba))?.buffer,
// asset: "assets/flutter.ico",
// winIcon: WinIcon.shield
);
icon.show();
}

Expand All @@ -91,7 +92,7 @@ class _MyAppState extends State<MyApp> {
Center(
child: AnimatedScale(
duration: const Duration(milliseconds: 200),
scale: sqrt(sqrt(_icons.length + 1)),
scale: _icons.isEmpty ? 0 : sqrt(sqrt(_icons.length + 1)),
curve: Curves.easeOutBack,
child: SizedBox(
child: CustomPaint(
Expand All @@ -105,16 +106,16 @@ class _MyAppState extends State<MyApp> {
Opacity(
opacity: .4,
child: GridView.builder(
itemCount: _icons.length,
itemCount: max(0, _icons.length - 1),
padding: const EdgeInsets.all(8),
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 32 + 16),
itemBuilder: (context, index) => Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8),
child: Tooltip(
message: "$index",
message: "${index + 1}", // There is no 0th item
child: CustomPaint(
painter: DebugGraphic(index),
painter: DebugGraphic(index + 1),
),
),
),
Expand Down

0 comments on commit 5cadfb8

Please sign in to comment.