This appears to trigger an error during AOT snapshot of the gallery as
follows:
```
stdout: [ +6 ms] Building AOT snapshot in release mode (ios-release)...
stdout: [ +15 ms] Extra gen_snapshot options: [--print_snapshot_sizes]
stdout: [ +7 ms] /usr/bin/arch -x86_64 /Users/flutter/.cocoon/flutter/bin/cache/artifacts/engine/ios-release/gen_snapshot --await_is_keyword --causal_async_stacks --packages=.packages --url_mapping=dart:ui,/Users/flutter/.cocoon/flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart --url_mapping=dart:vmservice_io,/Users/flutter/.cocoon/flutter/bin/cache/pkg/sky_engine/sdk_ext/vmservice_io.dart --embedder_entry_points_manifest=/Users/flutter/.cocoon/flutter/bin/cache/artifacts/engine/ios-release/dart_vm_entry_points.txt --embedder_entry_points_manifest=/Users/flutter/.cocoon/flutter/bin/cache/artifacts/engine/ios-release/dart_io_entries.txt --print_snapshot_sizes --snapshot_kind=app-aot-assembly --assembly=build/aot/arm64/snapshot_assembly.S /Users/flutter/.cocoon/flutter/examples/flutter_gallery/lib/main.dart
stderr: [+9324 ms] Error: 'file:///Users/flutter/.cocoon/flutter/examples/flutter_gallery/lib/demo/cupertino/cupertino_segmented_control_demo.dart': error: line 19 pos 1: circular dependency for function _CupertinoSegmentedControlDemoState
stderr: [ ] class _CupertinoSegmentedControlDemoState extends State {
stderr: [ ] ^
stderr: [ +33 ms] Dart snapshot generator failed with exit code 254
stderr: [ ] Snapshotting (IOSArch.arm64) exited with non-zero exit code: 254
stdout: [ ] Built to build/aot/.
stdout: [ +10 ms] "flutter aot" took 9,485ms.
```
This reverts commit 9d49ee3bf0.
This commit is contained in:
@@ -8,6 +8,5 @@ export 'cupertino_dialog_demo.dart';
|
||||
export 'cupertino_navigation_demo.dart';
|
||||
export 'cupertino_picker_demo.dart';
|
||||
export 'cupertino_refresh_demo.dart';
|
||||
export 'cupertino_segmented_control_demo.dart';
|
||||
export 'cupertino_slider_demo.dart';
|
||||
export 'cupertino_switch_demo.dart';
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
// Copyright 2018 The Chromium 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/material.dart';
|
||||
|
||||
const Color _kKeyUmbraOpacity = const Color(0x33000000); // alpha = 0.2
|
||||
const Color _kKeyPenumbraOpacity = const Color(0x24000000); // alpha = 0.14
|
||||
const Color _kAmbientShadowOpacity = const Color(0x1F000000); // alpha = 0.12
|
||||
|
||||
class CupertinoSegmentedControlDemo extends StatefulWidget {
|
||||
static const String routeName = 'cupertino/segmented_control';
|
||||
|
||||
@override
|
||||
_CupertinoSegmentedControlDemoState createState() => new _CupertinoSegmentedControlDemoState();
|
||||
}
|
||||
|
||||
class _CupertinoSegmentedControlDemoState extends State<CupertinoSegmentedControlDemo> {
|
||||
final Map<int, Widget> children = const <int, Widget>{
|
||||
0: Center(
|
||||
child: const Text('Midnight'),
|
||||
),
|
||||
1: Center(
|
||||
child: const Text('Viridian'),
|
||||
),
|
||||
2: Center(
|
||||
child: const Text('Cerulean'),
|
||||
),
|
||||
};
|
||||
|
||||
final Map<int, Widget> icons = const <int, Widget>{
|
||||
0: Center(
|
||||
child: const FlutterLogo(
|
||||
colors: Colors.indigo,
|
||||
size: 200.0,
|
||||
),
|
||||
),
|
||||
1: Center(
|
||||
child: const FlutterLogo(
|
||||
colors: Colors.teal,
|
||||
size: 200.0,
|
||||
),
|
||||
),
|
||||
2: Center(
|
||||
child: const FlutterLogo(
|
||||
colors: Colors.cyan,
|
||||
size: 200.0,
|
||||
),
|
||||
),
|
||||
};
|
||||
|
||||
int sharedValue = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
title: const Text('Cupertino Segmented Control'),
|
||||
),
|
||||
body: new Column(
|
||||
children: <Widget>[
|
||||
const Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
),
|
||||
new SegmentedControl<int>(
|
||||
children: children,
|
||||
onValueChanged: (int newValue) {
|
||||
setState(() {
|
||||
sharedValue = newValue;
|
||||
});
|
||||
},
|
||||
groupValue: sharedValue,
|
||||
),
|
||||
new Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 32.0,
|
||||
horizontal: 16.0,
|
||||
),
|
||||
child: new Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 64.0,
|
||||
horizontal: 16.0,
|
||||
),
|
||||
decoration: new BoxDecoration(
|
||||
color: CupertinoColors.white,
|
||||
borderRadius: new BorderRadius.circular(3.0),
|
||||
boxShadow: const <BoxShadow>[
|
||||
const BoxShadow(
|
||||
offset: const Offset(0.0, 3.0),
|
||||
blurRadius: 5.0,
|
||||
spreadRadius: -1.0,
|
||||
color: _kKeyUmbraOpacity,
|
||||
),
|
||||
const BoxShadow(
|
||||
offset: const Offset(0.0, 6.0),
|
||||
blurRadius: 10.0,
|
||||
spreadRadius: 0.0,
|
||||
color: _kKeyPenumbraOpacity,
|
||||
),
|
||||
const BoxShadow(
|
||||
offset: const Offset(0.0, 1.0),
|
||||
blurRadius: 18.0,
|
||||
spreadRadius: 0.0,
|
||||
color: _kAmbientShadowOpacity,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: icons[sharedValue]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -421,13 +421,6 @@ List<GalleryDemo> _buildGalleryDemos() {
|
||||
routeName: CupertinoRefreshControlDemo.routeName,
|
||||
buildRoute: (BuildContext context) => new CupertinoRefreshControlDemo(),
|
||||
),
|
||||
new GalleryDemo(
|
||||
title: 'Segmented Control',
|
||||
icon: GalleryIcons.tabs,
|
||||
category: _kCupertinoComponents,
|
||||
routeName: CupertinoSegmentedControlDemo.routeName,
|
||||
buildRoute: (BuildContext context) => new CupertinoSegmentedControlDemo(),
|
||||
),
|
||||
new GalleryDemo(
|
||||
title: 'Sliders',
|
||||
icon: GalleryIcons.sliders,
|
||||
|
||||
Reference in New Issue
Block a user