पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv5.6.0

go_router_modular

GoRouter के साथ Flutter के लिए मॉड्यूलर रूटिंग और डिपेंडेंसी इंजेक्शन। मॉड्यूल संचार के लिए ईवेंट-ड्रिवन आर्किटेक्चर और माइक्रो-फ्रंटएंड सपोर्ट के साथ विशेषताएं।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
303
लाइक
35
Pub अंक
140

पैकेज इंस्टॉल करें

flutter pub add go_router_modular

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

GoRouter Modular एक Flutter पैकेज है जो GoRouter को मॉड्यूलर रूटिंग और निर्भरता इंजेक्शन के साथ बढ़ाता है, जिससे स्केलेबल ऐप आर्किटेक्चर संभव होता है। यह मॉड्यूल के बीच इवेंट-आधारित संचार का समर्थन करता है और माइक्रो-फ्रंटएंड पैटर्न को सुविधाजनक बनाता है। बड़े पैमाने पर एप्लिकेशन के लिए डिज़ाइन किया गया, यह कोड को अलग करने, पुनर्उपयोग करने और स्वतंत्र मॉड्यूल विकास को बढ़ावा देता है। पैकेज GoRouter के साथ बिना किसी दिक्कत के एकीकृत होता है और जटिल नेविगेशन और मॉड्यूलर घटकों के बीच राज्य प्रबंधन के लिए इसकी क्षमता को बढ़ाता है।

उपयोग

  • बड़े पैमाने के फ्लटर एप्लिकेशन
  • माइक्रो-फ्रंटेंड आर्किटेक्चर
  • मॉड्यूलर ऐप विकास
  • स्वतंत्र मॉड्यूल डेप्लॉयमेंट
  • घटना-आधारित मॉड्यूल-मॉड्यूल संचार
  • स्केलेबल नेविगेशन प्रणाली

मुख्य विशेषताएँ

  • GoRouter के साथ मॉड्यूलर रूटिंग
  • निर्मित निर्भरता इंजेक्शन
  • घटना-आधारित मॉड्यूल संचार
  • माइक्रो-फ्रंटएंड्स का समर्थन
  • आसान मॉड्यूल एम्बेडिंग
  • क्रॉस-प्लेटफॉर्म संगतता

इनके लिए उपयुक्त

  • जटिल Flutter ऐप बनाने वाले डेवलपर्स
  • मॉड्यूलर आर्किटेक्चर का उपयोग करने वाली टीमें
  • पुनर्उपयोगी UI घटकों की आवश्यकता वाले प्रोजेक्ट
  • एक से अधिक फीचर मॉड्यूल वाले ऐप्स
  • स्केलेबिलिटी को प्राथमिकता देने वाली इंजीनियरिंग टीमें

विचार योग्य बातें

  • GoRouter की समझ आवश्यक है
  • शुरुआती लोगों के लिए सीखने का ढलान अधिक तीव्र है
  • मॉड्यूल पंजीकरण के लिए अतिरिक्त सेटअप
  • बिल्ड कठिनाई में वृद्धि हो सकती है
  • छोटे ऐप्स के बजाय बड़े प्रोजेक्ट्स के लिए सबसे उपयुक्त

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Go Router Modular

🧩 GoRouter Modular 💉

Modular architecture, dependency injection & route management on top of GoRouter.

Pub Version Pub Points GitHub Stars License

GoRouter Modular brings a modular architecture on top of GoRouter, with per-module dependency injection and automatic dispose. Split a large app into independent, lazy-loaded feature modules — perfect for micro frontends and scalable, team-friendly codebases. 🚀

Read the Docs

💡 Inspired by flutter_modular by Flutterando — we're grateful for their contribution to the Flutter ecosystem.


✨ Features

🧩 Modular Architecture Independent, reusable feature modules
💉 Dependency Injection Built-in DI with automatic dispose
🛣️ GoRouter Integration Type-safe, declarative navigation
🎭 Event System Decoupled, event-driven communication between modules
🚀 Lazy Loading Modules load on demand with efficient memory management
🛡️ Type Safety Fully type-safe with compile-time checks

📦 Installation

flutter pub add go_router_modular

🚀 Quick Start

1. Configure & run — bootstrap in main.dart:

import 'package:flutter/foundation.dart'; // kDebugMode
import 'package:flutter/material.dart';
import 'package:go_router_modular/go_router_modular.dart';

import 'src/app_module.dart';
import 'src/app_widget.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Modular.configure(
    appModule: AppModule(),
    initialRoute: '/',
    // Logs only in debug builds — release stays quiet.
    debugLogDiagnostics: kDebugMode,
  );

  runApp(const AppWidget());
}

class AppWidget extends StatelessWidget {
  const AppWidget({super.key});

  @override
  Widget build(BuildContext context) => ModularApp.router(title: 'My App');
}

2. Compose modules — the root AppModule registers app-wide binds and mounts each feature:

class AppModule extends Module {
  @override
  void binds(Injector i) {
    i
      ..addSingleton<DioClient>((i) => DioClient())
      ..addSingleton<AuthStore>((i) => AuthStore());
  }

  @override
  List<ModularRoute> get routes => [
        ModuleRoute('/', module: HomeModule()),
        ModuleRoute('/profile', module: ProfileModule()),
      ];
}

3. Define a feature module — its own binds and routes, disposed automatically when you leave it:

class HomeModule extends Module {
  @override
  void binds(Injector i) => i.addSingleton<HomeController>((i) => HomeController());

  @override
  List<ModularRoute> get routes => [
        ChildRoute(
          '/',
          name: 'home',
          child: (context, state) => HomePage(controller: Modular.get<HomeController>()),
        ),
      ];
}

4. Navigate — named-only, type-safe:

context.goNamed('profile');            // replace the stack
context.pushNamed('home');             // push on top
final controller = Modular.get<HomeController>(); // resolve a dependency

🤖 Agent Skill

This repo ships an Agent Skill that teaches AI coding agents (Claude Code, Cursor, Codex, OpenCode, and others) the recommended conventions for this package — per-feature route files, named-only navigation, typed binds via the .. cascade, synchronous modules, and kDebugMode-gated logs. The agent then applies them automatically when you scaffold routes, modules, or navigation.

Install it into your project with one command (via the skills CLI):

npx skills add eduardohr-muniz/go_router_modular -s go-router-modular

The CLI detects your installed agents and drops the skill into the right place (e.g. .claude/skills/). Add -g to install it globally for every project.

Optional — events add-on

If your app uses the event system (EventModule, ModularEvent, ModularEventMixin) for decoupled cross-module communication, install the separate events skill too:

npx skills add eduardohr-muniz/go_router_modular -s go-router-modular-events

🤝 Contributing

Contributions are very welcome! Open an issue to discuss major changes, then submit a PR with a clear description of the edits.

📄 License

Distributed under the MIT license. See LICENSE for details.


Transform your Flutter app into a scalable, modular masterpiece. ✨

Contributors

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 4 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।