Skip to content

Instantly share code, notes, and snippets.

@whataa
whataa / inherited_widget_test_2.dart
Last active November 29, 2019 07:47
一个使用InheritedWidget的建议范例
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: MyWidget(
Column(
children: <Widget>[
WidgetA(),
WidgetB()
@whataa
whataa / inherited_widget_test.dart
Last active September 15, 2019 08:57
一个使用InheritedWidget的错误范例
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: MyWidget(),
),
));
}