[英]How can I access these field in testing ( Flutter)?
I have these fields below in-state class and I want to test if these fields work correctly.我在州内类下面有这些字段,我想测试这些字段是否正常工作。 So I write testing dart file, how can I access these field in a testing file
所以我编写了测试 dart 文件,如何在测试文件中访问这些字段
class _LoginPageState extends State<LoginPage> {
String _phoneNumber = "";
String _smsCode = "";
String _verificationId = "";
int _currentStep = 0;
List<StepState> _stepsState = [
StepState.editing,
StepState.indexed,
StepState.indexed
];
bool _showProgress = false;
String _displayName = '';
File _imageFile;
bool _labeling = false;
List<ImageLabel> _labels = List();
}
You can use @visibleForTesting
annotation from any of these packages您可以使用任何这些包中的
@visibleForTesting
注释
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.