有没有办法提供冻结的工厂构造类中的吸气剂

时间:2020-06-29 14:47:38

标签: flutter constructor factory mixins getter

所以这是我现在的课程

               onPressed: () {
                if (_formKey.currentState.validate()) {
                  Future<String> check = logIn();
                  if (check != null) {
                    Navigator.pushReplacement(
                        context,
                        MaterialPageRoute(
                            builder: (BuildContext context) =>
                                HomePage()));
                  }
                }
              

是否可以将其更改为具有如下所示的吸气剂

@freezed
abstract class Union with _$Union {
  const factory Union.initial() = Initial;
  const factory Union.loadInProgress() = LoadInProgress;
  const factory Union.loadSuccess(List<Some> some) = LoadSuccess;
}

0 个答案:

没有答案