Skip to content

Commit 14e5bd5

Browse files
author
Vieltojarvi
committed
Merge branch 'main' into gen1-lex-deprecation
2 parents 8b53582 + 78986a6 commit 14e5bd5

File tree

6 files changed

+95
-11
lines changed

6 files changed

+95
-11
lines changed

src/components/Layout/Layout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ export const Layout = ({
283283
{(isGen1GettingStarted || isGen1HowAmplifyWorks) && (
284284
<Gen1Banner currentPlatform={currentPlatform} />
285285
)}
286-
{asPathWithNoHash.includes('/push-notifications/') ||
286+
{(asPathWithNoHash.includes('/push-notifications/') ||
287287
asPathWithNoHash.includes('/analytics/') ||
288-
(asPathWithNoHash.includes('/in-app-messaging/') && (
289-
<PinpointEOLBanner />
290-
))}
288+
asPathWithNoHash.includes('/in-app-messaging/')) && (
289+
<PinpointEOLBanner />
290+
)}
291291
{asPathWithNoHash.includes('/interactions/') && (
292292
<LexV1EOLBanner />
293293
)}

src/fragments/lib-v1/flutter-maintenance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Callout warning>
22

3-
Amplify Flutter v1 is now in **Maintenance Mode** until April 30th, 2025. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v1.
3+
Amplify Flutter v1 is **deprecated** as of April 30th, 2025. No new features or bug fixes will be added. Dependencies may become outdated and potentially introduce compatibility issues.
44

55
Please use the latest version (v2) of [Amplify Flutter](/gen1/[platform]/tools/libraries/) to get started.
66

src/pages/[platform]/build-a-backend/data/custom-subscription/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ sub.unsubscribe()
156156

157157
## (Optionally) Add server-side subscription filters
158158

159+
<Callout info>
160+
161+
**Note:** The custom subscription `.authorization()` modifier does not support the `owner` strategy. This differs from model subscriptions and may result in a subscription event being broadcast to a larger audience.
162+
163+
</Callout>
164+
159165
You can add subscription filters by adding arguments to the custom subscriptions.
160166

161167
{/* ### Basic subscription filters based on exact match

src/pages/[platform]/build-a-backend/data/data-modeling/secondary-index/index.mdx

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
2-
2+
// cspell:ignore ACCOUNTREPRESENTATIVEID
33
export const meta = {
44
title: 'Customize secondary indexes',
55
description:
@@ -48,7 +48,7 @@ export const schema = a.schema({
4848
});
4949
```
5050

51-
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android", "flutter"]}>
51+
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android"]}>
5252

5353
The example client query below allows you to query for "Customer" records based on their `accountRepresentativeId`:
5454

@@ -104,6 +104,27 @@ let queriedCustomers = try await Amplify.API.query(
104104
```
105105

106106
</InlineFilter>
107+
108+
<InlineFilter filters={["flutter"]}>
109+
110+
The example client query below allows you to query for "Customer" records based on their `accountRepresentativeId`:
111+
112+
```dart title="lib/main.dart"
113+
import 'package:amplify_api/amplify_api.dart';
114+
import 'package:amplify_flutter/amplify_flutter.dart';
115+
import 'models/ModelProvider.dart';
116+
117+
// highlight-start
118+
final request = ModelQueries.list(
119+
Customer.classType,
120+
where: Customer.ACCOUNTREPRESENTATIVEID.eq(YOUR_REP_ID),
121+
);
122+
// highlight-end
123+
124+
```
125+
126+
</InlineFilter>
127+
107128
<Accordion title="Review how this works under the hood with Amazon DynamoDB">
108129

109130
Amplify uses Amazon DynamoDB tables as the default data source for `a.model()`. For key-value databases, it is critical to model your access patterns with "secondary indexes". Use the `.secondaryIndexes()` modifier to configure a secondary index.
@@ -133,7 +154,7 @@ export const schema = a.schema({
133154
});
134155
```
135156

136-
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android", "flutter"]}>
157+
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android",]}>
137158

138159
On the client side, you should find a new `listBy...` query that's named after hash key and sort keys. For example, in this case: `listByAccountRepresentativeIdAndName`. You can supply the filter as part of this new list query:
139160

@@ -185,6 +206,26 @@ let queriedCustomers = try await Amplify.API.query(
185206
```
186207
</InlineFilter>
187208

209+
<InlineFilter filters={["flutter"]}>
210+
211+
The example client query below allows you to query for "Customer" records based on their `name` AND their `accountRepresentativeId`:
212+
213+
```dart title="lib/main.dart"
214+
import 'package:amplify_api/amplify_api.dart';
215+
import 'package:amplify_flutter/amplify_flutter.dart';
216+
import 'models/ModelProvider.dart';
217+
218+
// highlight-start
219+
final request = ModelQueries.list(
220+
Customer.classType,
221+
where: Customer.ACCOUNTREPRESENTATIVEID.eq(YOUR_REP_ID) & Customer.NAME.beginsWith("Rene"),
222+
);
223+
// highlight-end
224+
225+
```
226+
227+
</InlineFilter>
228+
188229
## Customize the query field for secondary indexes
189230

190231
You can also customize the auto-generated query name under `client.models.<MODEL_NAME>.listBy...` by setting the `queryField()` modifier.
@@ -206,7 +247,7 @@ const schema = a.schema({
206247
});
207248
```
208249

209-
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android", "flutter"]}>
250+
<InlineFilter filters={["javascript", "angular", "react-native", "react", "nextjs", "vue", "android"]}>
210251

211252
In your client app code, you'll see query updated under the Data client:
212253

@@ -258,6 +299,43 @@ let queriedCustomers = try await Amplify.API.query(
258299
```
259300
</InlineFilter>
260301

302+
<InlineFilter filters={["flutter"]}>
303+
304+
In your client app code, you can use the updated query name.
305+
306+
```dart title="lib/main.dart"
307+
import 'package:amplify_api/amplify_api.dart';
308+
import 'package:amplify_flutter/amplify_flutter.dart';
309+
import 'models/ModelProvider.dart';
310+
311+
var accountRepresentativeId = "John";
312+
var operationName = "listByRep";
313+
var document = """
314+
query ListByRep {
315+
$operationName(accountRepresentativeId: "$accountRepresentativeId") {
316+
items {
317+
accountRepresentativeId
318+
createdAt
319+
id
320+
name
321+
phoneNumber
322+
updatedAt
323+
}
324+
nextToken
325+
}
326+
}
327+
""";
328+
329+
final request = GraphQLRequest(
330+
document: document,
331+
variables: {
332+
'accountRepresentativeId': accountRepresentativeId,
333+
'operationName': operationName,
334+
},
335+
);
336+
```
337+
</InlineFilter>
338+
261339

262340
## Customize the name of secondary indexes
263341

src/pages/[platform]/build-a-backend/storage/copy-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const copyFile = async () => {
101101
}
102102
});
103103
} catch (error) {
104-
console.error('Error', err);
104+
console.error('Error', error);
105105
}
106106
};
107107
```

src/pages/[platform]/build-a-backend/storage/download-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ const { body, eTag } = await downloadData(
707707
{
708708
path: 'album/2024/1.jpg',
709709
options: {
710-
onProgress: (progress) {
710+
onProgress: (progress) => {
711711
console.log(`Download progress: ${(progress.transferredBytes/progress.totalBytes) * 100}%`);
712712
}
713713
}

0 commit comments

Comments
 (0)