| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The Flutter Dynamic Components package enables the creation of dynamic Flutter screens based on backend-provided JSON configurations. With this powerful tool, developers can define UI elements through JSON, including sliders, text blocks, images, and category views. This approach greatly accelerates UI development and iteration, allowing for quick updates without needing app redeployment.
To integrate the Flutter Dynamic Components package into your project, add it to your pubspec.yaml file along with its dependencies:
dependencies:
flutter_dynamic_components: { version }Begin by defining your screen's UI components and their properties in a JSON configuration according to the predefined schema.
Here's a basic usage example to help you get started:
import 'package:flutter/material.dart';
import 'package:flutter_dynamic_components/flutter_dynamic_components.dart';
class YourDynamicScreen extends StatelessWidget {
final List<PropertyBase> properties = // a dart representation of the json properties from the server
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Builder(
builder: (context) {
return ComponentsManager(
properties: properties,
componentsProperties: ComponentsProperties(
sliderBorderRadius: 12.0,
componentsPadding: const EdgeInsets.all(0),
carouselOptions: CarouselOptions(
height: 195,
aspectRatio: 1.5 / 3,
enlargeCenterPage: true,
autoPlay: true,
),
),
onSliderCardClicked: (image) {
print("Card clicked: $image");
},
);
},
),
),
);
}
}We warmly welcome contributions! Feel free to submit pull requests or create issues for bugs, features, or suggestions.
This project is licensed under the MIT License. See the LICENSE file for more details.
| Back | FazBrowse Home | New Git URL |