This file contains 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
import 'package:flutter_web/material.dart'; | |
import 'package:flutter_web_test/flutter_web_test.dart'; | |
import 'package:flutter_web_ui/ui.dart' as ui; | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Transform.translate( | |
offset: Offset(100, 0), | |
child: Transform.rotate( |
This file contains 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
class _Type implements Type { | |
_Type(this.key); | |
final Object key; | |
@override | |
operator ==(Object other) => other is _Type && other.key == key; | |
@override | |
int get hashCode => key.hashCode; |
This file contains 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
enum _Union { | |
first, | |
second, | |
third, | |
forth, | |
fifth, | |
sixth, | |
seventh, | |
eighth, | |
ninth, |
This file contains 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
void main() { | |
A a = B(); | |
if (a.property is int) { | |
print(a.property.runtimeType); // double | |
} | |
} | |
class A { | |
A(this.property); |
This file contains 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
abstract class Locator { | |
Resolver<T, Locator> resolve<T>() => Resolver(this); | |
} | |
class Resolver<T, L extends Locator> { | |
Resolver(this._locator); | |
final L _locator; | |
} |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. 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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. 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'; | |
void main() => runApp(MyApp()); | |
class InheritedNotificationListener<T> extends InheritedWidget { | |
InheritedNotificationListener({Key key, this.listener, Widget child}) |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. 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'; | |
void main() => runApp(MyApp()); | |
class _InheritedNotificationListener extends InheritedWidget { | |
_InheritedNotificationListener({ |
This file contains 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
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'dart:collection'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; | |
class Person with DiagnosticableTreeMixin { | |
Person({this.name, this.age}); |
This file contains 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
class SliverIterableChildDelegate extends SliverChildDelegate { | |
SliverIterableChildDelegate(this.children); | |
final Iterable<Widget> children; | |
int _lastAccessedIndex; | |
Iterator<Widget> _lastAccessedIterator; | |
@override | |
Widget build(BuildContext context, int index) { | |
if (_lastAccessedIndex == null || _lastAccessedIndex > index) { |