Skip to content

Commit

Permalink
fix: Addition of parameters for each widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Mar 8, 2023
1 parent 0de603c commit bf77dc6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
10 changes: 5 additions & 5 deletions packages/katana_ui/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725"
sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0"
url: "https://pub.dev"
source: hosted
version: "8.4.3"
version: "8.4.4"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -181,10 +181,10 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4"
sha256: "5be16bf1707658e4c03078d4a9b90208ded217fb02c163e207d334082412f2fb"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
version: "2.2.5"
encrypt:
dependency: transitive
description:
Expand Down Expand Up @@ -361,7 +361,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.9"
version: "1.2.1"
lints:
dependency: transitive
description:
Expand Down
15 changes: 8 additions & 7 deletions packages/katana_ui/lib/ui/card_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CardTile extends StatelessWidget {
this.image,
this.backgroundColor,
this.shadowColor,
this.surfaceTintColor,
this.elevation,
this.shape,
this.margin,
Expand Down Expand Up @@ -69,11 +68,6 @@ class CardTile extends StatelessWidget {
/// カードの影の色。
final Color? shadowColor;

/// The color to apply to the image.
///
/// 画像に適用する色。
final Color? surfaceTintColor;

/// The z-coordinate at which to place this card.
///
/// このカードを配置するz座標。
Expand Down Expand Up @@ -145,6 +139,11 @@ class CardTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
final backgroundColor =
this.backgroundColor ?? Theme.of(context).colorScheme.surface;
final textColor = this.textColor ?? Theme.of(context).colorScheme.onSurface;
final iconColor = this.iconColor ?? Theme.of(context).colorScheme.onSurface;

return Container(
width: width,
height: height,
Expand All @@ -153,7 +152,7 @@ class CardTile extends StatelessWidget {
color: backgroundColor,
shadowColor: shadowColor,
elevation: elevation,
surfaceTintColor: surfaceTintColor,
surfaceTintColor: backgroundColor,
shape: shape,
margin: EdgeInsets.zero,
borderOnForeground: borderOnForeground,
Expand All @@ -174,13 +173,15 @@ class CardTile extends StatelessWidget {
),
ListTile(
title: title,
mouseCursor: SystemMouseCursors.click,
subtitle: subtitle,
leading: leading,
trailing: trailing,
isThreeLine: isThreeLine,
contentPadding: contentPadding,
iconColor: iconColor,
textColor: textColor,
tileColor: backgroundColor,
),
],
),
Expand Down
19 changes: 18 additions & 1 deletion packages/katana_ui/lib/ui/label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Label extends StatelessWidget {
this.textStyle,
this.iconSize,
this.leadingSpace,
this.alignment,
this.textAlign = TextAlign.start,
});

/// The text to display.
Expand Down Expand Up @@ -81,12 +83,23 @@ class Label extends StatelessWidget {
/// アイコンとテキストの間のスペース。
final double? leadingSpace;

/// Text position.
///
/// テキストの位置。
final TextAlign textAlign;

/// Label Location.
///
/// ラベルの位置。
final Alignment? alignment;

@override
Widget build(BuildContext context) {
final textTheme = textStyle ?? Theme.of(context).textTheme.titleLarge;

return Container(
padding: padding,
alignment: alignment,
decoration: decoration,
color: backgroundColor,
child: Row(
Expand All @@ -104,7 +117,11 @@ class Label extends StatelessWidget {
),
SizedBox(width: leadingSpace ?? 16),
],
Text(text, style: textTheme?.copyWith(color: color)),
Text(
text,
style: textTheme?.copyWith(color: color),
textAlign: textAlign,
),
],
),
);
Expand Down

0 comments on commit bf77dc6

Please sign in to comment.