```dart
import 'package:amplify_flutter/amplify_flutter.dart';

import 'models/ModelProvider.dart';

Future<void> updatePost() async {
  final oldPost = (await Amplify.DataStore.query(
    Post.classType,
    where: Post.ID.eq('123'),
  ))
      .first;

  final newPost = oldPost.copyWith(title: 'Updated Title');

  try {
    await Amplify.DataStore.save(newPost);
  } on DataStoreException catch (e) {
    safePrint('Something went wrong updating model: ${e.message}');
  }
}
```
