-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[cupertino_icons] Add example to cupertino icons #5312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
auto-submit
merged 14 commits into
flutter:main
from
foxtrotravi:add_example_to_cupertino_icons
Feb 12, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9273bf3
[cupertino_icons] Add example to cupertino icons
foxtrotravi 997cd0c
[cupertino_icons] Update package version
foxtrotravi 77d5b04
[cupertino_icons] Update CHANGELOG.md
foxtrotravi 221ec3a
[cupertino_icons] Add an simple example widget and documentation link
foxtrotravi 249a9d9
[cupertino_icons] Use code excerpts in example.md file for linted and…
foxtrotravi 42c2ff5
[cupertino_icons] Follow standard repository ordering.
foxtrotravi f0503d0
[cupertino_icons] Add license in test file
foxtrotravi 0498d9b
[cupertino_icons] Update CHANGELOG
foxtrotravi f822461
[cupertino_icons] Add flutter as a dev dependency
foxtrotravi 7c2cf48
[cupertino_icons] Update code excerpts and add doc-level comment in t…
foxtrotravi 3f24c60
[cupertino_icons] Adds a 'library' directive after the library comment
foxtrotravi 3479f1d
Merge branch 'main' into add_example_to_cupertino_icons
foxtrotravi 155c004
Merge branch 'main' into add_example_to_cupertino_icons
foxtrotravi da1afda
Add blank line
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?code-excerpt path-base="../test"?> | ||
|
||
This package is used via [`CupertinoIcons`](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html): | ||
|
||
<?code-excerpt "cupertino_icons_test.dart (CupertinoIcon)"?> | ||
```dart | ||
const Icon icon = Icon( | ||
CupertinoIcons.heart_fill, | ||
color: Colors.pink, | ||
size: 24.0, | ||
); | ||
``` | ||
|
||
For a list of all icons, see [`CupertinoIcons`](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html#constants) [class documentation constants](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html#constants). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
third_party/packages/cupertino_icons/test/cupertino_icons_test.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/// This test file is primarily here to serve as a source for code excerpts. | ||
stuartmorgan-g marked this conversation as resolved.
Show resolved
Hide resolved
|
||
library; | ||
|
||
foxtrotravi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
testWidgets( | ||
'Cupertino Icon Test', | ||
(WidgetTester tester) async { | ||
// #docregion CupertinoIcon | ||
const Icon icon = Icon( | ||
CupertinoIcons.heart_fill, | ||
color: Colors.pink, | ||
size: 24.0, | ||
); | ||
// #enddocregion CupertinoIcon | ||
|
||
await tester.pumpWidget( | ||
const MaterialApp( | ||
home: Scaffold( | ||
body: icon, | ||
), | ||
), | ||
); | ||
|
||
expect(find.byType(Icon), findsOne); | ||
}, | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.