Skip to content

Commit

Permalink
fix: Shimmer name change.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Aug 11, 2023
1 parent 327ff9a commit 9ad7a5b
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions packages/katana_ui/lib/ui/shimmer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ part of katana_ui;
/// シマーエフェクトを表示するコンテナを作成します。
///
/// 文字の変わりにシマーエフェクトを表示する場合に利用します。
class Shimmer extends StatelessWidget {
class ShimmerBox extends StatelessWidget {
/// Create a container to display the shimmer effect.
///
/// Used to display a shimmer effect instead of text.
///
/// シマーエフェクトを表示するコンテナを作成します。
///
/// 文字の変わりにシマーエフェクトを表示する場合に利用します。
const Shimmer({
const ShimmerBox({
super.key,
this.borderRadius,
this.baseColor,
Expand All @@ -24,8 +24,14 @@ class Shimmer extends StatelessWidget {
this.height,
this.padding = const EdgeInsets.all(0),
this.shape = BoxShape.rectangle,
this.child,
});

/// Widget for the container inside.
///
/// 中身のコンテナのウィジェット。
final Widget? child;

/// Container height.
///
/// コンテナの高さ。
Expand Down Expand Up @@ -68,27 +74,28 @@ class Shimmer extends StatelessWidget {
baseColor: baseColor ?? Theme.of(context).colorScheme.surface,
highlightColor:
highlightColor ?? Theme.of(context).colorScheme.background,
child: Container(
decoration: BoxDecoration(
borderRadius: borderRadius ?? BorderRadius.circular(h / 4),
color: baseColor ?? Theme.of(context).colorScheme.surface,
shape: shape,
),
margin: padding,
height: h,
width: width,
),
child: child ??
Container(
decoration: BoxDecoration(
borderRadius: borderRadius ?? BorderRadius.circular(h / 4),
color: baseColor ?? Theme.of(context).colorScheme.surface,
shape: shape,
),
margin: padding,
height: h,
width: width,
),
);
}
}

/// Create a [Shimmer] effect that spans multiple lines.
/// Create a [ShimmerBox] effect that spans multiple lines.
///
/// 複数行に渡る[Shimmer]エフェクトを作成します。
/// 複数行に渡る[ShimmerBox]エフェクトを作成します。
class ShimmerMultiLine extends StatelessWidget {
/// Create a [Shimmer] effect that spans multiple lines.
/// Create a [ShimmerBox] effect that spans multiple lines.
///
/// 複数行に渡る[Shimmer]エフェクトを作成します。
/// 複数行に渡る[ShimmerBox]エフェクトを作成します。
const ShimmerMultiLine({
super.key,
this.borderRadius,
Expand Down Expand Up @@ -156,7 +163,7 @@ class ShimmerMultiLine extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (var i = 0; i < lineCount; i++) ...[
Shimmer(
ShimmerBox(
baseColor: baseColor,
highlightColor: highlightColor,
width: width,
Expand Down

0 comments on commit 9ad7a5b

Please sign in to comment.