PopScope and TextScaler aren't found
General
What bug do you experience? 🐞
Provide a clear and concise description of what the bug is.
When I run flutter run for my application, it fails with the following error:
/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/image_gallery.dart:53:41: Error: The method 'PopScope' isn't defined for the class 'ImageGallery'.
- 'ImageGallery' is from 'package:flutter_chat_ui/src/widgets/image_gallery.dart' ('/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/image_gallery.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PopScope'.
Widget build(BuildContext context) => PopScope(
^^^^^^^^
/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/typing_indicator.dart:383:37: Error: Couldn't find constructor 'TextScaler.linear'.
textScaler: const TextScaler.linear(0.7),
^^^^^^
/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/typing_indicator.dart:383:19: Error: No named parameter with the name 'textScaler'.
textScaler: const TextScaler.linear(0.7),
^^^^^^^^^^
/D:/Projects/flutter/packages/flutter/lib/src/widgets/text.dart:428:9: Context: Found this candidate, but the arguments don't match.
const Text(
^^^^
/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/typing_indicator.dart:424:33: Error: Couldn't find constructor 'TextScaler.linear'.
textScaler: const TextScaler.linear(0.7),
^^^^^^
/C:/Users/indoo/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_chat_ui-1.6.12/lib/src/widgets/typing_indicator.dart:424:15: Error: No named parameter with the name 'textScaler'.
textScaler: const TextScaler.linear(0.7),
^^^^^^^^^^
/D:/Projects/flutter/packages/flutter/lib/src/widgets/text.dart:428:9: Context: Found this candidate, but the arguments don't match.
const Text(
^^^^
Waiting for connection from debug service on Chrome... 16.0s
Failed to compile application.
I've tried to run the example and created tests using the Chat widget. I've imported various dependencies including:
flutter_chat_types: ^3.6.2
flutter_chat_ui: ^1.6.12
But the error persists
How can it be reproduced? 🤔
A few steps to define where does the bug occur.
Step 1. Copy the example project folder
Step 2. Open in VS Code
Step 3. Install all dependencies as required
Step 4. Run flutter run
Step 5. Error
What behavior is expected? 💡
A clear and concise description of what you expected to happen.
flutter run succeeds without any errors and chatUI works as expected
Extras
Screenshots or videos 📸
If applicable, add screenshots or videos to help explain your problem.
Code snippets 📝
If applicable, add code samples to help explain your problem.
// Your snippet here...
Environment info
Please specify the flutter, flutter-chat-ui versions.
environment:
sdk: '>=3.1.5 <4.0.0'
flutter: '>=3.0.0'
dependencies:
file_picker: ^8.0.0+1
flutter:
sdk: flutter
flutter_chat_types: ^3.6.2
flutter_chat_ui: ^1.6.12
flutter_localizations:
sdk: flutter
http: ^1.1.0
image_picker: ^1.0.7
intl: ^0.18.1
mime: ^1.0.4
open_filex: ^4.4.0
path_provider: ^2.1.2
photo_view: ^0.14.0
uuid: ^4.2.2
flutter doctor -v output 👇
flutter doctor -v
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.22631.3296], locale en-US)
• Flutter version 3.13.9 on channel stable at D:\Projects\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (6 months ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\indoo\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.9.34723.18
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2022.3)
• 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-10027231)
[√] VS Code (version 1.88.0)
• VS Code at C:\Users\indoo\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.86.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3296]
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.106
• Edge (web) • edge • web-javascript • Microsoft Edge 123.0.2420.81
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Platform
Device (e.g. Android emulator, iOS simulator, Samsung Galaxy S21): Web Chrome, Windows11 OS version (e.g. iOS 14.5, Android 11): N/a
Additional context
Add any other context about the problem here.
Hey! Unfortunately it is hard to support old and new Flutter versions, sometimes they change APIs and introduce new things. What you see is how it should be coded since stable 3.16. Is it possible for you to update your Flutter version? you seem so specific to be on 3.13.9 is there something after that that blocks you?