blob: e44c8b454ba00fd34711e449fe9807367192fb54 [file] [log] [blame]
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// test w/ `pub run test -N sort_child_properties_last`
// ignore_for_file: prefer_expression_function_bodies
import 'package:flutter/widgets.dart';
class W0 extends Widget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Center(), // OK
),
);
}
}
class W1 extends Widget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Center(), // LINT
key: 0,
),
);
}
}
class W2 extends Widget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
key: 0,
child: Center(), // OK
),
);
}
}
class W3 extends Widget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
key: 0,
child: Center(
child: Column(
key: 0,
children: [], // OK
),
),
),
);
}
}
class W4 extends Widget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
key: 0,
child: Center(
child: Column(
children: [], // LINT
key: 0,
),
),
),
);
}
}
/// see: https://dart-review.googlesource.com/c/sdk/+/161624
nestedChildren() {
Column(
children: [ // LINT
Column(
children: [ // LINT
Text('a'),
],
crossAxisAlignment: CrossAxisAlignment.center,
),
Text('b'),
Text('c'),
Text('d'),
],
crossAxisAlignment: CrossAxisAlignment.center,
);
}