Skip to content

DateRangePickerDialog crashes when currentDate is omitted #177441

Description

@bleroux

Steps to reproduce

  1. Run the code sample

Expected results

The DateRangePickerDialog content is shown

Actual results

Null check operator used on a null value

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const ReproApp());

class ReproApp extends StatelessWidget {
  const ReproApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Center(
        child: DateRangePickerDialog(
          firstDate: DateTime(2021),
          lastDate: DateTime(2031, DateTime.december, 31),
          initialEntryMode: DatePickerEntryMode.inputOnly,
        ),
      ),
    );
  }
}

Screenshots or Video

Logs

Logs
════════ Exception caught by widgets library ═══════════════════════════════════
The following _TypeError was thrown building _InputDateRangePickerDialog(dirty, dependencies: [InheritedCupertinoTheme, MediaQuery, _InheritedTheme, _LocalizationsScope-[GlobalKey#8240a]]):
Null check operator used on a null value

The relevant error-causing widget was:
    DateRangePickerDialog DateRangePickerDialog:file:///Users/bruno/Nevercode/Investigation/investigationapp/lib/0%20-%20Investigate/Material/DateAndTimePicker/flutter_177083/flutter_177083_report.dart:12:16

When the exception was thrown, this was the stack:
#0      _InputDateRangePickerDialog.build (package:flutter/src/material/date_picker.dart:3109:18)
date_picker.dart:3109
#1      StatelessElement.build (package:flutter/src/widgets/framework.dart:5892:49)
framework.dart:5892
#2      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5820:15)
framework.dart:5820

Flutter Doctor output

Doctor output
Flutter (Channel master, 3.38.0-1.0.pre-204, on macOS 15.6.1 24G90 darwin-arm64, locale en-FR)

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Oct 23, 2025
  2. self-assigned this
    on Oct 23, 2025
  3. added
    c: crashStack traces logged to the console
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Oct 23, 2025
  4. moved this from To do to PR submitted in Nevercodeon Oct 23, 2025
  5. moved this from PR submitted to Done (PR merged) in Nevercodeon Oct 31, 2025
  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 31, 2025
  7. github-actions commented on Nov 15, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consolef: date/time pickerDate or time picker widgetsfound in release: 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions