Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[various] Prep for more const widgets
  • Loading branch information
goderbauer committed Feb 1, 2023
commit 83634b0814dbe2d74645d7a4f0cb021dc1c02e0e
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class MyHomePage extends StatelessWidget {
children: <Widget>[
const Divider(color: Colors.black),
const SizedBox(height: 10),
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
Row(
children: const <Widget>[
SizedBox(
Expand Down Expand Up @@ -150,6 +152,8 @@ class MyHomePage extends StatelessWidget {
inAnimation: AdaptiveScaffold.leftOutIn,
builder: (_) => AdaptiveScaffold.standardNavigationRail(
extended: true,
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
leading: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: const <Widget>[
Expand Down
6 changes: 6 additions & 0 deletions packages/flutter_adaptive_scaffold/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ class _LargeComposeIcon extends StatelessWidget {
child: Column(children: <Widget>[
Container(
padding: const EdgeInsets.fromLTRB(6, 0, 0, 0),
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[
Expand Down Expand Up @@ -439,8 +441,12 @@ class _LargeComposeIcon extends StatelessWidget {
),
width: 200,
height: 50,
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 0, 0, 0),
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: Row(
children: const <Widget>[
Icon(Icons.edit_outlined),
Expand Down
4 changes: 4 additions & 0 deletions packages/flutter_markdown/test/list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ void defineTests() {

await tester.pumpWidget(
boilerplate(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
Column(
children: const <Widget>[
MarkdownBody(fitContent: false, data: data),
Expand All @@ -233,6 +235,8 @@ void defineTests() {

await tester.pumpWidget(
boilerplate(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
Column(
children: const <Widget>[
MarkdownBody(data: data),
Expand Down
50 changes: 29 additions & 21 deletions packages/flutter_markdown/test/markdown_body_shrink_wrap_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ void defineTests() {
'Given a MarkdownBody with shrinkWrap=true '
'Then it wraps its content',
(WidgetTester tester) async {
await tester.pumpWidget(boilerplate(Stack(
children: const <Widget>[
Text('shrinkWrap=true'),
Align(
alignment: Alignment.bottomCenter,
child: MarkdownBody(
data: 'This is a [link](https://flutter.dev/)',
await tester.pumpWidget(boilerplate(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
Stack(
children: const <Widget>[
Text('shrinkWrap=true'),
Align(
alignment: Alignment.bottomCenter,
child: MarkdownBody(
data: 'This is a [link](https://flutter.dev/)',
),
),
),
],
)));
],
),
));

final Rect stackRect = tester.getRect(find.byType(Stack));
final Rect textRect = tester.getRect(find.byType(Text));
Expand All @@ -43,18 +47,22 @@ void defineTests() {
'Given a MarkdownBody with shrinkWrap=false '
'Then it expands to the maximum allowed height',
(WidgetTester tester) async {
await tester.pumpWidget(boilerplate(Stack(
children: const <Widget>[
Text('shrinkWrap=false test'),
Align(
alignment: Alignment.bottomCenter,
child: MarkdownBody(
data: 'This is a [link](https://flutter.dev/)',
shrinkWrap: false,
await tester.pumpWidget(boilerplate(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
Stack(
children: const <Widget>[
Text('shrinkWrap=false test'),
Align(
alignment: Alignment.bottomCenter,
child: MarkdownBody(
data: 'This is a [link](https://flutter.dev/)',
shrinkWrap: false,
),
),
),
],
)));
],
),
));

final Rect stackRect = tester.getRect(find.byType(Stack));
final Rect textRect = tester.getRect(find.byType(Text));
Expand Down
8 changes: 8 additions & 0 deletions packages/rfw/example/remote/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,18 @@ class _ExampleState extends State<Example> {
},
);
} else {
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
result = Material(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: SafeArea(
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: Padding(
padding: const EdgeInsets.all(20.0),
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
// ignore: prefer_const_constructors
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: const <Widget>[
Expand Down