{"id":10271,"date":"2024-02-12T10:04:29","date_gmt":"2024-02-12T18:04:29","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/dart-flutter-replication-app-services\/"},"modified":"2024-02-12T10:04:29","modified_gmt":"2024-02-12T18:04:29","slug":"dart-flutter-replication-app-services","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/","title":{"rendered":"Couchbase Capella App Services, Dart, and Flutter"},"content":{"rendered":"\n<h3 id=\"h-introduction\" class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this part of our learning path, you will walk through the &#8220;Audit Inventory&#8221; demo application of using Couchbase Lite with the Replicator, which means the database will sync information using two way replication between the mobile app and Couchbase Capella App Services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In previous steps of the learning path we have enabled Live Queries on both the Project Listing screen and the Audit Listing screen.  Once replication is started those screens will update anytime new documents or changes to existing documents are replicated to the mobile device.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>:  This step assumes you completed the all previous steps of the learning path and specifically the <code>Couchbase Capella App Services Setup<\/code> that sets up Capella and App Services for this demo.  <strong>You MUST complete this part of the learning path before moving forward<\/strong>.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">In this step of the learning path you will learn the fundamentals of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure your Couchbase Lite clients for replication with Couchbase Capella App Services<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-app-overview\" class=\"wp-block-heading\">App Overview<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">While the demo app has a lot of functionality, this step will walk you through:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in into the application<\/li>\n\n\n<li>Scrolling the list of projects<\/li>\n\n\n<li>Setting up Replication<\/li>\n\n\n<li>Starting Replication<\/li>\n\n\n<li>Reviewing the code<\/li>\n\n\n<li>Validating the data is properly replicated between App Services and mobile device(s)<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-installation\" class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<h4 id=\"h-fetching-app-source-code\" class=\"wp-block-heading\">Fetching App Source Code<\/h4>\n\n\n\n<h5 id=\"h-clone-source-code\" class=\"wp-block-heading\">Clone Source Code<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you haven&#8217;t already cloned the repo from the previous step, clone the <code>Learn Couchbase Lite with Dart and Flutter<\/code> repository from GitHub.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>git clone https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path.git\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-couchbase-capella-app-services-connect-hostname\" class=\"wp-block-heading\">Couchbase Capella App Services Connect Hostname<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In order to start replication with Couchbase Capella App Services, you will need to know the hostname of the Couchbase Capella App Services instance. You can find this by logging into <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/cloud.couchbase.com\/\">Couchbase Capella<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Click on <code>App Services<\/code> from the tab navigation menu<\/p>\n<\/li>\n\n\n<li>\n<p>Click on your <code>Trial - App Services<\/code> instance<\/p>\n<\/li>\n\n\n<li>\n<p>Click on the <code>projects<\/code> App Endpoint<\/p>\n<\/li>\n\n\n<li>\n<p>Click on the <code>Connection<\/code> tab<\/p>\n<\/li>\n\n\n<li>\n<p>Copy URL under Public Connection.  This should look something similar to:<\/p>\n<ul>\n<li>wss:\/\/hostname.apps.cloud.couchbase.com:4984\/projects<\/li>\n<li>We will use this URL in a later step, so make sure you have it available.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p>Under Public Certificate, click the Download button to download the certificate.  This will be used in a later step to enable the mobile app to trust the App Services server.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-certificate-pinning-setup\" class=\"wp-block-heading\">Certificate Pinning Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The dart\/flutter SDK doesn&#8217;t include the App Services certificate by default.  This means that the mobile app will not trust the App Services server and replication will not work.  To fix this, we need to add the certificate to the mobile app so that it will trust the App Services server.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Copy the certificate you downloaded from the previous step to the <code>src<\/code> folder in the mobile app.  This is the same folder where the <code>pubspec.yaml<\/code> file is located.<\/p>\n<\/li>\n\n\n<li>\n<p>Open the <code>pubspec.yaml<\/code> file and add the file to the <code>assets<\/code> section.  When completed, it should look something like this:<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  assets:\n    - asset\/images\/couchbase.png\n    - asset\/database\/startingWarehouses.zip\n    - projects.pem\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-update-the-replication-url-in-the-audit-inventory-demo-app\" class=\"wp-block-heading\">Update the Replication URL in the Audit Inventory Demo App<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In Android Studio navigate to <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/database\/replicator_provider.dart#82\">replicator_provider.dart<\/a> found in the lib -&gt; features -&gt; database.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Uncomment line 82 that will load the pem file that you added into the prject and put in the YAML file<\/p>\n<\/li>\n\n\n<li>\n<p>Locate the <code>var url<\/code> definition<\/p>\n<\/li>\n\n\n<li>\n<p>Update the <code>host<\/code> and <code>path<\/code> to match the URL you copied from the Couchbase Capella App Services instance<\/p>\n<\/li>\n\n\n<li>\n<p>You will need to make sure that the path is the information after the port number and slash.  So for example if we were to look at this URL from App Services:  <strong>wss:\/\/hostname.apps.cloud.couchbase.com:4984\/projects<\/strong><\/p>\n<ul>\n<li>I would put the following in for the host:\n<ul>\n<li><strong>hostname.apps.cloud.couchbase.com<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>I would the following in for path:\n<ul>\n<li><strong>projects<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>\/\/ &lt;1&gt;\nvar url = Uri(scheme: &#039;wss&#039;,\n    port: 4984,\n    host: &#039;put_your_url_in_here&#039;,             \/\/change this line to match your configuration!!\n    path: &#039;projects&#039;,\n);\n\nvar basicAuthenticator = BasicAuthenticator(username: user.username, password: user.password);\nvar endPoint = UrlEndpoint(url);\n\n\/\/ &lt;2&gt;\n_replicatorConfiguration = ReplicatorConfiguration(\n    database: db,\n    target: endPoint,\n    authenticator: basicAuthenticator,\n    continuous: true,\n    replicatorType: ReplicatorType.pushAndPull,\n    heartbeat: const Duration(seconds: 60),\n    \/\/ **UNCOMMENT** this the line below if you are using App Services or a custom certificate\n    pinnedServerCertificate: pem.buffer.asUint8List()\n);\n\n\/\/check for nulls\nvar config = _replicatorConfiguration;\nif(config != null) {\n\n  \/\/ &lt;3&gt;\n  _replicator = await Replicator.createAsync(config);\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>It&#8217;s critical that the URL is correct.  If you have a typo or the URL is incorrect, replication will not work.  Make sure you have the correct URL.<\/li>\n\n\n<li>Update the <code>replicatorConfiguration<\/code> to use the <code>url<\/code> you created in the previous step<\/li>\n\n\n<li>Uncomment out line 103 in order to load tghe PEM file as a pinned certificate. This will allow the device to trust the connection between App Services and the mobile device. Your code should look something like this when done:<\/li>\n\n\n<li>The replicator is created by passing in the <code>replicatorConfiguration<\/code> object<\/li>\n\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>:  DO NOT use the url provided in the example as it will not work.  You must use the url you copied from the Couchbase Capella App Services instance.<\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-update-routebloc-dart\" class=\"wp-block-heading\">Update route_bloc.dart<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Finally you will need to update the route_bloc.dart to have replication init after the user logs in. This is done by uncommenting out line 110.<\/p>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>await _replicatorProvider.init();\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-when-to-start-replication\" class=\"wp-block-heading\">When to Start Replication<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Developers need to decide when to start replication.  For some apps it makes sense after the user logs in, while for others it might make more sense once the application is fully loaded.  In this app, two-way Replication between the app and the App Services is enabled from the Replication screen manually.<\/p>\n\n\n\n<h3 id=\"h-try-it-out\" class=\"wp-block-heading\">Try it out<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Log in to the app with any username and password. Let&#8217;s use the values <em>&#8220;<strong><a href=\"mailto:demo@example.com\">demo@example.com<\/a><\/strong>&#8220;<\/em> and <em>&#8220;<strong>P@ssw0rd12<\/strong>&#8220;<\/em> for username and password fields respectively.<\/p>\n<\/li>\n\n\n<li>\n<p>In the Demo App the Replicator screen can be found by tapping on the Drawer menu icon (sometimes referred to the Hamburger icon) in the upper left hand corner of the screen and tap on the Replication link.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/replicator_overflow_menu.png\" alt=\"Overflow Menu\" title=\"#width=350px\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Replication Status screen has buttons on it since a configuration is available to stop, start, and delete the configuration.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/replicator_status_start_available.png\" alt=\"Replicator Start Available\" title=\"#width=350px\"><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>: At this point your Capella App Services should be started and tested, which was covered in the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"app-services-lp-audit-inventory?learningPath=learn\/android-kotlin\"><code>Couchbase Capella App Services Setup<\/code><\/a> step of the learning path. If you start replication and the App Services is not setup properly, you will time out trying to connect to it.<\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Once replication starts you will see status messages appear in the mobile app.  Replication shouldn&#8217;t take long and when it&#8217;s done the replicator status will change to IDLE.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/replicator_status_completed.png\" alt=\"Replicator Complete\" title=\"#width=350px\"><\/p>\n\n\n\n<h3 id=\"h-validate-documents-replicated\" class=\"wp-block-heading\">Validate Documents Replicated<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Valdiating that the documents replicated from the device and from server can be done from the mobile app and from Couchbase Capella App Services.<\/p>\n\n\n\n<h4 id=\"h-demo-app\" class=\"wp-block-heading\">Demo App<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>In the Demo App navigate to the Home screen which can be found by tapping on the Drawer menu icon (sometimes referred to the Hamburger icon) in the upper left hand corner of the screen and tap on the Home link.<\/p>\n<\/li>\n\n\n<li>\n<p>Scrolling through the list you should see three new documents starting with the word <code>Warehouse<\/code> and then a number.  The numbers are different for each group of teams.<\/p>\n<ul>\n<li>Team1:  Warehouse 100, Warehouse 101, Warehouse 102<\/li>\n<li>Team2:  Warehouse 200, Warehouse 201, Warehouse 202<\/li>\n<li>Team3:  Warehouse 300, Warehouse 301, Warehouse 302<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/replicator_warehouse_documents.png\" alt=\"Replicator Warehouse Documents\" title=\"#width=350px\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can test other team members by logging out and logging in as <code>demo2@example.com<\/code> or <code>demo4@example.com<\/code> with the same password and starting the replicator to see those documents listed above.  Note that these users should have been created in App Services in the previous step.  If you didn&#8217;t create these users, this will not work as they will not be able to authenticate into App Services.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-couchbase-capella-and-app-services\" class=\"wp-block-heading\">Couchbase Capella and App Services<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Open your web browser of choice and log into <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/cloud.couchbase.com\/\">Couchbase Capella<\/a>.<\/p>\n<\/li>\n\n\n<li>\n<p>When logged in you should be at the Home tab for Trial accounts and the Database tab for non-trial accounts.<\/p>\n<\/li>\n\n\n<li>\n<p>Click on the <code>Trial - Cluster<\/code>.<\/p>\n<\/li>\n\n\n<li>\n<p>The Data Tools <code>Documents<\/code> tab should appear by default.<\/p>\n<\/li>\n\n\n<li>\n<p>Switch the bucket to your <code>prpojects<\/code> bucket<\/p>\n<\/li>\n\n\n<li>\n<p>On this screen you can see the number items in the buck should have increased from the the previous step of the learning path.  To view the documents, click on the Documents link to open the Document browser.<\/p>\n<\/li>\n\n\n<li>\n<p>Change the Limit box from the default value to 200 and click the Retrieve Docs button.<\/p>\n<\/li>\n\n\n<li>\n<p>Scrolling through the list you should find your random documents that were created on the mobile device during the Batch operations step of the learning path.  For example &#8211; prior to sync we didn&#8217;t have any documents of documentType=&#8217;audit&#8217; and now the bucket should have MANY audit documents.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-reviewing-the-replicator-code\" class=\"wp-block-heading\">Reviewing the Replicator code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we have tried out replication, let&#8217;s review how the replicator and replicator configuration code is setup. All code used by the ReplicatorBloc and ReplicatorProvider.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/database\/replicator_provider.dart#82\">replicator_provider.dart<\/a> file.<\/p>\n<\/li>\n\n\n<li>\n<p>As stated earlier, the override of replicatorConfig is used to setup the config with default values that you saw on the Replication Configuration screen.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>_replicatorConfiguration = ReplicatorConfiguration(\n    database: db,\n    target: endPoint,\n    authenticator: basicAuthenticator,\n    continuous: true,\n    replicatorType: ReplicatorType.pushAndPull,\n    heartbeat: const Duration(seconds: 60),\n    \/\/ **UNCOMMENT** this the line below if you are using App Services or a custom certificate\n    pinnedServerCertificate: pem.buffer.asUint8List()\n);\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/database\/replicator_provider.dart#L118\"> <strong>startReplicator<\/strong><\/a> function is used to start the replicator.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>  Future&lt;void&gt; startReplicator({\n    required Function(ReplicatorChange change)? onStatusChange,\n    required Function(DocumentReplication document)? onDocument }) async {\n\n    debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] info: starting replicator.&#039;);\n\n    var replicator = _replicator;\n    if (replicator != null) {\n\n      if(onStatusChange != null) {\n        var function = onStatusChange;\n        statusChangedToken = await replicator.addChangeListener(function);\n      }\n      if (onDocument != null) {\n        var function = onDocument;\n        replicator.addDocumentReplicationListener(function);\n      }\n      await replicator.start();\n\n      debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] info: started replicator.&#039;);\n    }\n    else {\n      debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] error: cannot start replicator, it is null.&#039;);\n    }\n  }\n\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/database\/replicator_provider.dart#L144\"> <strong>stopReplicator<\/strong><\/a> function is used to stop the replicator.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>  Future&lt;void&gt; stopReplicator() async {\n    var replicator = _replicator;\n    if (replicator != null){\n\n      debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] info: stopping replicator.&#039;);\n\n      \/\/remove change listeners before stopping replicator, this should\n      \/\/automatically be done with stopping, but just to be safe\n      await removeDocumentReplicationListener();\n      await removeStatusChangeListener();\n\n      await replicator.stop();\n\n      \/\/null out tokens so they can be reused\n      statusChangedToken = null;\n      documentReplicationToken = null;\n\n      debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] info: stopped replicator.&#039;);\n    } else {\n      debugPrint(&#039;${DateTime.now()} [ReplicatorProvider] warning: tried to stop replicator but it was null.&#039;);\n    }\n  }\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-exercise\" class=\"wp-block-heading\">Exercise<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this exercise, we will observe how changes made on one app are synced across to the other app<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The app should be running in two emulators side by side<\/li>\n\n\n<li>Log into one of the emulators with the username <strong><em>&#8220;<a href=\"mailto:demo@example.com\">demo@example.com<\/a>&#8220;<\/em><\/strong> and the password <strong><em>&#8220;P@ssw0rd12&#8221;<\/em><\/strong>.<\/li>\n\n\n<li>On the other emulator log into the app with the username <strong><em>&#8220;<a href=\"mailto:demo1@example.com\">demo1@example.com<\/a>&#8220;<\/em><\/strong> and the password <strong><em>&#8220;P@ssw0rd12&#8221;<\/em><\/strong>.<\/li>\n\n\n<li>Because demo and demo1 are on the same team &#8211; they should be able see changes made to documents by the other user.<\/li>\n\n\n<li>On one simulator, edit the name and location values of a project.<\/li>\n\n\n<li>Confirm that changes show up in the app on the other simulator.<\/li>\n\n\n<li>Similarly, make changes to the app in the other simulator and confirm that the changes are synced over to the first simulator.<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-handling-conflicts-during-data-synchronization\" class=\"wp-block-heading\">Handling Conflicts during Data Synchronization<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Data conflicts are inevitable in an environment where you can potentially have multiple writes updating the same data concurrently. Couchbase Mobile supports <strong><em>Automated Conflict Resolution<\/em><\/strong>.  You can learn more about this in the documentation on <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/conflict.html\">Handling Data Conflicts<\/a>.<\/p>\n\n\n\n<h3 id=\"h-learn-more\" class=\"wp-block-heading\">Learn More<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations on completing this step of the learning path!  In this section, we walked through setting up the Replicator Config and started two-way replication between a mobile app and Couchbase Capella App Services.<\/p>\n\n\n\n<h4 id=\"h-references\" class=\"wp-block-heading\">References<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/cloud\/app-services\/index.html\">Documentation:  App Services<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-live.html#using-kotlin-flows-and-livedata\">Using Kotlin Flows and LiveData<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/conflict.html\">Documentation:  Handling Data Conflicts<\/a><\/li>\n\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this part of our learning path, you will walk through the &#8220;Audit Inventory&#8221; demo application of using Couchbase Lite with the Replicator, which means the database will sync information using two way replication between the mobile app and Couchbase Capella App Services. In previous steps of the learning path we have enabled Live [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[589],"tutorial-tags":[587,588,591,590],"tutorial-technologies":[562,585],"tutorial-types":[555],"class_list":["post-10271","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-dart","tutorial-tags-android","tutorial-tags-app-services","tutorial-tags-flutter","tutorial-tags-ios","tutorial-technologies-capella","tutorial-technologies-mobile","tutorial-types-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Couchbase Capella App Services, Dart, and Flutter - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase Capella App Services, Dart, and Flutter\" \/>\n<meta property=\"og:description\" content=\"Introduction In this part of our learning path, you will walk through the &#8220;Audit Inventory&#8221; demo application of using Couchbase Lite with the Replicator, which means the database will sync information using two way replication between the mobile app and Couchbase Capella App Services. In previous steps of the learning path we have enabled Live [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"10\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/dart-flutter-replication-app-services\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/dart-flutter-replication-app-services\\\/\",\"name\":\"Couchbase Capella App Services, Dart, and Flutter - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\"},\"datePublished\":\"2024-02-12T18:04:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/dart-flutter-replication-app-services\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/dart-flutter-replication-app-services\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/dart-flutter-replication-app-services\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase Capella App Services, Dart, and Flutter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase Capella App Services, Dart, and Flutter - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/","og_locale":"de_DE","og_type":"article","og_title":"Couchbase Capella App Services, Dart, and Flutter","og_description":"Introduction In this part of our learning path, you will walk through the &#8220;Audit Inventory&#8221; demo application of using Couchbase Lite with the Replicator, which means the database will sync information using two way replication between the mobile app and Couchbase Capella App Services. In previous steps of the learning path we have enabled Live [&hellip;]","og_url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"10\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/","url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/","name":"Couchbase Capella App Services, Dart, and Flutter - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/de\/#website"},"datePublished":"2024-02-12T18:04:29+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/dart-flutter-replication-app-services\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Couchbase Capella App Services, Dart, and Flutter"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/de\/#website","url":"https:\/\/www.couchbase.com\/de\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/de\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/de\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase ist ein in San Jose, Kalifornien, ans\u00e4ssiges Unternehmen f\u00fcr Datenbanksoftware, das eine operative Datenplattform f\u00fcr KI bereitstellt, die von Hunderten von globalen Unternehmen eingesetzt wird.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10271\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/media?parent=10271"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-languages?post=10271"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-tags?post=10271"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-technologies?post=10271"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-types?post=10271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}