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
import 'dart:convert'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:glob/glob.dart'; | |
/// A simple implementation of [AssetBundle] that reads files from an asset dir. | |
/// |
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
/// Client (application-specific) code | |
// Presents an affordance for inspecting the current state of | |
// a given action, and for triggering that action if possible | |
class ActionStatePresenter extends StatelessWidget { | |
ActionStatePresenter({this.actionKey}); | |
Intent actionKey; | |
@override | |
Widget build(BuildContext context) { | |
// Here we set up a dependency relationship with the ActionManager |
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
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
group('KeyTest', () { | |
const double itemHeight = 48.0; | |
final List<String> listItems = <String>['Item 1', 'Item 2', 'Item 3', 'Item 4']; | |
final List<GlobalKey> indexedKeys = <GlobalKey>[ | |
GlobalKey(debugLabel: '0'), |
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
--------------- | |
Building drag target (1, 2) | |
Building ghost index: [<'Item 3'>] | |
Building drag target (1, 1) | |
Building current index (1): [<'Item 2'>] | |
Building main scroll view | |
Wrapping [<'Item 1'>] at 0 | |
Wrapping [<'Item 2'>] at 1 | |
Wrapping [<'Item 3'>] at 2 | |
Wrapping [<'Item 4'>] at 3 |
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
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ | |
flutter: The following assertion was thrown building Listener: | |
flutter: Multiple widgets used the same GlobalKey [_ScopedValueGlobalKey<_ReorderableListContentState> | |
flutter: _ReorderableListContentState#7057b [<'F'>]]. | |
flutter: The key [_ScopedValueGlobalKey<_ReorderableListContentState> _ReorderableListContentState#7057b | |
flutter: [<'F'>]] was used by multiple widgets. The parents of those widgets were: | |
flutter: - _PointerListener(listeners: [down], behavior: deferToChild, renderObject: | |
flutter: RenderPointerListener#45bbd relayoutBoundary=up5 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE) | |
flutter: - _PointerListener(listeners: [down], behavior: deferToChild, renderObject: | |
flutter: RenderPointerListener#5fbfc relayoutBoundary=up4) |
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
class Bar { | |
Bar({this.foo}); | |
Foo foo; | |
String toString() => 'bar:$foo'; | |
} | |
class Foo { | |
Foo({this.bar}); | |
Bar bar; | |
String toString() => 'foo:$bar'; |
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
Widget build(BuildContext context) { | |
return new Scaffold( | |
toolBar: new ToolBar( | |
center: new Text("Flutter Demo") | |
), | |
body: new DecoratedBox( | |
decoration: new BoxDecoration(backgroundColor: const Color(0x774444)), | |
child: new Center(child: new Text("Hello World")) | |
) | |
); |
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
import 'dart:sky' as sky; // Defines sky.Event and sky.EventCallback | |
class Event {} | |
// With this typedef, the code fails at runtime with: | |
// type '(Event) => void' is not a subtype of type 'EventCallback' of 'callback'. | |
// Removing this typedef causes the code to succeed | |
typedef void FooBar(Event event); | |
void main() { |