generateFooter method

dynamic generateFooter()

Implementation

Widget? generateFooter() {
  if (widget.footer != null) {
    return widget.footer;
  }
  final List<Widget> children = [];

  if (widget.onCancel != null) {
    children.add(
      OutlinedButton(
        key: HtmlEditor.cancelEditKey,
        onPressed: widget.onCancel,
        child: const Text('Cancel'),
      ),
    );
  }
  children.add(
    const SizedBox(
      width: 10,
    ),
  );
  if (widget.onSave != null) {
    children.add(
      ActerPrimaryActionButton(
        key: HtmlEditor.saveEditKey,
        onPressed: () => _triggerExport(widget.onSave!),
        child: const Text('Save'),
      ),
    );
  }

  if (children.isNotEmpty) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        children: children,
      ),
    );
  }
  return null;
}