flutter: Rename widgets to children

This commit is contained in:
Calcitem 2021-03-29 22:43:30 +08:00
parent 6a8644133c
commit e37d3fcb88
3 changed files with 15 additions and 15 deletions

View File

@ -550,7 +550,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).difficulty, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsListTile(
context: context,
titleString: S.of(context).skillLevel,
@ -562,7 +562,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).aisPlayStyle, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.aiIsLazy,
@ -582,7 +582,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).playSounds, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.toneEnabled,
@ -595,7 +595,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).whoMovesFirst, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: !Config.aiMovesFirst,
@ -610,7 +610,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.isAutoRestart,
@ -623,7 +623,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).display, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.isPieceCountInHandShown,
@ -647,7 +647,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).color, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsListTile(
context: context,
titleString: S.of(context).boardColor,
@ -688,7 +688,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
Text(S.of(context).restore, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsListTile(
context: context,
titleString: S.of(context).restoreDefaultSettings,

View File

@ -200,7 +200,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
Text(S.of(context).general, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsListTile(
context: context,
titleString: S.of(context).piecesCount,
@ -244,7 +244,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
Text(S.of(context).placing, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.hasBannedLocations,
@ -267,7 +267,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
Text(S.of(context).moving, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.isDefenderMoveFirst,
@ -290,7 +290,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
Text(S.of(context).removing, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
widgets: <Widget>[
children: <Widget>[
SettingsSwitchListTile(
context: context,
value: Config.mayRemoveFromMillsAlways,

View File

@ -23,18 +23,18 @@ class SettingsCard extends StatelessWidget {
const SettingsCard({
Key? key,
required this.context,
required this.widgets,
required this.children,
}) : super(key: key);
final BuildContext context;
final widgets;
final children;
@override
Widget build(BuildContext context) {
return Card(
color: AppTheme.cardColor,
margin: AppTheme.cardMargin,
child: Column(children: widgets),
child: Column(children: children),
);
}
}