Add:创建 flutter go web 版

This commit is contained in:
ryan
2019-08-13 20:38:46 +08:00
parent 64513b59c1
commit da67ccf5a8
1656 changed files with 483653 additions and 0 deletions

View File

@ -0,0 +1,43 @@
// Copyright 2017 The Chromium Authors. 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_web_ui/ui.dart' show TextDirection;
import 'package:flutter_web/semantics.dart';
import 'package:flutter_web/services.dart' show SystemChannels;
import 'package:test/test.dart';
void main() {
test('Semantic announcement', () async {
final List<Map<dynamic, dynamic>> log = <Map<dynamic, dynamic>>[];
SystemChannels.accessibility
.setMockMessageHandler((Object mockMessage) async {
final Map<dynamic, dynamic> message = mockMessage;
log.add(message);
});
await SemanticsService.announce('announcement 1', TextDirection.ltr);
await SemanticsService.announce('announcement 2', TextDirection.rtl);
expect(
log,
equals(<Map<String, dynamic>>[
<String, dynamic>{
'type': 'announce',
'data': <String, dynamic>{
'message': 'announcement 1',
'textDirection': 1
}
},
<String, dynamic>{
'type': 'announce',
'data': <String, dynamic>{
'message': 'announcement 2',
'textDirection': 0
}
},
]));
});
}