Skip to content

Instantly share code, notes, and snippets.

View yjbanov's full-sized avatar
💭
Building a Web runtime for Flutter: http://bit.ly/flutter-web

Yegor yjbanov

💭
Building a Web runtime for Flutter: http://bit.ly/flutter-web
View GitHub Profile
@widget Counter {
final int initialValue;
@state {
int count = initialValue;
String buttonLabel = 'Increment';
}
Widget build(context) {
return Column(children: [
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp(name: 'Dash'));
}
class MyApp extends StatelessWidget {
const MyApp({super.key, required this.name});
final String name;
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp(name: 'Dash'));
}
class MyApp extends StatelessWidget {
const MyApp({super.key, required this.name});
final String name;
diff --git a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
index b1e5cbbfab..8c28be3d08 100644
--- a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
+++ b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
@@ -242,12 +242,9 @@ final class SizedSpanRepresentation extends LabelRepresentationBehavior {
// `inline` does not support them.
..display = 'inline-block'
- // Stretch the text full width because if the text is broken up into a
- // multi-line paragraph the width of the paragraph can become smaller than
diff --git a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
index 843c4dedda..f5e1bc7780 100644
--- a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
+++ b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
@@ -27,7 +27,7 @@ enum LabelRepresentation {
/// role) JAWS on Windows. However, this role is still the most common, as it
/// applies to all container nodes, and many ARIA roles (e.g. checkboxes,
/// radios, scrollables, sliders).
- ariaLabel(AriaLabelRepresentation),
+ ariaLabel,
diff --git a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
index 843c4dedda..74ccc08d2a 100644
--- a/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
+++ b/lib/web_ui/lib/src/engine/semantics/label_and_value.dart
@@ -16,7 +16,7 @@ import 'semantics.dart';
/// respect the `aria-label` without a [DomText] node. Crawlers typically do not
/// need this information, as they primarily scan visible text, which is
/// communicated in semantics as leaf text and heading nodes.
-enum LabelRepresentation {
+sealed class LabelRepresentation {
@yjbanov
yjbanov / main.dart
Created January 19, 2024 23:17
hollow-durian-8275
import 'dart:ui' as ui;
void main() {
// Create a paragraph
var paragraphStyle = ui.ParagraphStyle(
fontFamily: 'Roboto',
textDirection: ui.TextDirection.ltr,
maxLines: 10,
);
var paragraphBuilder = ui.ParagraphBuilder(paragraphStyle);
@yjbanov
yjbanov / main.dart
Created January 19, 2024 00:24
astonishing-zephyr-8054
import 'dart:ui' as ui;
Future<void> main() async {
var dispatcher = ui.PlatformDispatcher.instance;
dispatcher.onDrawFrame = () {
var sb = ui.SceneBuilder();
var scene = sb.build();
dispatcher.implicitView!.render(scene);
};
@yjbanov
yjbanov / main.dart
Created January 18, 2024 23:23
solar-marsh-4778
import 'dart:async';
import 'dart:ui' as ui;
Future<void> main() async {
// This completer is only used to make the test wait until the frame is done.
var frameCompleter = Completer<void>();
// The concept of "dispatcher" is likely irrelevant to the WebText proposal.
// It's just part of Flutter's structure of the rendering API.
var dispatcher = ui.PlatformDispatcher.instance;
@yjbanov
yjbanov / main.dart
Created January 18, 2024 22:47
solar-marsh-4778
import 'dart:async';
import 'dart:ui' as ui;
Future<void> main() async {
// This completer is only used to make the test wait until the frame is done.
var frameCompleter = Completer<void>();
// The concept of "dispatcher" is likely irrelevant to the WebText proposal.
// It's just part of Flutter's structure of the rendering API.
var dispatcher = ui.PlatformDispatcher.instance;