パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v4.0.0+1

dquery

DQuery は、Dart における jQuery の移植版です。

Web
30日間ダウンロード
379
いいね数
2
Pub ポイント
105

パッケージをインストール

flutter pub add dquery

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

DQuery は、Flutter で構築された Web アプリケーションに、jQuery に馴染みのある DOM 操作およびイベント処理機能をもたらすための Dart 実装です。開発者は、jQuery と似た構文を使用して HTML 要素を選択・移動・変更でき、クライアントサイドの Web 開発を簡素化します。DQuery は要素選択、CSS の操作、イベントのバインディング、AJAX に似たリクエストといった一般的な操作をサポートしており、動的な Web インターフェースの強化に最適です。これは Web プラットフォームでのみ実行され、Dart の JavaScript との相互運用性を利用しています。

用途

  • Flutter Web アプリにおける DOM 操作の簡素化
  • Web UIにインタラクティブな動作を追加する
  • jQueryベースのロジックをDartに移行する
  • FlutterプロジェクトにおけるWeb固有の機能の強化

主な機能

  • なじみ深いjQueryスタイルの構文
  • DOM の選択と移動
  • イベント処理とデリゲーション
  • CSS操作
  • AJAX風のリクエストサポート

適している対象

  • Web プラットフォーム向けの Flutter 開発者
  • jQueryに精通したチーム
  • 軽量なDOM操作を必要とするプロジェクト
  • ウェブ中心のFlutterアプリケーション

注意事項

  • ウェブプラットフォームのみ対応
  • モバイルまたはデスクトップ向けではありません
  • JavaScript相互運用のオーバーヘッドが発生する可能性があります
  • 複雑な状態管理よりも、単純なDOM操作に適している

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

DQuery

DQuery is a porting of jQuery in Dart.

Install from Dart Pub Repository

Include the following in your pubspec.yaml:

dependencies:
  dquery: any

Then run the Pub Package Manager in Dart Editor (Tool > Pub Install). If you are using a different editor, run the command (comes with the Dart SDK):

pub install

Usage

You can create a query object by selector. With context provided, the query will be based on different element.

// selects all elements containing 'active' in CSS class
ElementQuery $elems = $('.active');

// selects all descendant elements of div containing 'active' in CSS class
ElementQuery $elems = $('.active', div);

It implements List.

$('.active')[0];
$('.active').isEmpty;
for (Element e in $('.active')) { ... }

Create another query object with traversing API, including find, closest, parent, children.

$('.active').closest('ul');
$('#myDiv').find('a.btn');

Manipulate selected elements.

$('.active').removeClass('active');
$('.fade').hide();

Register event handlers on queried elements, or trigger an event by API.

$('#myBtn').on('click', (QueryEvent e) {
	...
});
$('#myBtn').trigger('click', data: 'my data');

There are query objects of Document and Window too.

Query $doc = $document();
Query $win = $window();

Check the API reference for more features.

Comparison to jQuery

See here.

Notes to Contributors

Test and Debug

You are welcome to submit bugs and feature requests. Or even better if you can fix or implement them!

Fork DQuery

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

Please be aware that one of Rikulo's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

Who Uses

  • Quire - a simple, collaborative, multi-level task management tool.
  • Keikai - a sophisticated spreadsheet for big data

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト