-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:duit_kernel/duit_kernel.dart'; | ||
import 'package:flutter_duit/src/ui/models/attended_model.dart'; | ||
|
||
final class MetaAttributes extends AttendedModel<Map<String, dynamic>> | ||
implements DuitAttributes<MetaAttributes> { | ||
MetaAttributes({ | ||
required super.value, | ||
}); | ||
|
||
factory MetaAttributes.fromJson(Map<String, dynamic> json) { | ||
return MetaAttributes( | ||
value: json, | ||
); | ||
} | ||
|
||
@override | ||
MetaAttributes copyWith(MetaAttributes other) { | ||
return MetaAttributes( | ||
value: other.value, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import "package:duit_kernel/duit_kernel.dart"; | ||
import "package:flutter/material.dart"; | ||
import "package:flutter_duit/flutter_duit.dart"; | ||
import "package:flutter_duit/src/attributes/index.dart"; | ||
|
||
class DuitMetaWidget extends StatefulWidget { | ||
final Widget child; | ||
final UIElementController controller; | ||
|
||
const DuitMetaWidget({ | ||
super.key, | ||
required this.child, | ||
required this.controller, | ||
}); | ||
|
||
@override | ||
State<DuitMetaWidget> createState() => _DuitMetaWidgetState(); | ||
} | ||
|
||
class _DuitMetaWidgetState extends State<DuitMetaWidget> | ||
with ViewControllerChangeListener<DuitMetaWidget, MetaAttributes> { | ||
@override | ||
void initState() { | ||
attachStateToController(widget.controller); | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return widget.child; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters