Flutter

Widget Testing

flutter_test, testWidgets, find, pump, WidgetTester, golden tests, integration tests

18 āļ„āļģāļ–āļēāļĄāļŠāļąāļĄāļ āļēāļĐāļ“āđŒÂ·
Mid-Level
1

Which package should be used to write widget tests in Flutter?

āļ„āļģāļ•āļ­āļš

The flutter_test package is the official package for writing widget tests in Flutter. It is automatically included in the Flutter SDK and provides all the necessary functions and classes to test widgets, such as testWidgets, find, pump and WidgetTester. This package extends Dart's test package with Flutter-specific features.

2

Which function should be used to define a widget test in Flutter?

āļ„āļģāļ•āļ­āļš

The testWidgets function is specifically designed for testing Flutter widgets. It provides a WidgetTester as a parameter to the callback which allows interaction with the widget under test. Unlike test() used for unit tests, testWidgets automatically manages the binding framework needed to render widgets and interact with them.

3

How to find a widget by its text in a Flutter test?

āļ„āļģāļ•āļ­āļš

The find class provides several methods to locate widgets, including find.text() which searches for a widget containing exactly the specified text. This is one of the most commonly used finders as it allows easily verifying the presence of text on screen. Other common finders include find.byType(), find.byKey() and find.byIcon().

4

What is the difference between pump() and pumpAndSettle() in widget tests?

5

How to simulate a tap on a button in a Flutter widget test?

+15 āļ„āļģāļ–āļēāļĄāļŠāļąāļĄāļ āļēāļĐāļ“āđŒ

āļŦāļąāļ§āļ‚āđ‰āļ­āļŠāļąāļĄāļ āļēāļĐāļ“āđŒ Flutter āļ­āļ·āđˆāļ™āđ†

Dart Basics

Junior
25 āļ„āļģāļ–āļēāļĄ

Dart Language Essentials

Junior
15 āļ„āļģāļ–āļēāļĄ

Flutter Fundamentals

Junior
18 āļ„āļģāļ–āļēāļĄ

Widget Lifecycle

Junior
20 āļ„āļģāļ–āļēāļĄ

Local Storage

Junior
20 āļ„āļģāļ–āļēāļĄ

Application Lifecycle

Junior
20 āļ„āļģāļ–āļēāļĄ

Layouts & Constraints

Mid-Level
24 āļ„āļģāļ–āļēāļĄ

ListView & GridView

Mid-Level
25 āļ„āļģāļ–āļēāļĄ

Navigation & Routing

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Basic State Management

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Provider Pattern

Mid-Level
18 āļ„āļģāļ–āļēāļĄ

Networking & HTTP

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

JSON Serialization

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

Local Database

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Forms & Validation

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

Animations

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

Firebase Integration

Mid-Level
18 āļ„āļģāļ–āļēāļĄ

Unit Testing

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

Build & Deployment

Mid-Level
16 āļ„āļģāļ–āļēāļĄ

Package Management

Mid-Level
16 āļ„āļģāļ–āļēāļĄ

Memory & Performance

Senior
22 āļ„āļģāļ–āļēāļĄ

Streams & RxDart

Senior
24 āļ„āļģāļ–āļēāļĄ

Advanced State Management

Senior
26 āļ„āļģāļ–āļēāļĄ

Flutter Design Patterns

Senior
24 āļ„āļģāļ–āļēāļĄ

Performance Optimization

Senior
26 āļ„āļģāļ–āļēāļĄ

Platform Channels

Senior
20 āļ„āļģāļ–āļēāļĄ

Custom Painting

Senior
22 āļ„āļģāļ–āļēāļĄ

Flutter Application Architecture

Senior
22 āļ„āļģāļ–āļēāļĄ

āđ€āļŠāļĩāđˆāļĒāļ§āļŠāļēāļ Flutter āļŠāļģāļŦāļĢāļąāļšāļāļēāļĢāļŠāļąāļĄāļ āļēāļĐāļ“āđŒāļ„āļĢāļąāđ‰āļ‡āļ–āļąāļ”āđ„āļ›

āđ€āļ‚āđ‰āļēāļ–āļķāļ‡āļ„āļģāļ–āļēāļĄāļ—āļąāđ‰āļ‡āļŦāļĄāļ” flashcards āđāļšāļšāļ—āļ”āļŠāļ­āļšāđ€āļ—āļ„āļ™āļīāļ„ āđāļšāļšāļāļķāļāļŦāļąāļ” code review āđāļĨāļ°āļ•āļąāļ§āļˆāļģāļĨāļ­āļ‡āļŠāļąāļĄāļ āļēāļĐāļ“āđŒ

āđ€āļĢāļīāđˆāļĄāđƒāļŠāđ‰āļŸāļĢāļĩ