-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ArthurHeitmann/NierScript…
- Loading branch information
Showing
3 changed files
with
81 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
75 changes: 75 additions & 0 deletions
75
lib/widgets/propEditors/customXmlProps/conditionEditor.dart
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,75 @@ | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import '../../../customTheme.dart'; | ||
import '../../../stateManagement/ChangeNotifierWidget.dart'; | ||
import '../../../stateManagement/xmlProps/xmlProp.dart'; | ||
import '../simpleProps/XmlPropEditorFactory.dart'; | ||
import '../simpleProps/propEditorFactory.dart'; | ||
import 'puidReferenceEditor.dart'; | ||
|
||
class ConditionEditor extends ChangeNotifierWidget { | ||
final XmlProp prop; | ||
final bool showDetails; | ||
|
||
ConditionEditor({super.key, required this.prop, required this.showDetails}) : super(notifier: prop); | ||
|
||
@override | ||
State<ConditionEditor> createState() => _ConditionEditorState(); | ||
} | ||
|
||
class _ConditionEditorState extends ChangeNotifierState<ConditionEditor> { | ||
@override | ||
Widget build(BuildContext context) { | ||
var label = widget.prop.get("condition")?.get("state")?.get("label")?.value; | ||
var value = widget.prop.get("condition")?.get("state")?.get("value"); | ||
var args = widget.prop.get("args"); | ||
|
||
return Padding( | ||
padding: const EdgeInsets.all(4.0), | ||
child: Row( | ||
children: [ | ||
// Icon(Icons.help), | ||
Text( | ||
"?", | ||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), | ||
), | ||
SizedBox(width: 12), | ||
Expanded( | ||
child: Container( | ||
decoration: BoxDecoration( | ||
color: getTheme(context).formElementBgColor, | ||
borderRadius: BorderRadius.circular(5), | ||
), | ||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
PuidReferenceEditor(prop: widget.prop.get("puid")!, showDetails: widget.showDetails), | ||
Divider(color: getTheme(context).textColor!.withOpacity(0.75), thickness: 2,), | ||
if (label != null) | ||
makePropEditor(label) | ||
else | ||
Text("No label"), | ||
if (value != null) | ||
Padding( | ||
padding: const EdgeInsets.only(left: 8.0), | ||
child: makeXmlPropEditor(value, widget.showDetails), | ||
), | ||
if (args != null) | ||
Padding( | ||
padding: const EdgeInsets.only(left: 8.0), | ||
child: makeXmlPropEditor(args, widget.showDetails), | ||
), | ||
], | ||
), | ||
), | ||
) | ||
] | ||
), | ||
); | ||
} | ||
} | ||
|
||
|
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