Commit 5246f696 authored by ouxiang's avatar ouxiang

image channel test

parent 3a00032b
......@@ -15,7 +15,8 @@ class _AssestPlatformChannelState extends State<AssestPlatformChannel> {
EventChannel('GMAssetsEventChannelName');
String _batteryLevel = 'Battery level: unknown.';
ByteData _imageData;
Object _imageData;
Future<void> _editPortrait() async {
String batteryLevel;
......@@ -39,6 +40,7 @@ class _AssestPlatformChannelState extends State<AssestPlatformChannel> {
void _onEvent(Object event) {
_imageData = event;
print(event.runtimeType);
Image.memory(event);
setState(() {
});
}
......@@ -70,6 +72,16 @@ class _AssestPlatformChannelState extends State<AssestPlatformChannel> {
onPressed: _editPortrait,
),
),
Container(
color: Colors.pink[300],
width: 300,
height: 300,
child: Image.memory(_imageData,
color: Colors.purple,
width: 200,
height: 200,
),
)
],
),
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment