backgroundImage property

背景画像

Implementation

RenderItem<DecorationBackgroundImage> get backgroundImage {
  if (historyRenderItems.isEmpty) {
    throw Exception(
      'backgroundImage is not found: historyRenderItems is empty.',
    );
  }

  final backgroundImageItems = historyRenderItems[currentHistoryIndex]
      .whereType<RenderItem<DecorationBackgroundImage>>()
      .toList();

  if (backgroundImageItems.isNotEmpty) {
    return backgroundImageItems.first;
  } else {
    throw Exception(
      'backgroundImage is not found: No backgroundImage in the latest history.',
    );
  }
}