Skip to content

getditto/demoapp-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ditto Flutter Demo App

This is a basic task application that demonstrates how to use Ditto's peer-to-peer data sync within your Flutter Application.

alt text

Getting Started

1. Clone the Repository

  • Clone the repository from GitHub. Open a terminal and run the following command:
git clone https://github.com/getditto/demoapp-flutter
  • Navigate to the project directory:
cd demoapp-flutter

2. Install Dependencies

Install the necessary dependencies.

flutter pub get

3. Configure Ditto

Obtain App ID and Playground Token

  • Log in to your Ditto Portal account
  • Navigate to your application and obtain the App ID and Playground Token (see Sync Credentials for more details)

Update Flutter Application with Ditto Credentials

  • Open the lib/main.dart file or the appropriate configuration file where Ditto is initialized
  • Update the code with the App ID and Playground Token from your Ditto Application
const appID = "REPLACE_ME_WITH_YOUR_APP_ID";
const token = "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN";

4. Run the Application

Run the Application on Android

  • Ensure you have an Android Emulator running or connect a physical device
  • Run the following command in the terminal from the root of the application
flutter run
  • Select the Android Emulator/Device
[1]: sdk gphone64 arm64 (emulator-1234)
[2]: Mac Designed for iPad (mac-designed-for-ipad)
Please choose one (or "q" to quit):

Run the Application on iOS

  • Ensure you have an iOS Simulator running or connect a physical iOS device Run the following command in the terminal and select the iOS Simulator/Device
flutter run
  • Select the iOS Simulator/Device
[1]: iPhone 15 (5A8DFE9D-7BF0-4BEE-A675-A056B64CEE3F)
[2]: Mac Designed for iPad (mac-designed-for-ipad)
Please choose one (or "q" to quit):

5. Sync-Data Offline

  • Launch the application on multiple devices, emulators, or simulators
  • Disconnect from your current WiFi network while keeping WiFi enabled on the device to allow for LAN connections
  • Create new Tasks and update the Done status of existing tasks

Note: Android Emulators cannot connect to iOS Simulators for offline sync due to platform limitations

Additional Resources

Explore the following links and resources to learn more about Ditto:

General Information

Technical Information

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published