-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamOwned by Design Languages team
Description
Steps to reproduce
- Open the drawer.
- Click on the search icon. The search view appears.
- Double click outside of the search view AND outside the drawer as well.
Expected results
The first click should close the search view, while the second should close the drawer. This should happen without any errors.
Actual results
The following exception is thrown:
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building RawGestureDetector(state: RawGestureDetectorState#118c4(gestures: [tap, long press, tap and pan], excludeFromSemantics: true, behavior: translucent)):
A SearchController was used after being disposed.
Once you have called dispose() on a SearchController, it can no longer be used.
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///home/user/project/lib/main.dart:12:18
When the exception was thrown, this was the stack:
#0 ChangeNotifier.debugAssertNotDisposed.<anonymous closure> (package:flutter/src/foundation/change_notifier.dart:183:9)
#1 ChangeNotifier.debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:190:6)
#2 ChangeNotifier.addListener (package:flutter/src/foundation/change_notifier.dart:275:27)
#3 _MergingListenable.addListener (package:flutter/src/foundation/change_notifier.dart:502:14)
#4 _AnimatedState.didUpdateWidget (package:flutter/src/widgets/transitions.dart:118:25)
#5 StatefulElement.update (package:flutter/src/widgets/framework.dart:5789:55)
#6 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#7 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#8 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#9 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#10 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#11 Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#12 StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#13 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#14 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#15 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#16 Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#17 StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#18 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#19 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#20 Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#21 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
...
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: FirstScreen(),
);
}
}
class FirstScreen extends StatelessWidget {
const FirstScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('The title')),
drawer: Drawer(
child: SearchAnchor(
builder: (context, controller) {
return Align(
alignment: Alignment.topCenter,
child: IconButton(
onPressed: () => controller.openView(),
icon: const Icon(Icons.search),
),
);
},
suggestionsBuilder: (context, controller) {
return [
const ListTile(title: Text('Item 1')),
const ListTile(title: Text('Item 2')),
const ListTile(title: Text('Item 3')),
];
},
),
),
body: const Center(child: Text('Hi')),
);
}
}
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.24.3, on Ubuntu 22.04.4 LTS 6.8.0-40-generic, locale es_AR.UTF-8)
• Flutter version 3.24.3 on channel stable at /home/fnicola/Programas/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (hace 2 días), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /home/fnicola/Android/Sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /home/fnicola/Programas/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 14.0.0-1ubuntu1.1
• cmake version 3.22.1
• ninja version 1.10.1
• pkg-config version 0.29.2
[✓] Android Studio (version 2024.1)
• Android Studio at /home/fnicola/Programas/android-studio
• Flutter plugin version 81.0.2
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.93.1)
• VS Code at /usr/share/code
• Flutter extension version 3.86.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.4 LTS 6.8.0-40-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.140
[✓] Network resources
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamOwned by Design Languages team