DialogProviderPlus constructor

DialogProviderPlus(
  1. BuildContext context, {
  2. bool? dark,
  3. String? title,
  4. String? okButton,
  5. String? cancelButton,
})

Implementation

DialogProviderPlus(
  this.context, {
  bool? dark,
  this.title,
  this.okButton,
  this.cancelButton,
}) {
  // 这里初始化些什么
  _dark = dark ?? (Theme.of(context).brightness == Brightness.dark);
  _barrierColor = _dark ? kDarkBarrierColor : kLightBarrierColor;
  _backgroundColor = _dark ? Colors.black54 : Colors.white70;
  _textColor = _dark ? Colors.white : Colors.black87;
  _borderEnableColor = _dark ? Colors.white54 : Colors.black54;
  _hintColor = _dark ? Colors.white54 : Colors.black54;
}