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
// 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 { | |
final questions = [ |
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
typedef T2 Adder<T1, T2>(T1 left, T1 right); | |
class AddMachine<A> { | |
A left; | |
A right; | |
AddMachine(this.left, this.right); | |
B Sum<B>(Adder<A, B> adder) { | |
print([A, B]); |
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
typedef T2 Foo2<T1, T2>(T1); | |
typedef T3 Foo3<T1, T2, T3>(T1, T2); | |
class Bar<A> { | |
final List<A> outer; | |
Bar(this.outer); | |
void run<B, C, D>( | |
List<B> inner, | |
Foo2<A, C> outerSelector, |
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 class | |
@override initState() { | |
AppStateBloc.stream.listen(updateWidget); // Subscribe to the state stream | |
} | |
void updateWidget(AppState obj) { | |
setState(() {}); // Trigger rebuild | |
} |