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

Facing issues while localizing the CupertinoDatePicker in a MaterialApp or CupertinoApp. Error: A FixedExtentScrollController was used after being disposed. #131591

Closed
2 tasks done
Abdullah3780 opened this issue Jul 31, 2023 · 5 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@Abdullah3780
Copy link

Is there an existing issue for this?

Steps to reproduce

  1. Use MaterialApp or CupertinoAPP
  2. Use a CupertinoDatePicker
  3. Localize the App Using Flutter Localizations
  4. Languages where error is being generated are Vietnamese, Indonesian, Russian, Korean and some other.

Expected results

The expected result is that the CupertinoDatePicker should be properly localized within your MaterialApp or CupertinoApp, and users should be able to interact with the date picker without any errors.

Actual results

Scroll Controller is being disposed When I try to change the language. Means, when the state is being updated scroll controller is disposed but new state try to use the previous controller inside the CupertinoDatePicker.

Code sample

Code sample
main.dart:
import 'package:age_calculator/providers/addmemberprovidert.dart';
import 'package:age_calculator/providers/databaseprovider.dart';
import 'package:age_calculator/providers/homeprovider.dart';
import 'package:age_calculator/providers/resultprovider.dart';
import 'package:age_calculator/providers/splashprovider.dart';
import 'package:age_calculator/utils/swatch.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hive/hive.dart';
import 'package:provider/provider.dart';
import 'database/member_model.dart';
import 'views/splash/splash.dart';
import 'package:path_provider/path_provider.dart' as pathprovider;

import 'package:flutter_gen/gen_l10n/app_localizations.dart';

ValueNotifier<Locale> locale = ValueNotifier(const Locale('en'));
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  var directory = await pathprovider.getApplicationDocumentsDirectory();
  Hive.init(directory.path);
  Hive.registerAdapter(MemberAdapter());
  await Hive.openBox<Member>('member');
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown,
  ]);
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return ValueListenableBuilder(
      valueListenable: locale,
      builder: (context, value, child) => MultiProvider(
          providers: [
            ChangeNotifierProvider<SplashProvider>(
                create: (context) => SplashProvider()),
            ChangeNotifierProvider<HomeProvider>(
                create: (context) => HomeProvider()),
            ChangeNotifierProvider<ResultProvider>(
                create: (context) => ResultProvider()),
            ChangeNotifierProvider<DataBaseProvider>(
                create: (context) => DataBaseProvider()),
            ChangeNotifierProvider<AddMemberProvider>(
                create: (context) => AddMemberProvider()),
          ],
          child: MaterialApp(
            locale: locale.value,
            localizationsDelegates: AppLocalizations.localizationsDelegates,
            supportedLocales: AppLocalizations.supportedLocales,
            home: const SplashScreen(),
            theme: ThemeData(
                visualDensity: VisualDensity.adaptivePlatformDensity,
                primaryColor: mycolor.shade300,
                primarySwatch: mycolor,
                textTheme: GoogleFonts.latoTextTheme(),
                appBarTheme: const AppBarTheme(
                    titleTextStyle: TextStyle(color: Colors.black))),
          )),
    );
  }
}



---FirstPage----




import 'package:age_calculator/views/Result/result.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import '../../../../main.dart';
import '../../../../providers/homeprovider.dart';
import '../../../../utils/colors.dart';
import '../../../../utils/swatch.dart';
import 'homedrawer.dart';

import 'package:flutter_gen/gen_l10n/app_localizations.dart';

class FirstPage extends StatefulWidget {
  const FirstPage({super.key});

  @override
  State<FirstPage> createState() => _FirstPageState();
}

class _FirstPageState extends State<FirstPage> {
  DateTime birthdate = DateTime.now();

  int min = 0;

  int hour = 0;

  @override
  Widget build(BuildContext context) {
    double width = MediaQuery.of(context).size.width;
    double height = MediaQuery.of(context).size.height;
    return
      Scaffold(
        appBar: AppBar(
          title: Text(
            AppLocalizations.of(context)!.ageCalculator,
            style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
          ),
          centerTitle: true,
          backgroundColor: Colors.transparent,
          elevation: 0,
          actions: [
            ValueListenableBuilder(
              valueListenable: locale,
              builder: (context, value, child) => PopupMenuButton<String>(
                icon: SvgPicture.asset(
                  'assets/${locale.value}.svg',
                  height: 30,
                ),
                shape: const RoundedRectangleBorder(
                    borderRadius: BorderRadius.all(Radius.circular(15.0))),
                itemBuilder: (BuildContext context) => [
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'en');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/en.svg',
                          height: 30,
                        ),
                        const Text('English'),
                        locale.value.languageCode == 'en'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'ko');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/ko.svg',
                          height: 30,
                        ),
                        const Text('Korean'),
                        locale.value.languageCode == 'ko'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'vi');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/vi.svg',
                          height: 30,
                        ),
                        const Text('Vietnamese'),
                        locale.value.languageCode == 'vi'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'id');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/id.svg',
                          height: 30,
                        ),
                        const Text('Indonesian'),
                        locale.value.languageCode == 'id'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'ja');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/ja.svg',
                          height: 30,
                        ),
                        const Text('Japanese'),
                        locale.value.languageCode == 'ja'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'ru');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/ru.svg',
                          height: 30,
                        ),
                        const Text('Russian'),
                        locale.value.languageCode == 'ru'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'fr');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/fr.svg',
                          height: 30,
                        ),
                        const Text('French'),
                        locale.value.languageCode == 'fr'
                            ? const SizedBox(
                                width: 20,
                                child: Icon(
                                  Icons.check,
                                ),
                              )
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'th');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/th.svg',
                          height: 30,
                        ),
                        const Text('Thai'),
                        locale.value.languageCode == 'th'
                            ? const SizedBox(
                                width: 20, child: Icon(Icons.check))
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                  PopupMenuItem<String>(
                    onTap: () {
                      locale.value =
                          const Locale.fromSubtags(languageCode: 'es');
                      setState(() {});
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        SvgPicture.asset(
                          'assets/es.svg',
                          height: 30,
                        ),
                        const Text('Español'),
                        locale.value.languageCode == 'es'
                            ? const SizedBox(
                                width: 20, child: Icon(Icons.check))
                            : const SizedBox(
                                width: 20,
                              )
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
        extendBodyBehindAppBar: true,
        backgroundColor: const Color(0xffFAFAFC),
        drawer: HomePageDrawer(),
        body: Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: AssetImage('assets/homebg.png'),
              fit: BoxFit.cover,
            ),
          ),
          child: Column(children: [
            SizedBox(
              height: height * 0.02,
            ),
            SizedBox(
              width: double.infinity,
              height: height * 0.25,
              child: Image.asset(
                'assets/homelogo.png',
                alignment: Alignment.center,
              ),
            ),
            Container(
              padding: EdgeInsets.only(left: width * 0.05, right: width * 0.05),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SvgPicture.asset('assets/tear-off-calendar.svg'),
                      const SizedBox(
                        width: 10,
                      ),
                      Text(
                        AppLocalizations.of(context)!.dateOfBirth,
                        style: const TextStyle(
                            fontWeight: FontWeight.bold, fontSize: 16),
                      )
                    ],
                  ),
                  SizedBox(
                    height: height * 0.02,
                  ),
                  Stack(
                    children: [
                      Container(
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(10),
                            color: CustomColor.themeColor,
                            boxShadow: [
                              BoxShadow(
                                color: Colors.grey.withOpacity(0.5),
                                spreadRadius: 5,
                                blurRadius: 7,
                                offset: const Offset(
                                    0, 3), // changes position of shadow
                              ),
                            ]),
                        height: height * 0.2,
                      ),
                      Container(
                        width: double.infinity,
                        margin: EdgeInsets.only(
                            top: height * 0.075, left: 10, right: 10),
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5),
                          color: Colors.white70,
                        ),
                        height: height * 0.0475,
                      ),
                      SizedBox(
                        height: height * 0.2,
                        child: ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child:
                              //  DatePickerWidget(
                              //   pickerTheme: DateTimePickerTheme(
                              //       pickerHeight: height * 0.125,
                              //       confirm: null,
                              //       cancel: null),

                              //   maxDateTime: DateTime.now(),
                              //   onChange: (DateTime newdate, lis) {
                              //     birthdate = newdate;
                              //   },

                              //   minDateTime: DateTime(1950),
                              //   initialDateTime: DateTime(DateTime.now().year,
                              //       DateTime.now().month, DateTime.now().day),
                              //   locale: locale.value.languageCode == 'en'
                              //       ? DateTimePickerLocale.en_us
                              //       : locale.value.languageCode == 'ko'
                              //           ? DateTimePickerLocale.ko
                              //           : locale.value.languageCode == 'vi'
                              //               ? DateTimePickerLocale.vi
                              //               : locale.value.languageCode == 'id'
                              //                   ? DateTimePickerLocale.id
                              //                   : locale.value.languageCode == 'ru'
                              //                       ? DateTimePickerLocale.ru
                              //                       : locale.value.languageCode ==
                              //                               'fr'
                              //                           ? DateTimePickerLocale.fr
                              //                           : locale.value
                              //                                       .languageCode ==
                              //                                   'es'
                              //                               ? DateTimePickerLocale
                              //                                   .es
                              //                               : DateTimePickerLocale
                              //                                   .en_us,
                              //   // mode: CupertinoDatePickerMode.date,
                              // )
                              Localizations.override(
                            context: context,
                            locale: locale.value,
                            child: CupertinoDatePicker(
                              maximumDate: DateTime.now(),
                              onDateTimeChanged: (DateTime newdate) {
                                birthdate = newdate;
                              },
                              minimumDate: DateTime(1950),
                              initialDateTime: DateTime(DateTime.now().year,
                                  DateTime.now().month, DateTime.now().day),
                              mode: CupertinoDatePickerMode.date,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: height * 0.03,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      SvgPicture.asset('assets/three-oclock.svg'),
                      const SizedBox(
                        width: 10,
                      ),
                      Text(
                        AppLocalizations.of(context)!.birthTimeOptional,
                        style: const TextStyle(
                            fontWeight: FontWeight.bold, fontSize: 16),
                      )
                    ],
                  ),
                  SizedBox(
                    height: height * 0.02,
                  ),
                  Stack(
                    children: [
                      Container(
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(10),
                            color: CustomColor.themeColor,
                            boxShadow: [
                              BoxShadow(
                                color: Colors.grey.withOpacity(0.5),
                                spreadRadius: 5,
                                blurRadius: 7,
                                offset: const Offset(
                                    0, 3), // changes position of shadow
                              ),
                            ]),
                        height: height * 0.2,
                      ),
                      Container(
                        width: double.infinity,
                        margin: EdgeInsets.only(
                            top: height * 0.075, left: 10, right: 10),
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5),
                          color: Colors.white70,
                        ),
                        height: height * 0.0475,
                      ),
                      SizedBox(
                        height: height * 0.2,
                        child: ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child: CupertinoDatePicker(
                            maximumDate: DateTime(DateTime.now().year + 1),
                            onDateTimeChanged: (DateTime newdate) {
                              min = newdate.minute;
                              hour = newdate.hour;
                            },
                            initialDateTime: DateTime.now(),
                            mode: CupertinoDatePickerMode.time,
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: height * 0.02,
                  ),
                  SizedBox(
                    height: height * 0.02,
                  ),
                  InkWell(
                    onTap: () {
                      var value =
                          Provider.of<HomeProvider>(context, listen: false);
                      value.setDate(birthdate);
                      value.setHoursAndMinutes(hour, min);
                      Navigator.push(
                          context,
                          MaterialPageRoute(
                            builder: (context) => Result(
                                birthDuration: value.calculateAge(),
                                nextBirthDay: value.calculateNextBirthdayAge()),
                          )).then((val) => {
                            // birthdate = DateTime.now(),
                            // min = DateTime.now().minute,
                            // hour = DateTime.now().hour,
                            // value.setDate(DateTime(DateTime.now().year,
                            //     DateTime.now().month, DateTime.now().day - 1)),
                            // value.setHoursAndMinutes(
                            //     DateTime.now().hour, DateTime.now().minute),
                          });
                    },
                    child: Container(
                      alignment: Alignment.center,
                      height: height * 0.07,
                      width: double.infinity,
                      decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(10),
                          color: Colors.black),
                      child: Text(
                        AppLocalizations.of(context)!.calculate,
                        style:
                            const TextStyle(fontSize: 20, color: Colors.white),
                      ),
                    ),
                  )
                ],
              ),
            ),
          ]),
        ),

    );
  }
}


</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

![image](https://github.com/flutter/flutter/assets/82969607/1aa6661d-2247-4d76-af22-0aea55ebae40)

</details>


### Logs

<details><summary>Logs</summary>

```console
Restarted application in 5,549ms.

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Positioned(left: 0.0, top: 0.0, right: 0.0, bottom: 0.0):
A FixedExtentScrollController was used after being disposed.

Once you have called dispose() on a FixedExtentScrollController, it can no longer be used.
The relevant error-causing widget was
CupertinoDatePicker
When the exception was thrown, this was the stack
#0      ChangeNotifier.debugAssertNotDisposed.<anonymous closure>
#1      ChangeNotifier.debugAssertNotDisposed
#2      ChangeNotifier.addListener
#3      _RenderCupertinoPickerSemantics._updateController
#4      _RenderCupertinoPickerSemantics.controller=
#5      _CupertinoPickerSemantics.updateRenderObject
#6      RenderObjectElement._performRebuild
#7      RenderObjectElement.update
#8      SingleChildRenderObjectElement.update
#9      Element.updateChild
#10     ComponentElement.performRebuild
#11     Element.rebuild
#12     ProxyElement.update
#13     Element.updateChild
#14     RenderObjectElement.updateChildren
#15     MultiChildRenderObjectElement.update
#16     Element.updateChild
#17     ComponentElement.performRebuild
#18     Element.rebuild
#19     ProxyElement.update
#20     Element.updateChild
#21     SingleChildRenderObjectElement.update
#22     Element.updateChild
#23     ComponentElement.performRebuild
#24     StatefulElement.performRebuild
#25     Element.rebuild
#26     StatefulElement.update
#27     Element.updateChild
#28     ComponentElement.performRebuild
#29     Element.rebuild
#30     ProxyElement.update
#31     Element.updateChild
#32     ComponentElement.performRebuild
#33     Element.rebuild
#34     ProxyElement.update
#35     Element.updateChild
#36     RenderObjectElement.updateChildren
#37     MultiChildRenderObjectElement.update
#38     Element.updateChild
#39     ComponentElement.performRebuild
#40     Element.rebuild
#41     ProxyElement.update
#42     Element.updateChild
#43     ComponentElement.performRebuild
#44     Element.rebuild
#45     StatelessElement.update
#46     Element.updateChild
#47     ComponentElement.performRebuild
#48     Element.rebuild
#49     ProxyElement.update
#50     Element.updateChild
#51     ComponentElement.performRebuild
#52     StatefulElement.performRebuild
#53     Element.rebuild
#54     StatefulElement.update
#55     Element.updateChild
#56     ComponentElement.performRebuild
#57     Element.rebuild
#58     ProxyElement.update
#59     Element.updateChild
#60     ComponentElement.performRebuild
#61     Element.rebuild
#62     ProxyElement.update
#63     Element.updateChild
#64     SingleChildRenderObjectElement.update
#65     Element.updateChild
#66     ComponentElement.performRebuild
#67     StatefulElement.performRebuild
#68     Element.rebuild
#69     StatefulElement.update
#70     Element.updateChild
#71     SingleChildRenderObjectElement.update
#72     Element.updateChild
#73     SingleChildRenderObjectElement.update
#74     Element.updateChild
#75     RenderObjectElement.updateChildren
#76     MultiChildRenderObjectElement.update
#77     Element.updateChild
#78     RenderObjectElement.updateChildren
#79     MultiChildRenderObjectElement.update
#80     Element.updateChild
#81     SingleChildRenderObjectElement.update
#82     Element.updateChild
#83     ComponentElement.performRebuild
#84     Element.rebuild
#85     StatelessElement.update
#86     Element.updateChild
#87     RenderObjectElement.updateChildren
#88     MultiChildRenderObjectElement.update
#89     Element.updateChild
#90     SingleChildRenderObjectElement.update
#91     Element.updateChild
#92     SingleChildRenderObjectElement.update
#93     Element.updateChild
#94     ComponentElement.performRebuild
#95     Element.rebuild
#96     StatelessElement.update
#97     Element.updateChild
#98     ComponentElement.performRebuild
#99     Element.rebuild
#100    StatelessElement.update
#101    Element.updateChild
#102    ComponentElement.performRebuild
#103    Element.rebuild
#104    ProxyElement.update
#105    Element.updateChild
#106    _LayoutBuilderElement._layout.layoutCallback
#107    BuildOwner.buildScope
#108    _LayoutBuilderElement._layout
#109    RenderObject.invokeLayoutCallback.<anonymous closure>
#110    PipelineOwner._enableMutationsToDirtySubtrees
#111    RenderObject.invokeLayoutCallback
#112    RenderConstrainedLayoutBuilder.rebuildIfNecessary
#113    _RenderLayoutBuilder.performLayout
#114    RenderObject.layout
#115    RenderBox.layout
#116    MultiChildLayoutDelegate.layoutChild
#117    _ScaffoldLayout.performLayout
#118    MultiChildLayoutDelegate._callPerformLayout
#119    RenderCustomMultiChildLayoutBox.performLayout
#120    RenderObject._layoutWithoutResize
#121    PipelineOwner.flushLayout
#122    RendererBinding.drawFrame
#123    WidgetsBinding.drawFrame
#124    RendererBinding._handlePersistentFrameCallback
#125    SchedulerBinding._invokeFrameCallback
#126    SchedulerBinding.handleDrawFrame
#127    SchedulerBinding._handleDrawFrame
#128    _invoke (dart:ui/hooks.dart:142:13)
#129    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:359:5)
#130    _drawFrame (dart:ui/hooks.dart:112:31)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
A FixedExtentScrollController was used after being disposed.
The relevant error-causing widget was
CupertinoDatePicker
════════════════════════════════════════════════════════════════════════════════

Flutter Doctor output

Doctor output
 flutter doctor -v
[√] Flutter (Channel stable, 3.10.1, on Microsoft Windows [Version 10.0.19045.3208], locale en-US)
    • Flutter version 3.10.1 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d3d8effc68 (3 months ago), 2023-05-16 17:59:05 -0700
    • Engine revision b4fb11214d
    • Dart version 3.0.1
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\Abdullah\AppData\Local\Android\sdk
    • Platform android-33-ext4, build-tools 33.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33627.172
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.80.2)
    • VS Code at C:\Users\Abdullah\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.68.0

[√] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.3208]       
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 115.0.5790.110
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 115.0.1901.188

[√] Network resources
    • All expected network resources are available.

• No issues found!
@dam-ease dam-ease added the in triage Presently being triaged by the triage team label Jul 31, 2023
@dam-ease
Copy link

Hi @Abdullah3780. Thanks for filing this issue. This might be similar or related to #130930. If not, kindly provide more information on this issue. More specifically:

Thank you!

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 31, 2023
@Abdullah3780
Copy link
Author

Abdullah3780 commented Jul 31, 2023

Thanks for your comment. Here is the console log and error. You can also check Code Sample. Screenshot link and console log is there as well.

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Positioned(left: 0.0, top: 0.0, right: 0.0, bottom: 0.0):
A FixedExtentScrollController was used after being disposed.

Once you have called dispose() on a FixedExtentScrollController, it can no longer be used.
The relevant error-causing widget was
CupertinoDatePicker
When the exception was thrown, this was the stack
#0      ChangeNotifier.debugAssertNotDisposed.<anonymous closure>
#1      ChangeNotifier.debugAssertNotDisposed
#2      ChangeNotifier.addListener
#3      _RenderCupertinoPickerSemantics._updateController
#4      _RenderCupertinoPickerSemantics.controller=
#5      _CupertinoPickerSemantics.updateRenderObject
#6      RenderObjectElement._performRebuild
#7      RenderObjectElement.update
#8      SingleChildRenderObjectElement.update
#9      Element.updateChild
#10     ComponentElement.performRebuild
#11     Element.rebuild
#12     ProxyElement.update
#13     Element.updateChild
#14     RenderObjectElement.updateChildren
#15     MultiChildRenderObjectElement.update
#16     Element.updateChild
#17     ComponentElement.performRebuild
#18     Element.rebuild
#19     ProxyElement.update
#20     Element.updateChild
#21     SingleChildRenderObjectElement.update
#22     Element.updateChild
#23     ComponentElement.performRebuild
#24     StatefulElement.performRebuild
#25     Element.rebuild
#26     StatefulElement.update
#27     Element.updateChild
#28     ComponentElement.performRebuild
#29     Element.rebuild
#30     ProxyElement.update
#31     Element.updateChild
#32     ComponentElement.performRebuild
#33     Element.rebuild
#34     ProxyElement.update
#35     Element.updateChild
#36     RenderObjectElement.updateChildren
#37     MultiChildRenderObjectElement.update
#38     Element.updateChild
#39     ComponentElement.performRebuild
#40     Element.rebuild
#41     ProxyElement.update
#42     Element.updateChild
#43     ComponentElement.performRebuild
#44     Element.rebuild
#45     StatelessElement.update
#46     Element.updateChild
#47     ComponentElement.performRebuild
#48     Element.rebuild
#49     ProxyElement.update
#50     Element.updateChild
#51     ComponentElement.performRebuild
#52     StatefulElement.performRebuild
#53     Element.rebuild
#54     StatefulElement.update
#55     Element.updateChild
#56     ComponentElement.performRebuild
#57     Element.rebuild
#58     ProxyElement.update
#59     Element.updateChild
#60     ComponentElement.performRebuild
#61     Element.rebuild
#62     ProxyElement.update
#63     Element.updateChild
#64     SingleChildRenderObjectElement.update
#65     Element.updateChild
#66     ComponentElement.performRebuild
#67     StatefulElement.performRebuild
#68     Element.rebuild
#69     StatefulElement.update
#70     Element.updateChild
#71     SingleChildRenderObjectElement.update
#72     Element.updateChild
#73     SingleChildRenderObjectElement.update
#74     Element.updateChild
#75     RenderObjectElement.updateChildren
#76     MultiChildRenderObjectElement.update
#77     Element.updateChild
#78     RenderObjectElement.updateChildren
#79     MultiChildRenderObjectElement.update
#80     Element.updateChild
#81     SingleChildRenderObjectElement.update
#82     Element.updateChild
#83     ComponentElement.performRebuild
#84     Element.rebuild
#85     StatelessElement.update
#86     Element.updateChild
#87     RenderObjectElement.updateChildren
#88     MultiChildRenderObjectElement.update
#89     Element.updateChild
#90     SingleChildRenderObjectElement.update
#91     Element.updateChild
#92     SingleChildRenderObjectElement.update
#93     Element.updateChild
#94     ComponentElement.performRebuild
#95     Element.rebuild
#96     StatelessElement.update
#97     Element.updateChild
#98     ComponentElement.performRebuild
#99     Element.rebuild
#100    StatelessElement.update
#101    Element.updateChild
#102    ComponentElement.performRebuild
#103    Element.rebuild
#104    ProxyElement.update
#105    Element.updateChild
#106    _LayoutBuilderElement._layout.layoutCallback
#107    BuildOwner.buildScope
#108    _LayoutBuilderElement._layout
#109    RenderObject.invokeLayoutCallback.<anonymous closure>
#110    PipelineOwner._enableMutationsToDirtySubtrees
#111    RenderObject.invokeLayoutCallback
#112    RenderConstrainedLayoutBuilder.rebuildIfNecessary
#113    _RenderLayoutBuilder.performLayout
#114    RenderObject.layout
#115    RenderBox.layout
#116    MultiChildLayoutDelegate.layoutChild
#117    _ScaffoldLayout.performLayout
#118    MultiChildLayoutDelegate._callPerformLayout
#119    RenderCustomMultiChildLayoutBox.performLayout
#120    RenderObject._layoutWithoutResize
#121    PipelineOwner.flushLayout
#122    RendererBinding.drawFrame
#123    WidgetsBinding.drawFrame
#124    RendererBinding._handlePersistentFrameCallback
#125    SchedulerBinding._invokeFrameCallback
#126    SchedulerBinding.handleDrawFrame
#127    SchedulerBinding._handleDrawFrame
#128    _invoke (dart:ui/hooks.dart:142:13)
#129    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:359:5)
#130    _drawFrame (dart:ui/hooks.dart:112:31)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
A FixedExtentScrollController was used after being disposed.
The relevant error-causing widget was
CupertinoDatePicker
════════════════════════════════════════════════════════════════════════════════

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 31, 2023
@dam-ease
Copy link

dam-ease commented Aug 1, 2023

Hi @Abdullah3780. Thanks for your response. From the logs, can you try if this works in your case #93229 (comment)? If not, for this issue to be workable you'd have to provide a completed and minimal reproducible code sample that doesn't include 3rd party plugins or complex production code.
Thank you!

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 1, 2023
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

2 participants