패키지, 저장소 및 앱 카테고리 검색

패키지 상세v4.0.0+1

dquery

DQuery는 Dart에서 jQuery의 포팅입니다.

Web
30일 다운로드
263
좋아요
2
Pub 점수
105

패키지 설치

flutter pub add dquery

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

DQuery는 Flutter로 빌드된 웹 애플리케이션에 익숙한 DOM 조작 및 이벤트 처리 기능을 제공하기 위해 개발된 Dart 구현체입니다. 개발자들은 jQuery와 유사한 문법을 사용하여 HTML 요소를 선택하고 탐색하며 수정할 수 있어 클라이언트 사이드 웹 개발을 간편하게 만듭니다. DQuery는 요소 선택, CSS 조작, 이벤트 바인딩, AJAX 유사 요청과 같은 일반적인 작업을 지원하며, 동적 웹 인터페이스를 강화하는 데 이상적입니다. 이는 Dart의 자바스크립트와의 상호 운용성을 활용해 웹 플랫폼에서만 실행됩니다.

사용 사례

  • Flutter 웹 앱에서 DOM 조작 간소화
  • 웹 UI에 상호작용 행동 추가하기
  • jQuery 기반 로직을 Dart로 마이그레이션
  • Flutter 프로젝트에서 웹 전용 기능 향상

주요 기능

  • 익숙한 jQuery 스타일 문법
  • DOM 선택 및 탐색
  • 이벤트 처리 및 위임
  • CSS 조작
  • AJAX 유사 요청 지원

적합한 대상

  • 웹 플랫폼을 대상으로 하는 Flutter 개발자
  • jQuery에 익숙한 팀
  • 경량 DOM 상호작용을 필요로 하는 프로젝트
  • 웹 중심의 플러터 애플리케이션

고려 사항

  • 웹 플랫폼에만 제한됨
  • 모바일 또는 데스크톱용으로 적합하지 않음
  • 자바스크립트 상호 운용 오버헤드가 발생할 수 있습니다
  • 복잡한 상태 관리보다는 간단한 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 개

소스 저장소

이 패키지를 사용하는 프로젝트