dart-webui

Dart How to code a simple web-socket echo app

和自甴很熟 提交于 2019-11-30 23:47:27
I've been attempting to learn enough html, css, and Dart to create my first web page and all is going well, except that I do not understand how to create a simple page and a server side web-socket server that will just echo it back. The examples that I find tend to illustrate other Dart tools and either connect to echo server on the web or do other things that make their code not simple for a newbie. I've tried to simplify Seth Ladd's example "dart-example-web-sockets-client" as the 'best' example. I can receive what is sent from the page, repackage it and think i'm sending it back but

Dart - How does one dart project import code from another dart project without using pub?

霸气de小男生 提交于 2019-11-30 07:01:52
Suppose I have two dart projects Project A contains code that uses web component to create bunch of UI widget (similar to https://github.com/kevmoo/widget.dart ) Project B contains my front end code that would reuse the UI widget I created in project A. If I dont want to publish my project A to pub, is there anyway to link project B to project A without manually copying files from project A into B? Thanks Take a look at this section in the pub documentation: Path Dependencies: http://pub.dartlang.org/doc/dependencies.html#path-packages Suppose project_a had a library file called myprojecta

In Dart why the code below (about MutationObserver) dose not work?

不羁的心 提交于 2019-11-29 08:47:49
I modified one the Dart polymer example to test MutationObserver. It does not work! Any suggestion? This is the HTML code: <body> <ul> <template id="tmpl" repeat> <li>{{}}</li> </template> </ul> </body> This is Dart code: MutationObserver observer = new MutationObserver(_onMutation); observer.observe(query('#tmpl'), childList: true, subtree: true); List timestamps = toObservable([]); query('#tmpl').model = timestamps; new Timer.periodic(const Duration(seconds: 1), (_) { timestamps.add(new DateTime.now()); }); _onMutation(List<MutationRecord> mutations, MutationObserver observer) { print('hello

Dart - How does one dart project import code from another dart project without using pub?

♀尐吖头ヾ 提交于 2019-11-29 08:19:08
问题 Suppose I have two dart projects Project A contains code that uses web component to create bunch of UI widget (similar to https://github.com/kevmoo/widget.dart) Project B contains my front end code that would reuse the UI widget I created in project A. If I dont want to publish my project A to pub, is there anyway to link project B to project A without manually copying files from project A into B? Thanks 回答1: Take a look at this section in the pub documentation: Path Dependencies: http://pub

How do I pass arbitrary data to a click event handler function from a Dart polymer web component

核能气质少年 提交于 2019-11-29 00:56:45
问题 In Dart's Web UI, it was possible to pass arbitrary data to function in response to events, for example, the following snippet passes the value 2 to the increment(int incBy) method in response to the button's on-click event: <!-- Web UI --> <element name="x-click-counter"> <template> <button on-click="increment(2)"> <!-- passing a value of 2 --> Click me </button> </template> </element> <script> import 'package:web_ui/web_ui.dart'; class CounterComponent extends WebComponent { void increment

Bootstrap.js not working in Polymer components

烈酒焚心 提交于 2019-11-28 07:04:20
I'm currently working on translating our current Dart Web UI project to Polymer.dart. We use Bootstrap 3 for the front-end styling and many web animations (e.g. dropdown menus, modals, tooltips). However after I translated one Web UI component into Polymer, all the Bootstrap JavaScript stopped working for the sub component, since it was now encapsulated in the ShadowDOM. To access an element in the ShadowDOM from Dart I have to use the shadowRoot field, and from JavaScript in Chrome I have to use the webkitShadowRoot property, but still I can't get a single dropdown menu to work properly.

In Dart why the code below (about MutationObserver) dose not work?

若如初见. 提交于 2019-11-28 02:18:09
问题 I modified one the Dart polymer example to test MutationObserver. It does not work! Any suggestion? This is the HTML code: <body> <ul> <template id="tmpl" repeat> <li>{{}}</li> </template> </ul> </body> This is Dart code: MutationObserver observer = new MutationObserver(_onMutation); observer.observe(query('#tmpl'), childList: true, subtree: true); List timestamps = toObservable([]); query('#tmpl').model = timestamps; new Timer.periodic(const Duration(seconds: 1), (_) { timestamps.add(new

How to build a complex Web UI application with multiple views?

早过忘川 提交于 2019-11-27 17:53:10
I am going to build complex application having many different views. Imagine for example eshop solution. There can be a lot of different views: Contact page with some static information Registration form for new customers View of your order List of the products Details about a product ... Now I am little bit confused, how to build such a complex application using Web UI. I would like to have the HTML templates for the views separated in multiple files and having some logic to determine, which one should be rendered. Assume I want to have a single master template containing basic things like

How to build a complex Web UI application with multiple views?

℡╲_俬逩灬. 提交于 2019-11-26 22:36:35
问题 I am going to build complex application having many different views. Imagine for example eshop solution. There can be a lot of different views: Contact page with some static information Registration form for new customers View of your order List of the products Details about a product ... Now I am little bit confused, how to build such a complex application using Web UI. I would like to have the HTML templates for the views separated in multiple files and having some logic to determine, which