```dart void main() { runApp(MyApp()); } class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); @override State createState() => _MyAppState(); } class _MyAppState extends State { StreamSubscription>? _stream; // Initialize a list for storing posts List _posts = []; // Initialize a boolean indicating if the sync process has completed bool _isSynced = false; // Initialize the libraries ... void observeQuery() { _stream = Amplify.DataStore.observeQuery( Post.classType, where: Post.TITLE.beginsWith('post') & (Post.RATING > 10), sortBy: [Post.RATING.ascending()], ).listen((QuerySnapshot snapshot) { setState(() { _posts = snapshot.items; _isSynced = snapshot.isSynced; }); }); } // Build function and UI elements ... @override void dispose() { _stream?.cancel(); super.dispose(); } } ```