Skip to content

added decoration, width, height parameter#41

Open
sbaskoy wants to merge 5 commits intomduccc:masterfrom
sbaskoy:master
Open

added decoration, width, height parameter#41
sbaskoy wants to merge 5 commits intomduccc:masterfrom
sbaskoy:master

Conversation

@sbaskoy
Copy link

@sbaskoy sbaskoy commented May 9, 2023

  • The sample application was not working. updated.

  • It was giving overflow error in different sizes. Fixed.

  /// [BoxDecoration] of day of week [Container]
  final BoxDecoration? dayOfWeekDecoration;

  /// [BoxDecoration] of calender [Container]
  final BoxDecoration? calenderDecoration;

  /// [BoxDecoration] of day [Container]
  final BoxDecoration? dayDecoration;

  /// [double] width  of day [Container]
  /// if null, it will be [Expanded]
  final double? dayWidth;

  /// [double] height  of day [Container]
  /// if null, it will be [Expanded]
  final double? dayHeight;

  /// [double] height  of day of week [Container]
  /// if null, it will be [Expanded]
  final double? dayOfWeekHeight;

  /// [double] width  of day [Container]
  /// if null, it will be [Expanded]
  final double? dayOfWeekWidth;

The above parameters have been added.

calenderDecoration BoxDecoration of calender Container

dayOfWeekDecoration BoxDecoration of day of week Container

dayDecoration BoxDecoration of day Container

dayWidth width of day Container

dayHeight height of day Container

dayOfWeekWidth width of day of week Container

dayOfWeekHeight height of day of week Container

Wraps with expanded if these two parameters are null. width != null || height != null

See item_container.dart file for details

  @override
  Widget build(BuildContext context) => width != null || height != null
      ? Container(
          margin: margin,
          width: width,
          height: height,
          decoration: decoration,
          alignment: alignment,
          child: child,
        )
      : Expanded(
          child: (decoration != null || alignment != null)
              ? Container(
                  margin: margin,
                  decoration: decoration,
                  alignment: alignment ?? Alignment.center,
                  child: child,
                )
              : Container(child: child),
        );

@mduccc
Copy link
Owner

mduccc commented Jun 8, 2023

@sbaskoy Please fix the failing check!
Some unit tests are failing.

@mduccc mduccc self-requested a review June 8, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants