0 purchases
dynamic component
Build your Dynamic components that support simple logic and variable
Features #
✅ Dynamic variable
✅ Dynamic UI
✅ UI Logic
✅ If
✅ Tap Event (Multiple)
✅ When
✅ codegen
Getting started #
dependencies:
dynamic_component: any
dev_dependencies:
# option
dynamic_component_codegen: any
copied to clipboard
Usage #
Create your widget extends DynamicComponent #
Example code: example/lib/widget/my_list_item.dart
import 'package:dynamic_component/dynamic_component.dart';
import 'package:dynamic_component/dynamic_component_anotation.dart';
import 'package:example/widget/image_widget.dart';
part 'move_item.g.dart';
@Component(variables: [
'movie_name',
'movie_image',
])
class MovieItem extends DynamicComponent with _$MovieItemComponent {
MovieItem({
Map<String, dynamic>? data,
Key? key,
}) : super(data: data, key: key);
@override
Widget buildWidget(BuildContext context) {
return Column(
children: [
Text(movieName), // genarated,read from data['movie_name']
ImageWidget(url: movieImage), // data['movie_image']
],
);
}
@override
DSLInfo? get dslInfo => null;
}
copied to clipboard
run flutter pub run build_runner build in your terminal
Export json #
Example code: example/test/export_all_widget_test.dart
MovieItem(data: _movieItemDataForExport).exportJson(context);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.