Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null check operator used on a null value #171

Open
tauqeerkhattak opened this issue Oct 21, 2024 · 1 comment
Open

Null check operator used on a null value #171

tauqeerkhattak opened this issue Oct 21, 2024 · 1 comment
Labels
T: Fix Type: :bug: Bug Fixes

Comments

@tauqeerkhattak
Copy link

When using DatePageView, the following error is thrown:
StackTrace

The following _TypeError was thrown building ValueListenableBuilder<bool>(state:
I/flutter ( 1190): _ValueListenableBuilderState<bool>#35fd9):
I/flutter ( 1190): Null check operator used on a null value
I/flutter ( 1190): 
I/flutter ( 1190): The relevant error-causing widget was:
I/flutter ( 1190):   DatePageView
I/flutter ( 1190):   DatePageView:file:///D:/StudioProjects/organaise/organai_flutter/lib/ui/common/widgets/app_events_table.dart:725:21
I/flutter ( 1190): 
I/flutter ( 1190): When the exception was thrown, this was the stack:
I/flutter ( 1190): #0      ScrollPosition.pixels (package:flutter/src/widgets/scroll_position.dart:253:31)
I/flutter ( 1190): #1      ScrollController.offset (package:flutter/src/widgets/scroll_controller.dart:165:33)
I/flutter ( 1190): #2      ScrollController.debugFillDescription (package:flutter/src/widgets/scroll_controller.dart:329:45)
I/flutter ( 1190): #3      ScrollController.toString (package:flutter/src/widgets/scroll_controller.dart:304:5)
I/flutter ( 1190): #4      _StringBase._interpolate (dart:core-patch/string_patch.dart:871:19)
I/flutter ( 1190): #5      MultiDateScrollPosition.debugFillDescription (package:timetable/src/date/date_page_view.dart:327:36)
I/flutter ( 1190): #6      ViewportOffset.toString (package:flutter/src/rendering/viewport_offset.dart:266:5)
I/flutter ( 1190): #7      DiagnosticsProperty.valueToString (package:flutter/src/foundation/diagnostics.dart:2622:60)
I/flutter ( 1190): #8      DiagnosticsProperty.toDescription (package:flutter/src/foundation/diagnostics.dart:2639:21)
I/flutter ( 1190): #9      TextTreeRenderer._debugRender (package:flutter/src/foundation/diagnostics.dart:1201:31)
I/flutter ( 1190): #10     TextTreeRenderer.render (package:flutter/src/foundation/diagnostics.dart:1131:14)
I/flutter ( 1190): #11     TextTreeRenderer._debugRender (package:flutter/src/foundation/diagnostics.dart:1317:39)
I/flutter ( 1190): #12     TextTreeRenderer.render (package:flutter/src/foundation/diagnostics.dart:1131:14)
I/flutter ( 1190): #13     DiagnosticsNode.toStringDeep.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1777:9)
I/flutter ( 1190): #14     DiagnosticsNode.toStringDeep (package:flutter/src/foundation/diagnostics.dart:1784:6)
I/flutter ( 1190): #15     DiagnosticsNode.toString.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1706:18)
I/flutter ( 1190): #16     DiagnosticsNode.toString (package:flutter/src/foundation/diagnostics.dart:1718:6)
I/flutter ( 1190): #17     Diagnosticable.toString.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:3014:78)
I/flutter ( 1190): #18     Diagnosticable.toString (package:flutter/src/foundation/diagnostics.dart:3016:6)
I/flutter ( 1190): #19     DiagnosticsProperty.valueToString (package:flutter/src/foundation/diagnostics.dart:2622:60)
I/flutter ( 1190): #20     DiagnosticsProperty.toDescription (package:flutter/src/foundation/diagnostics.dart:2639:21)
I/flutter ( 1190): #21     TextTreeRenderer._debugRender (package:flutter/src/foundation/diagnostics.dart:1201:31)
I/flutter ( 1190): #22     TextTreeRenderer.render (package:flutter/src/foundation/diagnostics.dart:1131:14)
I/flutter ( 1190): #23     TextTreeRenderer._debugRender (package:flutter/src/foundation/diagnostics.dart:1317:39)
I/flutter ( 1190): #24     TextTreeRenderer.render (package:flutter/src/foundation/diagnostics.dart:1131:14)
I/flutter ( 1190): #25     DiagnosticsNode.toStringDeep.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1777:9)
I/flutter ( 1190): #26     DiagnosticsNode.toStringDeep (package:flutter/src/foundation/diagnostics.dart:1784:6)
I/flutter ( 1190): #27     DiagnosticsNode.toString.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1706:18)
I/flutter ( 1190): #28     DiagnosticsNode.toString (package:flutter/src/foundation/diagnostics.dart:1718:6)
I/flutter ( 1190): #29     Diagnosticable.toString.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:3014:78)
I/flutter ( 1190): #30     Diagnosticable.toString (package:flutter/src/foundation/diagnostics.dart:3016:6)
I/flutter ( 1190): #31     _StringBase._interpolate (dart:core-patch/string_patch.dart:871:19)
I/flutter ( 1190): #32     Element.rebuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:5316:38)
I/flutter ( 1190): #33     Element.rebuild (package:flutter/src/widgets/framework.dart:5323:6)
I/flutter ( 1190): #34     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5599:5)
I/flutter ( 1190): #35     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5771:11)
I/flutter ( 1190): #36     ComponentElement.mount (package:flutter/src/widgets/framework.dart:5593:5)
I/flutter ( 1190): ...     Normal element mounting (28 frames)
I/flutter ( 1190): #64     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
I/flutter ( 1190): #65     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7035:36)
I/flutter ( 1190): #66     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7047:32)
I/flutter ( 1190): ...     Normal element mounting (7 frames)
I/flutter ( 1190): #73     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
I/flutter ( 1190): #74     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7035:36)
I/flutter ( 1190): #75     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7047:32)
I/flutter ( 1190): ...     Normal element mounting (33 frames)
I/flutter ( 1190): #108    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
I/flutter ( 1190): #109    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:7035:36)
I/flutter ( 1190): #110    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:7047:32)
I/flutter ( 1190): #111    Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
I/flutter ( 1190): #112    Element.updateChild (package:flutter/src/widgets/framework.dart:3963:18)
I/flutter ( 1190): #113    _LayoutBuilderElement._rebuildWithConstraints.updateChildCallback (package:flutter/src/widgets/layout_builder.dart:207:18)
I/flutter ( 1190): #114    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3038:19)
I/flutter ( 1190): #115    _LayoutBuilderElement._rebuildWithConstraints (package:flutter/src/widgets/layout_builder.dart:231:12)
I/flutter ( 1190): #116    RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:2719:59)
I/flutter ( 1190): #117    PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:1098:15)
I/flutter ( 1190): #118    RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:2719:14)
I/flutter ( 1190): #119    RenderConstrainedLayoutBuilder.rebuildIfNecessary (package:flutter/src/widgets/layout_builder.dart:278:5)
I/flutter ( 1190): #120    _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:369:5)
I/flutter ( 1190): #121    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #122    RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:21)
I/flutter ( 1190): #123    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #124    ChildLayoutHelper.layoutChild (package:flutter/src/rendering/layout_helper.dart:61:11)
I/flutter ( 1190): #125    RenderFlex._computeSizes (package:flutter/src/rendering/flex.dart:1009:71)
I/flutter ( 1190): #126    RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:1051:32)
I/flutter ( 1190): #127    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #128    ChildLayoutHelper.layoutChild (package:flutter/src/rendering/layout_helper.dart:61:11)
I/flutter ( 1190): #129    RenderStack._computeSize (package:flutter/src/rendering/stack.dart:595:43)
I/flutter ( 1190): #130    RenderStack.performLayout (package:flutter/src/rendering/stack.dart:622:12)
I/flutter ( 1190): #131    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #132    RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:234:12)
I/flutter ( 1190): #133    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #134    MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:173:12)
I/flutter ( 1190): #135    _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:1092:7)
I/flutter ( 1190): #136    MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:237:7)
I/flutter ( 1190): #137    RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:404:14)
I/flutter ( 1190): #138    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #139    RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:21)
I/flutter ( 1190): #140    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #141    RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:21)
I/flutter ( 1190): #142    _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1448:11)
I/flutter ( 1190): #143    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #144    _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:371:14)
I/flutter ( 1190): #145    RenderObject.layout (package:flutter/src/rendering/object.dart:2608:7)
I/flutter ( 1190): #146    MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:173:12)
I/flutter ( 1190): #147    _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:1092:7)
I/flutter ( 1190): #148    MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:237:7)
I/flutter ( 1190): #149    RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:404:14)
I/flutter ( 1190): #150    RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:2446:7)
I/flutter ( 1190): #151    PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1052:18)
I/flutter ( 1190): #152    PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1065:15)
I/flutter ( 1190): #153    RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:602:23)
I/flutter ( 1190): #154    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1164:13)
I/flutter ( 1190): #155    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5)
I/flutter ( 1190): #156    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
I/flutter ( 1190): #157    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
I/flutter ( 1190): #158    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176:5)
I/flutter ( 1190): #162    _invoke (dart:ui/hooks.dart:314:10)
I/flutter ( 1190): #163    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
I/flutter ( 1190): #164    _drawFrame (dart:ui/hooks.dart:283:31)

Code

Expanded(
  child: Column(
    mainAxisSize: MainAxisSize.min,
    children: [
      DatePageView(
        shrinkWrapInCrossAxis: true,
        builder: _buildDate,
        controller: _dateController,
      ),
      numberOfEventsThisWeek > 3 && (isWeekView || isDayView)
        ? const Padding(
          padding: EdgeInsets.symmetric(vertical: 2.0),
          child: SizedBox(
            height: 60,
            child: ScrollBarView(
              child: MultiDateEventHeader(),
            ),
          ),
        )
        : const Padding(
          padding: EdgeInsets.symmetric(vertical: 2.0),
          child: MultiDateEventHeader(),
        ),
      ],
    ),
  ),

Screenshot
flutter_01

Environment:

  • OS version: Android 14.0
  • Flutter version: 3.24.3
  • Package version: 1.0.0-alpha.14
  • Android Studio: LadyBug
@tauqeerkhattak tauqeerkhattak added the T: Fix Type: :bug: Bug Fixes label Oct 21, 2024
@tauqeerkhattak
Copy link
Author

Also note that this issue only occurs when we add this line in main function.

debugPrintRebuildDirtyWidgets = true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Fix Type: :bug: Bug Fixes
Projects
None yet
Development

No branches or pull requests

1 participant