Skip to content

Commit e332d2f

Browse files
authored
fix for localization issue: "No MaterialLocalizations found" error in SelectionArea widget (#78)
* v0.7.0: prepping for release * README updates (fix for #66) * remove unnecessary Localizations wrapper in AdaptiveCopyText
1 parent 0f1c3df commit e332d2f

File tree

4 files changed

+48
-14
lines changed

4 files changed

+48
-14
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.7.0
2+
3+
* fixed [#55](https://github.com/flutter/ai/issues/55): The input field does
4+
not unfocus on iPhone simulator
5+
6+
* fixed [#52](https://github.com/flutter/ai/issues/52): Make Chat Input
7+
Configurable to Disable Attachments and Voice Notes
8+
9+
* fixed [#63](https://github.com/flutter/ai/issues/63): update all samples to
10+
use the 2.0 flash model
11+
12+
* fixed [#49](https://github.com/flutter/ai/issues/49): pub publish has warnings
13+
14+
* fixed [#61](https://github.com/flutter/ai/issues/61): [test] add a smoke test
15+
16+
117
## 0.6.8
218

319
* Require Dart 3.5 or later.

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,43 @@ the AI toolkit in to your own applications.
214214
215215
4. **Set up device permissions**
216216
217-
To enable your users to take advantage of features like
218-
voice input and media attachments,
219-
ensure that your app has the necessary permissions:
217+
To enable your users to take advantage of features like voice input and
218+
media attachments, ensure that your app has the necessary permissions:
219+
220+
- **Network access:**
221+
To enable network access on macOS, add the following to your
222+
`*.entitlements` files:
223+
224+
```xml
225+
<plist version="1.0">
226+
<dict>
227+
...
228+
<key>com.apple.security.network.client</key>
229+
<true/>
230+
</dict>
231+
</plist>
232+
```
233+
234+
To enable network access on Android, ensure that your `AndroidManifest.xml`
235+
file contains the following:
236+
237+
238+
```xml
239+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
240+
...
241+
<uses-permission android:name="android.permission.INTERNET"/>
242+
</manifest>
243+
```
220244
221245
- **Microphone access:**
222246
To enable voice input for users, update configs according to the
223247
[permission and setup instructions][record-setup] for `package:record`.
248+
224249
- **File selection:**
225250
To enable users to select and attach files,
226251
follow the [usage instructions][file-setup] for `package:file_selector`.
227252
- **Image selection:**
253+
228254
To enable users to take or select a picture from their device, refer to
229255
the [installation instructions][image-setup] for `package:image_picker`.
230256

lib/src/views/chat_message_view/adaptive_copy_text.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:async';
22

3-
import 'package:flutter/material.dart'
4-
show DefaultMaterialLocalizations, SelectionArea;
3+
import 'package:flutter/material.dart' show SelectionArea;
54
import 'package:flutter/widgets.dart';
65
import 'package:flutter_context_menu/flutter_context_menu.dart';
76

@@ -64,13 +63,6 @@ class AdaptiveCopyText extends StatelessWidget {
6463
// on desktop and web, show the selection area for mouse-driven selection.
6564
return isMobile
6665
? ContextMenuRegion(contextMenu: contextMenu, child: child)
67-
: Localizations(
68-
locale: Localizations.localeOf(context),
69-
delegates: const [
70-
DefaultWidgetsLocalizations.delegate,
71-
DefaultMaterialLocalizations.delegate,
72-
],
73-
child: SelectionArea(child: child),
74-
);
66+
: SelectionArea(child: child);
7567
}
7668
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flutter_ai_toolkit
22
description: >-
33
A set of AI chat-related widgets for Flutter apps targeting
44
mobile, desktop, and web.
5-
version: 0.6.8
5+
version: 0.7.0
66
repository: https://github.com/flutter/ai
77

88
topics:

0 commit comments

Comments
 (0)