浏览代码

[Code Format] stepper

/main
iizzaya 5 年前
当前提交
7127b0cb
共有 1 个文件被更改,包括 32 次插入34 次删除
  1. 66
      Runtime/material/stepper.cs

66
Runtime/material/stepper.cs


}
}
public class _StepperState : TickerProviderStateMixin<Stepper> {
readonly TextStyle _kStepStyleLight = new TextStyle(
class _StepperState : TickerProviderStateMixin<Stepper> {
static readonly TextStyle _kStepStyleLight = new TextStyle(
readonly TextStyle _kStepStyleDark = new TextStyle(
static readonly TextStyle _kStepStyleDark = new TextStyle(
readonly Color _kErrorLight = Colors.red;
readonly Color _kErrorDark = Colors.red.shade400;
readonly Color _kCircleActiveLight = Colors.white;
readonly Color _kCircleActiveDark = Colors.black87;
readonly Color _kDisabledLight = Colors.black38;
readonly Color _kDisabledDark = Colors.white30;
readonly float _kStepSize = 24.0f;
readonly float _kTriangleHeight = 24.0f * 0.866025f;
static readonly Color _kErrorLight = Colors.red;
static readonly Color _kErrorDark = Colors.red.shade400;
static readonly Color _kCircleActiveLight = Colors.white;
static readonly Color _kCircleActiveDark = Colors.black87;
static readonly Color _kDisabledLight = Colors.black38;
static readonly Color _kDisabledDark = Colors.white30;
static readonly float _kStepSize = 24.0f;
static readonly float _kTriangleHeight = 24.0f * 0.866025f;
public Dictionary<int, StepState> _oldStates = new Dictionary<int, StepState>();
Dictionary<int, StepState> _oldStates = new Dictionary<int, StepState>();
public override void initState() {
base.initState();

case StepState.disabled:
return new Text(
(index + 1).ToString(),
style: isDarkActive ? this._kStepStyleDark : this._kStepStyleLight
style: isDarkActive ? _kStepStyleDark : _kStepStyleLight
color: isDarkActive ? this._kCircleActiveDark : this._kCircleActiveLight,
color: isDarkActive ? _kCircleActiveDark : _kCircleActiveLight,
color: isDarkActive ? this._kCircleActiveDark : this._kCircleActiveLight,
color: isDarkActive ? _kCircleActiveDark : _kCircleActiveLight,
style: this._kStepStyleLight
style: _kStepStyleLight
);
}

Widget _buildCircle(int index, bool oldState) {
return new Container(
margin: EdgeInsets.symmetric(vertical: 8.0f),
width: this._kStepSize,
height: this._kStepSize,
width: _kStepSize,
height: _kStepSize,
child: new AnimatedContainer(
curve: Curves.fastOutSlowIn,
duration: ThemeUtils.kThemeAnimationDuration,

Widget _buildTriangle(int index, bool oldState) {
return new Container(
margin: EdgeInsets.symmetric(vertical: 8.0f),
width: this._kStepSize,
height: this._kStepSize,
width: _kStepSize,
height: _kStepSize,
width: this._kStepSize,
height: this._kTriangleHeight,
width: _kStepSize,
height: _kTriangleHeight,
color: this._isDark() ? this._kErrorDark : this._kErrorLight),
color: this._isDark() ? _kErrorDark : _kErrorLight),
child: new Align(
alignment: new Alignment(0.0f, 0.8f),
child: this._buildCircleChild(index,

child: new Text(localizations.continueButtonLabel)
),
new Container(
margin: EdgeInsets.only(8.0f), // EdgeInsetsDirection
margin: EdgeInsets.only(8.0f),
child: new FlatButton(
onPressed: this.widget.onStepCancel,
textColor: cancelColor,

return textTheme.body2;
case StepState.disabled:
return textTheme.body2.copyWith(
color: this._isDark() ? this._kDisabledDark : this._kDisabledLight
color: this._isDark() ? _kDisabledDark : _kDisabledLight
color: this._isDark() ? this._kErrorDark : this._kErrorLight
color: this._isDark() ? _kErrorDark : _kErrorLight
);
}

return textTheme.caption;
case StepState.disabled:
return textTheme.caption.copyWith(
color: this._isDark() ? this._kDisabledDark : this._kDisabledLight
color: this._isDark() ? _kDisabledDark : _kDisabledLight
color: this._isDark() ? this._kErrorDark : this._kErrorLight
color: this._isDark() ? _kErrorDark : _kErrorLight
);
}

}
),
new Container(
margin: EdgeInsets.only(12.0f), // EdgeInsetsDirectional
margin: EdgeInsets.only(12.0f),
child: this._buildheaderText(index)
)
}

Widget _buildVerticalBody(int index) {
return new Stack(
children: new List<Widget> {
new Positioned( // PositionedDirectional
new Positioned(
left: 24.0f,
top: 0.0f,
bottom: 0.0f,

child: new Center(child: this._buildIcon(_i))
),
new Container(
margin: EdgeInsets.only(left: 12.0f), // EdgeinsetsDirectional
margin: EdgeInsets.only(left: 12.0f),
child: this._buildheaderText(_i)
)
}

return this._buildHorizontal();
}
return new Text("Build Failed");
return null;
}
}

正在加载...
取消
保存