Google uses cookies to deliver its services, to personalize ads, and to analyze traffic. You can adjust your privacy controls anytime in your Google settings. Learn more.

Flutter logo
    • Get started
      • 1. Install
      • 2. Set up an editor
      • 3. Test drive
      • 4. Write your first app
      • 5. Learn more
      • From another platform?
        • Flutter for Android devs
        • Flutter for SwiftUI devs
        • Flutter for UIKit devs
        • Flutter for React Native devs
        • Flutter for web devs
        • Flutter for Xamarin.Forms devs
        • Introduction to declarative UI
        • Flutter versus Swift concurrency
      • Dart language overview open_in_new
    • Stay up to date
      • Upgrade
      • SDK archive
      • What's new
      • Release notes
      • Breaking changes
      • Compatibility policy
    • Samples & codelabs
      • Flutter Gallery open_in_new
      • Samples and demos open_in_new
      • Cookbook
      • Codelabs
    • User interface
    • Introduction
    • Widget catalog
    • Layout
      • Introduction
      • Build a layout
      • Lists & grids
        • Create and use lists
        • Create a horizontal list
        • Create a grid view
        • Create lists with different types of items
        • Create lists with spaced items
        • Work with long lists
      • Scrolling
        • Overview
        • Use slivers to achieve fancy scrolling
        • Place a floating app bar above a list
        • Create a scrolling parallax effect
      • Adaptive design
        • Adaptive and responsive app design
        • Build an adaptive app
        • Update app UI based on orientation
    • Design & theming
      • Share styles with themes
      • Material design
      • Text
        • Fonts & typography
        • Use a custom font
        • Export fonts from a package
        • Google Fonts package open_in_new
      • Custom graphics
        • Use custom fragment shaders
    • Interactivity
      • Add interactivity to your app
      • Gestures
        • Introduction
        • Handle taps
        • Drag a UI element
        • Add Material touch ripples
        • Implement swipe to dismiss
      • Input & forms
        • Create and style a text field
        • Retrieve the value of a text field
        • Handle changes to a text field
        • Manage focus in text fields
        • Build a form with validation
      • Display a snackbar
      • Implement actions & shortcuts
      • Manage keyboard focus
    • Assets & media
      • Add assets and images
      • Display images from the internet
      • Fade in images with a placeholder
      • Play and pause a video
    • Navigation & routing
      • Overview
      • Add tabs to your app
      • Navigate to a new screen and back
      • Send data to a new screen
      • Return data from a screen
      • Add a drawer to a screen
      • Setup deep linking
      • Setup app links for Android
      • Setup universal links for iOS
      • Configure web URL strategies
    • Animations & transitions
      • Introduction
      • Tutorial
      • Implicit animations
      • Animate the properties of a container
      • Fade a widget in and out
      • Hero animations
      • Animate a page route transition
      • Animate using a physic simulation
      • Staggered animations
      • Create a staggered menu animation
      • API overview
    • Accessibility & localization
      • Accessibility
      • Internationalization
    • Beyond UI
    • Data & backend
      • State management
        • Introduction
        • Think declaratively
        • Ephemeral vs app state
        • Simple app state management
        • Options
      • Networking & http
        • Overview
        • Fetch data from the internet
        • Make authenticated requests
        • Send data to the internet
        • Update data over the internet
        • Delete data on the internet
        • Communicate with WebSockets
      • Serialization
        • JSON serialization
        • Parse JSON in the background
      • Persistence
        • Store key-value data on disk
        • Read and write files
        • Persist data with SQLite
      • Firebase
      • Google APIs
    • Platform integration
      • Supported platforms
      • Build desktop apps with Flutter
      • Write platform-specific code
      • Automatic platform adaptations
      • Android
        • Add a splash screen
        • Bind to native code
        • Host a native Android view
        • Restore state on Android
        • Target ChromeOS with Android
      • iOS
        • Leverage Apple's system libraries
        • Add a launch screen
        • Add iOS App Clip support
        • Add iOS app extensions
        • Bind to native code
        • Host a native iOS view
        • Enable debugging on iOS
        • Restore state on iOS
      • Linux
        • Build a Linux app
      • macOS
        • Build a macOS app
        • C interop
      • Web
        • Build a web app
        • Web FAQ
        • Web renderers
        • Custom app initialization
        • Displaying images on the web
      • Windows
        • Build a Windows app
    • Packages & plugins
      • Use packages & plugins
      • Develop packages & plugins
      • Flutter Favorites
      • Package repository open_in_new
    • Testing & debugging
      • Testing
      • Testing overview
      • Widget testing
        • Introduction
        • Find widgets
        • Simulate scrolling
        • Simulate user interaction
      • Integration testing
        • Introduction
        • Write and run an integration test
        • Profile an integration test
      • Unit testing
        • Introduction
        • Mock dependencies
      • Test a plugin
      • Handle plugin code in tests
      • Debugging
      • Debugging tools
      • Debug your app programmatically
      • Use a native language debugger
      • Flutter's build modes
      • Common Flutter errors
      • Handle errors
      • Report errors to a service
    • Performance & optimization
      • Overview
      • Impeller
      • Performance best practices
      • App size
      • Deferred components
      • Rendering performance
      • Performance profiling
      • Performance profiling for web
      • Shader compilation jank
      • Performance metrics
      • Performance FAQ
      • Appendix
    • Deployment
      • Obfuscate Dart code
      • Create flavors of an app
      • Build and release an Android app
      • Build and release an iOS app
      • Build and release a macOS app
      • Build and release a Linux app
      • Build and release a Windows app
      • Build and release a web app
      • Set up continuous deployment
    • Add to an existing app
      • Introduction
      • Add to an Android app
        • Set up Android project
        • Add a single Flutter screen
        • Add a Flutter Fragment
        • Add a Flutter View
        • Use a Flutter plugin
      • Add to an iOS app
        • Set up iOS project
        • Add a single Flutter screen
      • Debug embedded Flutter module
      • Add multiple Flutter instances
      • Loading sequence and performance
    • Tools & editors
      • Android Studio & IntelliJ
      • Visual Studio Code
      • DevTools
        • Overview
        • Install from Android Studio & IntelliJ
        • Install from VS Code
        • Install from command line
        • Flutter inspector
        • Performance view
        • CPU Profiler view
        • Memory view
        • Debug console view
        • Network view
        • Debugger
        • Logging view
        • App size tool
        • Release notes
      • SDK overview
      • Flutter's pubspec options
      • Automated fixes
      • Code formatting
    • Flutter concepts
      • Architectural overview
      • Inside Flutter
      • Understanding constraints
      • Flutter's build modes
      • Hot reload
    • Resources
      • Learning
      • FAQ
      • Books
      • Videos
      • Courses
      • Learn Dart
      • Contributing
      • Create useful bug reports
      • Contribute to Flutter open_in_new
      • Design documents
      • Toolkits
      • Casual Games Toolkit
      • Flutter News Toolkit
    • Reference
      • Who is Dash?
      • Widget index
      • API reference open_in_new
      • flutter CLI reference
  • Multi-Platform
    Mobile Web Desktop Embedded
  • Development
    Learn Flutter Favorites Packages Monetization Games News
  • Ecosystem
    Community Events Culture
  • Showcase
  • Docs
    What's new Editor support Hot reload Profiling Install Flutter DevTools Cookbook Codelabs
Get started
Flutter 3.13 scrolls into view!
Check out the announcement and the what's new page
  • Get started
    • 1. Install
    • 2. Set up an editor
    • 3. Test drive
    • 4. Write your first app
    • 5. Learn more
    • From another platform?
      • Flutter for Android devs
      • Flutter for SwiftUI devs
      • Flutter for UIKit devs
      • Flutter for React Native devs
      • Flutter for web devs
      • Flutter for Xamarin.Forms devs
      • Introduction to declarative UI
      • Flutter versus Swift concurrency
    • Dart language overview open_in_new
  • Stay up to date
    • Upgrade
    • SDK archive
    • What's new
    • Release notes
    • Breaking changes
    • Compatibility policy
  • Samples & codelabs
    • Flutter Gallery open_in_new
    • Samples and demos open_in_new
    • Cookbook
    • Codelabs
  • User interface
  • Introduction
  • Widget catalog
  • Layout
    • Introduction
    • Build a layout
    • Lists & grids
      • Create and use lists
      • Create a horizontal list
      • Create a grid view
      • Create lists with different types of items
      • Create lists with spaced items
      • Work with long lists
    • Scrolling
      • Overview
      • Use slivers to achieve fancy scrolling
      • Place a floating app bar above a list
      • Create a scrolling parallax effect
    • Adaptive design
      • Adaptive and responsive app design
      • Build an adaptive app
      • Update app UI based on orientation
  • Design & theming
    • Share styles with themes
    • Material design
    • Text
      • Fonts & typography
      • Use a custom font
      • Export fonts from a package
      • Google Fonts package open_in_new
    • Custom graphics
      • Use custom fragment shaders
  • Interactivity
    • Add interactivity to your app
    • Gestures
      • Introduction
      • Handle taps
      • Drag a UI element
      • Add Material touch ripples
      • Implement swipe to dismiss
    • Input & forms
      • Create and style a text field
      • Retrieve the value of a text field
      • Handle changes to a text field
      • Manage focus in text fields
      • Build a form with validation
    • Display a snackbar
    • Implement actions & shortcuts
    • Manage keyboard focus
  • Assets & media
    • Add assets and images
    • Display images from the internet
    • Fade in images with a placeholder
    • Play and pause a video
  • Navigation & routing
    • Overview
    • Add tabs to your app
    • Navigate to a new screen and back
    • Send data to a new screen
    • Return data from a screen
    • Add a drawer to a screen
    • Setup deep linking
    • Setup app links for Android
    • Setup universal links for iOS
    • Configure web URL strategies
  • Animations & transitions
    • Introduction
    • Tutorial
    • Implicit animations
    • Animate the properties of a container
    • Fade a widget in and out
    • Hero animations
    • Animate a page route transition
    • Animate using a physic simulation
    • Staggered animations
    • Create a staggered menu animation
    • API overview
  • Accessibility & localization
    • Accessibility
    • Internationalization
  • Beyond UI
  • Data & backend
    • State management
      • Introduction
      • Think declaratively
      • Ephemeral vs app state
      • Simple app state management
      • Options
    • Networking & http
      • Overview
      • Fetch data from the internet
      • Make authenticated requests
      • Send data to the internet
      • Update data over the internet
      • Delete data on the internet
      • Communicate with WebSockets
    • Serialization
      • JSON serialization
      • Parse JSON in the background
    • Persistence
      • Store key-value data on disk
      • Read and write files
      • Persist data with SQLite
    • Firebase
    • Google APIs
  • Platform integration
    • Supported platforms
    • Build desktop apps with Flutter
    • Write platform-specific code
    • Automatic platform adaptations
    • Android
      • Add a splash screen
      • Bind to native code
      • Host a native Android view
      • Restore state on Android
      • Target ChromeOS with Android
    • iOS
      • Leverage Apple's system libraries
      • Add a launch screen
      • Add iOS App Clip support
      • Add iOS app extensions
      • Bind to native code
      • Host a native iOS view
      • Enable debugging on iOS
      • Restore state on iOS
    • Linux
      • Build a Linux app
    • macOS
      • Build a macOS app
      • C interop
    • Web
      • Build a web app
      • Web FAQ
      • Web renderers
      • Custom app initialization
      • Displaying images on the web
    • Windows
      • Build a Windows app
  • Packages & plugins
    • Use packages & plugins
    • Develop packages & plugins
    • Flutter Favorites
    • Package repository open_in_new
  • Testing & debugging
    • Testing
    • Testing overview
    • Widget testing
      • Introduction
      • Find widgets
      • Simulate scrolling
      • Simulate user interaction
    • Integration testing
      • Introduction
      • Write and run an integration test
      • Profile an integration test
    • Unit testing
      • Introduction
      • Mock dependencies
    • Test a plugin
    • Handle plugin code in tests
    • Debugging
    • Debugging tools
    • Debug your app programmatically
    • Use a native language debugger
    • Flutter's build modes
    • Common Flutter errors
    • Handle errors
    • Report errors to a service
  • Performance & optimization
    • Overview
    • Impeller
    • Performance best practices
    • App size
    • Deferred components
    • Rendering performance
    • Performance profiling
    • Performance profiling for web
    • Shader compilation jank
    • Performance metrics
    • Performance FAQ
    • Appendix
  • Deployment
    • Obfuscate Dart code
    • Create flavors of an app
    • Build and release an Android app
    • Build and release an iOS app
    • Build and release a macOS app
    • Build and release a Linux app
    • Build and release a Windows app
    • Build and release a web app
    • Set up continuous deployment
  • Add to an existing app
    • Introduction
    • Add to an Android app
      • Set up Android project
      • Add a single Flutter screen
      • Add a Flutter Fragment
      • Add a Flutter View
      • Use a Flutter plugin
    • Add to an iOS app
      • Set up iOS project
      • Add a single Flutter screen
    • Debug embedded Flutter module
    • Add multiple Flutter instances
    • Loading sequence and performance
  • Tools & editors
    • Android Studio & IntelliJ
    • Visual Studio Code
    • DevTools
      • Overview
      • Install from Android Studio & IntelliJ
      • Install from VS Code
      • Install from command line
      • Flutter inspector
      • Performance view
      • CPU Profiler view
      • Memory view
      • Debug console view
      • Network view
      • Debugger
      • Logging view
      • App size tool
      • Release notes
    • SDK overview
    • Flutter's pubspec options
    • Automated fixes
    • Code formatting
  • Flutter concepts
    • Architectural overview
    • Inside Flutter
    • Understanding constraints
    • Flutter's build modes
    • Hot reload
  • Resources
    • Learning
    • FAQ
    • Books
    • Videos
    • Courses
    • Learn Dart
    • Contributing
    • Create useful bug reports
    • Contribute to Flutter open_in_new
    • Design documents
    • Toolkits
    • Casual Games Toolkit
    • Flutter News Toolkit
  • Reference
    • Who is Dash?
    • Widget index
    • API reference open_in_new
    • flutter CLI reference
description bug_report

Widget

  1. Cookbook
  2. Testing
  3. Widget
  • An introduction to widget testing
  • Find widgets
  • Handle scrolling
  • Tap, drag, and enter text
Flutter Logo
  • terms
  • brand usage
  • security
  • privacy
  • español
  • 社区中文资源
  • We stand in solidarity with the Black community. Black Lives Matter.

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the BSD License.