Added license headers for M3 demo app (#1328)

* Added header for all files

Co-authored-by: Qun Cheng <quncheng@google.com>
pull/1329/head
Qun Cheng 2 years ago committed by GitHub
parent 4b31a3846e
commit dbefd89ca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
const Widget divider = SizedBox(height: 10); const Widget divider = SizedBox(height: 10);

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ComponentScreen extends StatelessWidget { class ComponentScreen extends StatelessWidget {

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ElevationScreen extends StatelessWidget { class ElevationScreen extends StatelessWidget {

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'color_palettes_screen.dart'; import 'color_palettes_screen.dart';

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TypographyScreen extends StatelessWidget { class TypographyScreen extends StatelessWidget {

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_types_on_closure_parameters // ignore_for_file: avoid_types_on_closure_parameters
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@ -29,7 +33,7 @@ void main() {
testWidgets( testWidgets(
'Color palettes screen shows correctly when color icon is clicked ' 'Color palettes screen shows correctly when color icon is clicked '
'on NavigationRail', (WidgetTester tester) async { 'on NavigationRail', (tester) async {
widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450.
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
@ -46,8 +50,7 @@ void main() {
expect(find.text("Dark Theme"), findsOneWidget); expect(find.text("Dark Theme"), findsOneWidget);
}); });
testWidgets('Color screen shows correct content', testWidgets('Color screen shows correct content', (tester) async {
(WidgetTester tester) async {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Scaffold(body: Row(children: const [ColorPalettesScreen()])), home: Scaffold(body: Row(children: const [ColorPalettesScreen()])),
)); ));

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_types_on_closure_parameters // ignore_for_file: avoid_types_on_closure_parameters
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@ -5,8 +9,7 @@ import 'package:material_3_demo/component_screen.dart';
import 'package:material_3_demo/main.dart'; import 'package:material_3_demo/main.dart';
void main() { void main() {
testWidgets('Default main page shows all M3 components', testWidgets('Default main page shows all M3 components', (tester) async {
(WidgetTester tester) async {
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
// Elements on the app bar // Elements on the app bar

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_types_on_closure_parameters // ignore_for_file: avoid_types_on_closure_parameters
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@ -9,7 +13,7 @@ import 'component_screen_test.dart';
void main() { void main() {
testWidgets( testWidgets(
'Surface Tones screen shows correctly when the corresponding icon is ' 'Surface Tones screen shows correctly when the corresponding icon is '
'selected on NavigationBar', (WidgetTester tester) async { 'selected on NavigationBar', (tester) async {
widgetSetup(tester, 449); widgetSetup(tester, 449);
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
@ -27,7 +31,7 @@ void main() {
testWidgets( testWidgets(
'Surface Tones screen shows correctly when the corresponding icon is ' 'Surface Tones screen shows correctly when the corresponding icon is '
'selected on NavigationRail', (WidgetTester tester) async { 'selected on NavigationRail', (tester) async {
widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450.
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
@ -42,8 +46,7 @@ void main() {
expect(find.text("Surface Tint only"), findsOneWidget); expect(find.text("Surface Tint only"), findsOneWidget);
}); });
testWidgets('Surface Tones screen shows correct content', testWidgets('Surface Tones screen shows correct content', (tester) async {
(WidgetTester tester) async {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Scaffold(body: Row(children: const [ElevationScreen()])), home: Scaffold(body: Row(children: const [ElevationScreen()])),
)); ));

@ -1,3 +1,7 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_types_on_closure_parameters // ignore_for_file: avoid_types_on_closure_parameters
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@ -9,7 +13,7 @@ import 'component_screen_test.dart';
void main() { void main() {
testWidgets( testWidgets(
'Typography screen shows correctly when the corresponding icon is ' 'Typography screen shows correctly when the corresponding icon is '
'selected on NavigationBar', (WidgetTester tester) async { 'selected on NavigationBar', (tester) async {
widgetSetup(tester, 449); widgetSetup(tester, 449);
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
@ -27,7 +31,7 @@ void main() {
testWidgets( testWidgets(
'Typography screen shows correctly when the corresponding icon is ' 'Typography screen shows correctly when the corresponding icon is '
'selected on NavigationRail', (WidgetTester tester) async { 'selected on NavigationRail', (tester) async {
widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450.
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
await tester.pumpWidget(const Material3Demo()); await tester.pumpWidget(const Material3Demo());
@ -42,8 +46,7 @@ void main() {
expect(find.text("Display Large"), findsOneWidget); expect(find.text("Display Large"), findsOneWidget);
}); });
testWidgets('Typography screen shows correct content', testWidgets('Typography screen shows correct content', (tester) async {
(WidgetTester tester) async {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: Scaffold(body: Row(children: const [TypographyScreen()])), home: Scaffold(body: Row(children: const [TypographyScreen()])),
)); ));

Loading…
Cancel
Save