Xander van Zyl
Xander van Zyl

Reputation: 165

Flutter white screen on app after adding widget

I have run into an issue that has my head itching a bit. When adding a new element to my page (using ReactiveDateTimePicker) and running the code I am met with a page that displays nothing but white (The appbar and hamburger menu at the top still show though).

Without the added code the page looks like the screenshot below.

enter image description here

However once I add in the code, the screen looks like the screenshot below

enter image description here

The code for the page is quite lengthy, so I am adding it on codepen for easier visibility. Here is the link to the full code. The section I added which caused the error is below

ReactiveForm(
                      formGroup: _form,
                      child: ListView(children: <Widget>[
                        Padding(
                          padding: EdgeInsets.only(top: 0, left: 0, right: 0),
                          child: ReactiveDateTimePicker(
                            formControlName: 'child_details.dateOfBirth',
                            type: ReactiveDatePickerFieldType.date,
                            firstDate: DateTime(DateTime.now().year - 18, 1, 1),
                            lastDate: DateTime.now()
                                .subtract(Duration(days: 2 * 365)),
                            datePickerEntryMode: DatePickerEntryMode.calendar,
                            showClearIcon: false,
                            validationMessages: {
                              '_requiredYounger120': (error) =>
                                  'Really? More than 120 years old?'
                            },
                            decoration: InputDecoration(
                              labelText: 'Date of birth',
                              border: UnderlineInputBorder(),
                              helperText: '',
                            ),
                            //locale: Localizations.localeOf(context),
                            builder: (BuildContext context, Widget child) {
                              return Theme(
                                data: ThemeData.light().copyWith(
                                  primaryColor: Theme.of(context).primaryColor,
                                  accentColor: Theme.of(context).accentColor,
                                  colorScheme: ColorScheme.light(
                                      primary: Theme.of(context).primaryColor),
                                  buttonTheme: ButtonThemeData(
                                      textTheme: ButtonTextTheme.primary),
                                ),
                                child: child,
                              );
                            },
                          ),
                        ),
                      ])),

I am getting the error after I add the code from line 1297 - 1335. This happens on both Android and iOS

Upvotes: 0

Views: 56

Answers (0)

Related Questions