सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक डार्ट पैकेज जो theme_extensions_builder के लिए एनोटेशन प्रदान करता है, जिससे फ्लटर एप्लिकेशन में थीम एक्सटेंशन के निर्माण और प्रबंधन को सुगम बनाया जा सकता है। यह theme_extensions_builder का साथी है, जो एनोटेशन के माध्यम से संकलन-समय कोड जनरेशन समर्थन प्रदान करता है। इस पैकेज में खुद कोई निष्पादन तर्क नहीं है, लेकिन थीम कॉन्फ़िगरेशन को सरल बनाकर बॉइलरप्लेट को कम करके विकासकर्ता उत्पादकता को बढ़ाता है। यह केवल theme_extensions_builder पैकेज के साथ काम करने के लिए डिज़ाइन किया गया है।
उपयोग
थीम एक्सटेंशन क्लासेस जनरेट करना
थीम कॉन्फ़िगरेशन सरल बनाना
प्रकार-सुरक्षित थीम हैंडलिंग सक्षम करें
थीम सेटअप में बॉयलरप्लेट को कम करना
डायनामिक थीमिंग वर्कफ़्लो का समर्थन करना
मुख्य विशेषताएँ
संकलन समय कोड उत्पादन
theme_extensions_builder के साथ एकीकरण
प्रकार सुरक्षित थीम परिभाषाएं
न्यूनतम रनटाइम ओवरहेड
एनोटेशन-आधारित विकास
इनके लिए उपयुक्त
थीम_एक्सटेंशन्स_बिल्डर का उपयोग करने वाले Flutter विकासकर्ता
रखरखाव विषय प्रणाली के लिए प्राथमिकता देने वाली टीमें
स्केलेबल थीम समाधान की आवश्यकता वाले प्रोजेक्ट
कम बॉलरप्लेट कोड चाहने वाले डेवलपर्स
जटिल या डायनामिक थीम आवश्यकताओं वाले ऐप
विचार योग्य बातें
कार्य करने के लिए theme_extensions_builder की आवश्यकता है
कोई स्वतंत्र कार्यक्षमता नहीं
कोड जनरेशन के लिए build_runner पर निर्भर है
समर्थित Flutter प्रोजेक्ट में ही उपयोग के लिए सीमित
सरल स्थिर थीम के लिए उपयुक्त नहीं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
theme_extensions_builder is a powerful code generator for Flutter's ThemeExtension classes. It eliminates boilerplate code by automatically generating copyWith, lerp, ==, and hashCode methods, along with convenient BuildContext extensions for easy theme access.
Custom Components: Buttons, cards, and typography showcases
Best Practices: Real-world organization patterns
🛠️ Development
The repository is a pub workspace: one flutter pub get at the root resolves every package, including the example app.
flutter pub get
scripts/prepare_push.sh # format, analyze, build and test every package
scripts/update_goldens.sh # regenerate the golden files after a generator change
The generator tests run on the Dart SDK alone. The Flutter classes the fixtures use are small stand-ins in packages/theme_extensions_builder/test/fixtures/flutter_stubs.dart, with the same lerp and merge signatures as the real ones. The example app is where the generated code meets the real framework, so CI regenerates and analyzes it on every push.