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

GitHub 저장소JahezAcademy/flutter_rocket

flutter_rocket

🚀 Flutter Rocket 🚀 Flutter Rocket으로 높이 날아오세요 - Flutter 개발자를 위한 최고의 패키지

flutter_rocket 프로젝트 이미지
스타
13
포크
3
최근 푸시(UTC)
2026. 4. 23.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

logo-2 Flutter Rocket

The ultimate power-up for your Flutter state management and API integration.

Pub License: MIT Flutter CI

Flutter Rocket is a high-performance, lightweight state management and API integration solution. It simplifies how you handle data from your backend to your UI while providing premium performance optimizations out of the box.


🚀 Key Features

  • ⚡ Ultra Performance: Selective rebuilds ensure only necessary widgets update.
  • 🔗 Seamless API Integration: Built-in client with support for interceptors and caching.
  • 🛠️ Powerful Tooling: Generate optimized models instantly using Rocket CLI.
  • 📉 Minimal Boilerplate: Write less code, build more features.
  • 📦 Modular Architecture: Use only what you need (Listenables, Models, Clients, Views).
  • 🛡️ Type Safe: Fully typed models and requests.

📦 Package Ecosystem

Package Version Description
flutter_rocket pub package Core bundle for Flutter.
rocket_model pub package A type‑safe, reactive model layer.
rocket_client pub package HTTP client with caching.
rocket_view pub package UI state management widgets.
rocket_mini_view pub package A tiny, reactive widget.
rocket_singleton pub package Fast, type‑safe in‑memory storage.
rocket_cache pub package A persistence and caching layer.
rocket_cli pub package CLI for model generation.

📖 Table of Contents


🎨 Graphic Tutorial

Flutter Rocket Architecture

Explore the Miro Board


📦 Installation

Add this to your pubspec.yaml:

dependencies:
  flutter_rocket: ^latest_version

⚡ Quick Start

1. Define your Model

Use Rocket CLI to generate this automatically, or define it manually:

import 'package:flutter_rocket/flutter_rocket.dart';

const String postTitleField = "title";

class Post extends RocketModel<Post> {
  String? title;

  Post({this.title});

  @override
  void fromJson(Map<String, dynamic>? json, {bool isSub = false}) {
    if (json == null) return;
    title = json[postTitleField];
    super.fromJson(json, isSub: isSub);
  }

  void updateFields({String? titleField}) {
    List<String> fields = [];
    if (titleField != null) {
      title = titleField;
      fields.add(postTitleField);
    }
    rebuildWidget(fromUpdate: true, fields: fields.isEmpty ? null : fields);
  }

  @override
  Post get instance => Post();
}
2. Setup the Client

Initialize your client and save it to the Rocket singleton:

void main() {
  RocketRequest request = RocketRequest(url: 'https://jsonplaceholder.typicode.com');
  Rocket.add(rocketRequestKey, request);
  runApp(MyApp());
}
3. Bind UI with RocketView

Display your data effortlessly:

class PostList extends StatelessWidget {
  final Post postModel = Post();

  @override
  Widget build(BuildContext context) {
    return RocketView(
      model: postModel,
      fetch: ({bool refresh = false}) => Rocket.get(rocketRequestKey).request('posts', model: postModel),
      builder: (context, state) {
        return ListView.builder(
          itemCount: postModel.all!.length,
          itemBuilder: (context, index) {
            final post = postModel.all![index];
            return Text(post.title!);
          },
        );
      },
    );
  }
}

✨ Premium Optimizations

Selective Rebuilds

Stop rebuilding your entire list when only one item changes. Specify fields in RocketView to listen to specific property updates.

RocketView(
  model: currentPost,
  fields: [postTitleField], // Only rebuilds when 'title' changes
  builder: (context, state) => Text(currentPost.title!),
)
Automatic Bubbling

Nested models automatically notify their parents. If a Post inside a Posts list updates, the list view is notified automatically without any extra code.


🛠️ Advanced Features

Interceptors

Handle global logic like Auth headers or logging:

RocketClient(
  url: 'https://api.example.com',
  beforeRequest: (request) {
    request.headers['Authorization'] = 'Bearer your_token';
    return request;
  },
);
Caching

Speed up your app with built-in caching:

RocketCache.init(); // Initialize first

client.request(
  'posts',
  model: post,
  cacheKey: 'all_posts',
  cacheDuration: Duration(days: 1),
);

🛠️ Rocket CLI

Generate your optimized models instantly from JSON strings or files.

# Install
dart pub global activate rocket_cli

# Run
rocket_cli -j '{"id":1, "title":"Hello"}' -n Post

🔗 Links & Support

Resource Link
Documentation Wiki
Examples GitHub Examples
Community Discussions
Bugs Issue Tracker

Author

Built with ❤️ by the Jahez Team.

Majara GitHub avatar
GitHub 작성자

Majara ↗

언어DartC++CMakeHTMLSwiftRubyCKotlinObjective-C

분류

이 저장소가 배포한 패키지

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗