|
|
- An introduction to widget testing - Flutter
In the introduction to unit testing recipe, you learned how to test Dart classes using the test package To test widget classes, you need a few additional tools provided by the flutter_test package, which ships with the Flutter SDK The flutter_test package provides the following tools for testing widgets: The WidgetTester allows building and interacting with widgets in a test environment The
- Testing Flutter apps
Widget tests A widget test (in other UI frameworks referred to as component test) tests a single widget The goal of a widget test is to verify that the widget's UI looks and interacts as expected Testing a widget involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context
- Flutter
> How to handle scrolling in a widget test Many apps feature lists of content, from email clients to music apps and beyond To verify that lists contain the expected content using widget tests, you need a way to scroll through lists to search for particular items To scroll through lists via integration tests, use the methods provided by the [`WidgetTester`][] class, which is included in the
- Tap, drag, and enter text - Flutter
In the test environment, Flutter doesn't automatically rebuild widgets when the state changes To ensure that the widget tree is rebuilt after simulating a user interaction, call the pump() or pumpAndSettle() methods provided by the WidgetTester This recipe uses the following steps: Create a widget to test Enter text in the text field
- Handle scrolling - Flutter
How to handle scrolling in a widget test Now, you can write a test In this example, scroll through the list of items and verify that a particular item exists in the list The WidgetTester class provides the scrollUntilVisible() method, which scrolls through a list until a specific widget is visible This is useful because the height of the items in the list can change depending on the device
- Find widgets - Flutter
During a flutter run session on a widget test, you can also interactively tap parts of the screen for the Flutter tool to print the suggested Finder This recipe looks at the find constant provided by the flutter_test package, and demonstrates how to work with some of the Finders it provides
- Accessibility testing - Flutter
Testing accessibility on mobile Test your app using Flutter's Accessibility Guideline API This API checks if your app's UI meets Flutter's accessibility recommendations These cover recommendations for text contrast, target size, and target labels The following snippet shows how to use the Guideline API on a sample widget named AccessibleApp:
- Visual Studio Code - Flutter
Flutter Property Editor The Flutter Property Editor is a powerful tool provided by the Flutter extension that lets you view and modify widget properties directly from its visual interface
- Testing each layer - Flutter
Testing the UI layer One way to determine whether your architecture is sound is considering how easy (or difficult) the application is to test Because view models and views have well-defined inputs, their dependencies can easily be mocked or faked, and unit tests are easily written
|
|
英文每年常用名排名 2024 年排名 2023 年排名 2022 年排名 2021 年排名 2020 年排名 2019 年排名 2018 年排名 2017 年排名 2016 年排名 2015 年排名 2014 年排名 2013 年排名 2012 年排名 2011 年排名 2010 年排名 2009 年排名 2008 年排名 2007 年排名 2006 年排名 2005 年排名 2004 年排名 2003 年排名 2002 年排名 2001 年排名
英文名字起源
希伯来 希腊 条顿 印度 拉丁 拉丁语 古英语 英格兰 阿拉伯 法国 盖尔 英语 匈牙利 凯尔特 西班牙 居尔特 非洲 美洲土著 挪威 德国 威尔士 斯拉夫民族 古德语 爱尔兰 波斯 古法语 盎格鲁撒克逊 意大利 盖尔语 未知 夏威夷 中古英语 梵语 苏格兰 俄罗斯 土耳其 捷克 希腊;拉丁 斯干那维亚 瑞典 波兰 乌干达 拉丁;条顿 巴斯克语 亚拉姆 亚美尼亚 斯拉夫语 斯堪地纳维亚 越南 荷兰
|