Let Flutter SDK use cupertino_icons 1.0.0 (#65087)

This commit is contained in:
xster
2020-10-16 22:36:01 -07:00
committed by GitHub
parent d2d072199b
commit 3302a12b20
25 changed files with 207 additions and 264 deletions

View File

@@ -20,12 +20,12 @@ dependencies:
flutter:
sdk: flutter
# This plugin is using Android Embedding 1
battery: 1.0.6
battery: 1.0.7
# TODO(egarciad): Add a plugin that uses Android Embedding 2
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
battery_platform_interface: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -96,4 +96,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# PUBSPEC CHECKSUM: bf4a
# PUBSPEC CHECKSUM: 3f48

View File

@@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -137,4 +137,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# PUBSPEC CHECKSUM: eba8
# PUBSPEC CHECKSUM: 20a5

View File

@@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -91,4 +91,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# PUBSPEC CHECKSUM: 9423
# PUBSPEC CHECKSUM: 2920

View File

@@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -137,4 +137,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# PUBSPEC CHECKSUM: eba8
# PUBSPEC CHECKSUM: 20a5

View File

@@ -9,8 +9,8 @@ dependencies:
sdk: flutter
flutter_driver:
sdk: flutter
cupertino_icons: 0.1.3
device_info: 0.4.2+8
cupertino_icons: 1.0.0
device_info: 0.4.2+9
archive: 2.0.13 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args: 1.6.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -82,4 +82,4 @@ flutter:
assets:
- assets/
# PUBSPEC CHECKSUM: 5acc
# PUBSPEC CHECKSUM: beca

View File

@@ -32,18 +32,19 @@ const List<String> coolColorNames = <String>[
const int _kChildCount = 50;
class CupertinoNavigationDemo extends StatelessWidget {
CupertinoNavigationDemo()
CupertinoNavigationDemo({ this.randomSeed })
: colorItems = List<Color>.generate(_kChildCount, (int index) {
return coolColors[math.Random().nextInt(coolColors.length)];
return coolColors[math.Random(randomSeed).nextInt(coolColors.length)];
}) ,
colorNameItems = List<String>.generate(_kChildCount, (int index) {
return coolColorNames[math.Random().nextInt(coolColorNames.length)];
return coolColorNames[math.Random(randomSeed).nextInt(coolColorNames.length)];
});
static const String routeName = '/cupertino/navigation';
final List<Color> colorItems;
final List<String> colorNameItems;
final int randomSeed;
@override
Widget build(BuildContext context) {
@@ -56,15 +57,15 @@ class CupertinoNavigationDemo extends StatelessWidget {
tabBar: CupertinoTabBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.home),
icon: Icon(CupertinoIcons.house, size: 27),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.conversation_bubble),
icon: Icon(CupertinoIcons.chat_bubble, size: 27),
label: 'Support',
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.profile_circled),
icon: Icon(CupertinoIcons.person_circle, size: 27),
label: 'Profile',
),
],
@@ -78,6 +79,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
return CupertinoDemoTab1(
colorItems: colorItems,
colorNameItems: colorNameItems,
randomSeed: randomSeed,
);
},
defaultTitle: 'Colors',
@@ -134,10 +136,15 @@ final Widget trailingButtons = Row(
);
class CupertinoDemoTab1 extends StatelessWidget {
const CupertinoDemoTab1({this.colorItems, this.colorNameItems});
const CupertinoDemoTab1({
this.colorItems,
this.colorNameItems,
this.randomSeed,
});
final List<Color> colorItems;
final List<String> colorNameItems;
final int randomSeed;
@override
Widget build(BuildContext context) {
@@ -165,6 +172,7 @@ class CupertinoDemoTab1 extends StatelessWidget {
lastItem: index == _kChildCount - 1,
color: colorItems[index],
colorName: colorNameItems[index],
randomSeed: randomSeed,
);
},
childCount: _kChildCount,
@@ -178,12 +186,19 @@ class CupertinoDemoTab1 extends StatelessWidget {
}
class Tab1RowItem extends StatelessWidget {
const Tab1RowItem({this.index, this.lastItem, this.color, this.colorName});
const Tab1RowItem({
this.index,
this.lastItem,
this.color,
this.colorName,
this.randomSeed,
});
final int index;
final bool lastItem;
final Color color;
final String colorName;
final int randomSeed;
@override
Widget build(BuildContext context) {
@@ -196,6 +211,7 @@ class Tab1RowItem extends StatelessWidget {
color: color,
colorName: colorName,
index: index,
randomSeed: randomSeed,
),
));
},
@@ -274,11 +290,12 @@ class Tab1RowItem extends StatelessWidget {
}
class Tab1ItemPage extends StatefulWidget {
const Tab1ItemPage({this.color, this.colorName, this.index});
const Tab1ItemPage({this.color, this.colorName, this.index, this.randomSeed});
final Color color;
final String colorName;
final int index;
final int randomSeed;
@override
State<StatefulWidget> createState() => Tab1ItemPageState();
@@ -289,7 +306,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
void initState() {
super.initState();
relatedColors = List<Color>.generate(10, (int index) {
final math.Random random = math.Random();
final math.Random random = math.Random(widget.randomSeed);
return Color.fromARGB(
255,
(widget.color.red + random.nextInt(100) - 50).clamp(0, 255) as int,

View File

@@ -40,17 +40,15 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
keyboardType: TextInputType.multiline,
prefix: const Padding(padding: EdgeInsets.symmetric(horizontal: 4.0)),
suffix: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: CupertinoButton(
color: CupertinoColors.activeGreen,
minSize: 0.0,
child: const Icon(
CupertinoIcons.up_arrow,
size: 21.0,
color: CupertinoColors.white,
CupertinoIcons.arrow_up_circle_fill,
size: 28.0,
color: CupertinoColors.activeGreen,
),
padding: const EdgeInsets.all(2.0),
borderRadius: BorderRadius.circular(15.0),
padding: const EdgeInsets.only(bottom: 4),
onPressed: ()=> setState(()=> _chatTextController.clear()),
),
),
@@ -63,7 +61,7 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
Widget _buildNameField() {
return const CupertinoTextField(
prefix: Icon(
CupertinoIcons.person_solid,
CupertinoIcons.person_fill,
color: CupertinoColors.lightBackgroundGray,
size: 28.0,
),
@@ -81,9 +79,9 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
Widget _buildEmailField() {
return const CupertinoTextField(
prefix: Icon(
CupertinoIcons.mail_solid,
CupertinoIcons.envelope_fill,
color: CupertinoColors.lightBackgroundGray,
size: 28.0,
size: 26,
),
padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 12.0),
clearButtonMode: OverlayVisibilityMode.editing,
@@ -100,9 +98,9 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
return CupertinoTextField(
controller: _locationTextController,
prefix: const Icon(
CupertinoIcons.location_solid,
CupertinoIcons.location_fill,
color: CupertinoColors.lightBackgroundGray,
size: 28.0,
size: 26,
),
padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 12.0),
clearButtonMode: OverlayVisibilityMode.editing,
@@ -117,9 +115,9 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
Widget _buildPinField() {
return const CupertinoTextField(
prefix: Icon(
CupertinoIcons.padlock_solid,
CupertinoIcons.lock_open_fill,
color: CupertinoColors.lightBackgroundGray,
size: 28.0,
size: 26,
),
padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 12.0),
clearButtonMode: OverlayVisibilityMode.editing,
@@ -137,9 +135,9 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
return CupertinoTextField(
controller: TextEditingController(text: 'colleague, reading club'),
prefix: const Icon(
CupertinoIcons.tags_solid,
CupertinoIcons.tag_fill,
color: CupertinoColors.lightBackgroundGray,
size: 28.0,
size: 26,
),
enabled: false,
padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 12.0),

View File

@@ -8,12 +8,12 @@ dependencies:
flutter:
sdk: flutter
collection: 1.15.0-nullsafety.3
device_info: 0.4.2+8
device_info: 0.4.2+9
intl: 0.16.1
connectivity: 0.4.9+3
connectivity: 0.4.9+5
string_scanner: 1.1.0-nullsafety.1
url_launcher: 5.7.2
cupertino_icons: 0.1.3
url_launcher: 5.7.5
cupertino_icons: 1.0.0
video_player: 0.10.6
scoped_model: 1.0.1
shrine_images: 1.1.2
@@ -277,4 +277,4 @@ flutter:
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
# PUBSPEC CHECKSUM: 023a
# PUBSPEC CHECKSUM: 1f3d

View File

@@ -0,0 +1,41 @@
// Copyright 2014 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.
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gallery/demo/cupertino/cupertino_navigation_demo.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Navigation demo golden', (WidgetTester tester) async {
// The point is to mainly test the cupertino icons that we don't have a
// dependency against in the flutter/cupertino package directly.
final Future<ByteData> font = rootBundle.load(
'packages/cupertino_icons/assets/CupertinoIcons.ttf'
);
await (FontLoader('packages/cupertino_icons/CupertinoIcons')..addFont(font))
.load();
await tester.pumpWidget(CupertinoApp(
home: CupertinoNavigationDemo(randomSeed: 123456),
));
await expectLater(
find.byType(CupertinoNavigationDemo),
matchesGoldenFile('cupertino_navigation_demo.screen.1.png'),
);
// Tap some row to go to the next page.
await tester.tap(find.text('Buy this cool color').first);
await tester.pump();
await tester.pump(const Duration(milliseconds: 500));
await expectLater(
find.byType(CupertinoNavigationDemo),
matchesGoldenFile('cupertino_navigation_demo.screen.2.png'),
);
});
}

View File

@@ -8,7 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
camera: 0.5.8+8
camera: 0.5.8+9
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -19,4 +19,4 @@ dependencies:
flutter:
uses-material-design: true
# PUBSPEC CHECKSUM: 8dce
# PUBSPEC CHECKSUM: b3cf

View File

@@ -0,0 +1,41 @@
.DS_Store
.dart_tool/
.packages
.pub/
.idea/
.vagrant/
.sconsign.dblite
.svn/
*.swp
profile
DerivedData/
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
build/
.android/
.ios/
.flutter-plugins

View File

@@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -99,4 +99,4 @@ flutter:
androidPackage: com.example.iosadd2appflutter
iosBundleIdentifier: com.example.iosAdd2appFlutter
# PUBSPEC CHECKSUM: 9423
# PUBSPEC CHECKSUM: 2920

View File

@@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -99,4 +99,4 @@ flutter:
androidPackage: com.example.iosadd2appflutter
iosBundleIdentifier: com.example.iosAdd2appFlutter
# PUBSPEC CHECKSUM: 9423
# PUBSPEC CHECKSUM: 2920

View File

@@ -20,7 +20,7 @@ dependencies:
sdk: flutter
# This integration test includes a watchOS pod. Add a Flutter plugin
# to prompt the tool to run pod install.
device_info: 0.4.2+8
device_info: 0.4.2+9
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -91,4 +91,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# PUBSPEC CHECKSUM: c70b
# PUBSPEC CHECKSUM: 220c

View File

@@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
cupertino_icons: 0.1.3
cupertino_icons: 1.0.0
characters: 1.1.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection: 1.15.0-nullsafety.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -39,4 +39,4 @@ dev_dependencies:
flutter:
uses-material-design: true
# PUBSPEC CHECKSUM: 9423
# PUBSPEC CHECKSUM: 2920

View File

@@ -19,7 +19,7 @@ dev_dependencies:
sdk: flutter
flutter_test:
sdk: flutter
integration_test: 0.9.2
integration_test: 0.9.2+1
http: 0.12.2
test: 1.16.0-nullsafety.5
@@ -78,4 +78,4 @@ dev_dependencies:
webkit_inspection_protocol: 0.7.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: eb1f
# PUBSPEC CHECKSUM: f37b