Skip to content

(FWE) Update chapter 8 Tile widget #13138

@lamek

Description

@lamek

Page URL

https://docs.flutter.dev/learn/pathway/tutorial/implicit-animations

Page source

src/content/learn/pathway/tutorial/implicit-animations.md

Describe the problem

Refactor the code samples on this page to update the Tile widget.

Final code:

class Tile extends StatelessWidget {
  const Tile(this.letter, this.hitType, {super.key});

  final String letter;
  final HitType hitType;

  @override
  Widget build(BuildContext context) {
    return AnimatedContainer(
      duration: const Duration(milliseconds: 500),
      curve: Curves.bounceIn, // NEW
      height: 60,
      width: 60,
      decoration: BoxDecoration(
        border: Border.all(color: Colors.grey.shade300),
        color: switch (hitType) {
          HitType.hit => Colors.green,
          HitType.partial => Colors.yellow,
          HitType.miss => Colors.grey,
          _ => Colors.white,
        },
      ),
      child: Center(
        child: Text(
          letter.toUpperCase(),
          style: Theme.of(context).textTheme.titleLarge,
        ),
      ),
    );
  }
}

Expected fix

No response

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.

Metadata

Metadata

Assignees

Labels

a.tut.tutorialRelates to the Tutorial section of docs.flutter.deve1-hoursEffort: < 8 hrsfrom.page-issueReported in a reader-filed concernp1-highMajor but not urgent concern: Resolve in months. Update each month.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions