Skip to content

Commit 1b4fd1d

Browse files
authored
sync docs, 2022/8/3
2 parents d6117bb + b6bd596 commit 1b4fd1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+434
-219
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Initializes the CodeQL tools for scanning.
3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@3e7e3b32d0fb8283594bb0a76cc60a00918b0969
36+
uses: github/codeql-action/init@0c670bbf0414f39666df6ce8e718ec5662c21e03
3737
with:
3838
languages: ${{ matrix.language }}
3939
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,7 +44,7 @@ jobs:
4444
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4545
# If this step fails, then you should remove it and run the build manually (see below)
4646
- name: Autobuild
47-
uses: github/codeql-action/autobuild@3e7e3b32d0fb8283594bb0a76cc60a00918b0969
47+
uses: github/codeql-action/autobuild@0c670bbf0414f39666df6ce8e718ec5662c21e03
4848

4949
# ℹ️ Command-line programs to run using the OS shell.
5050
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
5858
# make release
5959

6060
- name: Perform CodeQL Analysis
61-
uses: github/codeql-action/analyze@3e7e3b32d0fb8283594bb0a76cc60a00918b0969
61+
uses: github/codeql-action/analyze@0c670bbf0414f39666df6ce8e718ec5662c21e03

.github/workflows/scorecards-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ jobs:
4949

5050
# Upload the results to GitHub's code scanning dashboard.
5151
- name: "Upload to code-scanning"
52-
uses: github/codeql-action/upload-sarif@3e7e3b32d0fb8283594bb0a76cc60a00918b0969
52+
uses: github/codeql-action/upload-sarif@0c670bbf0414f39666df6ce8e718ec5662c21e03
5353
with:
5454
sarif_file: results.sarif

examples/layout/constraints/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ class Button extends StatelessWidget {
203203
final VoidCallback onPressed;
204204

205205
const Button({
206-
required Key key,
206+
super.key,
207207
required this.isSelected,
208208
required this.exampleNumber,
209209
required this.onPressed,
210-
}) : super(key: key);
210+
});
211211

212212
@override
213213
Widget build(BuildContext context) {

examples/testing/code_debugging/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# file. If necessary for a particular example, this file can also include
33
# overrides for individual lints.
44

5-
include: ../../../analysis_options.yaml
5+
include: ../../analysis_options.yaml

examples/testing/code_debugging/lib/debug_flags.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import 'package:flutter/rendering.dart';
55

66
void main() {
77
debugPaintSizeEnabled = true;
8-
runApp(MyApp());
8+
runApp(const MyApp());
99
}
1010

1111
// #enddocregion debugPaintSizeEnabled
1212

1313
class MyApp extends StatelessWidget {
14-
const MyApp({Key? key}) : super(key: key);
14+
const MyApp({super.key});
1515

1616
@override
1717
Widget build(BuildContext context) {
18-
return Text('hello');
18+
return const Text('hello');
1919
}
2020
}

examples/testing/code_debugging/lib/dump_app.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import 'package:flutter/material.dart';
22

33
void main() {
44
runApp(
5-
MaterialApp(
5+
const MaterialApp(
66
home: AppHome(),
77
),
88
);
99
}
1010

1111
class AppHome extends StatelessWidget {
12+
const AppHome({super.key});
13+
1214
@override
1315
Widget build(BuildContext context) {
1416
return Material(
@@ -17,7 +19,7 @@ class AppHome extends StatelessWidget {
1719
onPressed: () {
1820
debugDumpApp();
1921
},
20-
child: Text('Dump App'),
22+
child: const Text('Dump App'),
2123
),
2224
),
2325
);

examples/testing/code_debugging/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: directives_ordering
2+
13
import 'dart:io';
24
// #docregion log
35
import 'dart:developer' as developer;

examples/testing/code_debugging/lib/performance_overlay.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import 'package:flutter/material.dart';
33

44
class MyApp extends StatelessWidget {
5+
const MyApp({super.key});
6+
57
@override
68
Widget build(BuildContext context) {
79
return MaterialApp(
@@ -10,14 +12,14 @@ class MyApp extends StatelessWidget {
1012
theme: ThemeData(
1113
primarySwatch: Colors.blue,
1214
),
13-
home: MyHomePage(title: 'My Awesome App'),
15+
home: const MyHomePage(title: 'My Awesome App'),
1416
);
1517
}
1618
}
1719
// #enddocregion PerfOverlay
1820

1921
class MyHomePage extends StatelessWidget {
20-
const MyHomePage({Key? key, required this.title}) : super(key: key);
22+
const MyHomePage({super.key, required this.title});
2123

2224
final String title;
2325

examples/testing/common_errors/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# file. If necessary for a particular example, this file can also include
33
# overrides for individual lints.
44

5-
include: ../../../analysis_options.yaml
5+
include: ../../analysis_options.yaml
Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
11
import 'package:flutter/material.dart';
22

33
class ProblemWidget extends StatelessWidget {
4-
const ProblemWidget({Key? key}) : super(key: key);
4+
const ProblemWidget({super.key});
55

66
@override
77
// #docregion Problem
88
Widget build(BuildContext context) {
9-
return Container(
10-
child: Row(
11-
children: [
12-
Icon(Icons.message),
13-
Column(
14-
mainAxisSize: MainAxisSize.min,
15-
crossAxisAlignment: CrossAxisAlignment.start,
16-
children: [
17-
Text("Title", style: Theme.of(context).textTheme.headline4),
18-
Text(
19-
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed"
20-
" do eiusmod tempor incididunt ut labore et dolore magna "
21-
"aliqua. Ut enim ad minim veniam, quis nostrud "
22-
"exercitation ullamco laboris nisi ut aliquip ex ea "
23-
"commodo consequat."),
24-
],
25-
),
26-
],
27-
),
9+
return Row(
10+
children: [
11+
const Icon(Icons.message),
12+
Column(
13+
mainAxisSize: MainAxisSize.min,
14+
crossAxisAlignment: CrossAxisAlignment.start,
15+
children: [
16+
Text('Title', style: Theme.of(context).textTheme.headline4),
17+
const Text(
18+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed'
19+
' do eiusmod tempor incididunt ut labore et dolore magna '
20+
'aliqua. Ut enim ad minim veniam, quis nostrud '
21+
'exercitation ullamco laboris nisi ut aliquip ex ea '
22+
'commodo consequat.'),
23+
],
24+
),
25+
],
2826
);
2927
}
3028
// #enddocregion Problem
3129
}
3230

3331
class SolutionWidget extends StatelessWidget {
34-
const SolutionWidget({Key? key}) : super(key: key);
32+
const SolutionWidget({super.key});
3533

3634
@override
3735
Widget build(BuildContext context) {
38-
return Container(
39-
// #docregion Fix
40-
child: Row(
41-
children: [
42-
Icon(Icons.message),
43-
Expanded(
44-
child: Column(
45-
// code omitted
46-
),
47-
),
48-
],
49-
),
50-
// #enddocregion Fix
36+
// #docregion Fix
37+
return Row(
38+
children: [
39+
const Icon(Icons.message),
40+
Expanded(
41+
child: Column(
42+
// code omitted
43+
),
44+
),
45+
],
5146
);
47+
// #enddocregion Fix
5248
}
5349
}

0 commit comments

Comments
 (0)