Compare commits
11 Commits
0.1.5
...
chore-bump
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a24a6c030f | ||
|
|
a2314c8920 | ||
|
|
f2caf6f028 | ||
|
|
8aa2aec2d6 | ||
|
|
8e2361b825 | ||
|
|
9453e45ced | ||
|
|
c0cae9fcb7 | ||
|
|
fcc2384a5e | ||
|
|
774da7ad6c | ||
|
|
2d645274a9 | ||
|
|
b3d927662c |
@@ -1,3 +0,0 @@
|
|||||||
APPWRITE_PROJECT_ID=
|
|
||||||
APPWRITE_PROJECT_NAME=
|
|
||||||
APPWRITE_PUBLIC_ENDPOINT=
|
|
||||||
33
README.md
33
README.md
@@ -24,16 +24,39 @@ Alternatively, open the repository URL in `Android Studio` to clone it directly.
|
|||||||
## 🛠️ Development Guide
|
## 🛠️ Development Guide
|
||||||
|
|
||||||
1. **Configure Appwrite**
|
1. **Configure Appwrite**
|
||||||
Navigate to `lib/data/repository/appwrite_repository.dart` and update the values to match your
|
Open `lib/config/environment.dart` and update the values with your Appwrite project credentials:
|
||||||
Appwrite project credentials.
|
```dart
|
||||||
|
class Environment {
|
||||||
|
static const String appwritePublicEndpoint = '[appwritePublicEndpoint]';
|
||||||
|
static const String appwriteProjectId = '[appwriteProjectId]';
|
||||||
|
static const String appwriteProjectName = '[appwriteProjectName]';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
2. **Customize as Needed**
|
2. **Customize as Needed**
|
||||||
Modify the starter kit to suit your app's requirements. Adjust UI, features, or backend
|
Modify the starter kit to suit your app's requirements. Adjust UI, features, or backend
|
||||||
integrations as per your needs.
|
integrations as per your needs.
|
||||||
|
|
||||||
3. **Run the App**
|
3. **Run the App**
|
||||||
Select a target device (emulator or a connected physical device) in `Android Studio`, and
|
Select a target device and run the app:
|
||||||
click **Run** to start the app.
|
```bash
|
||||||
|
# List available devices
|
||||||
|
flutter devices
|
||||||
|
|
||||||
|
# Run on a specific device (replace 'device-id' with actual device)
|
||||||
|
flutter run -d device-id
|
||||||
|
|
||||||
|
# Examples:
|
||||||
|
flutter run -d chrome # Web
|
||||||
|
flutter run -d "iPhone 15" # iOS Simulator
|
||||||
|
flutter run -d emulator-5554 # Android Emulator
|
||||||
|
flutter run -d macos # macOS Desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
**Build for Web:**
|
||||||
|
```bash
|
||||||
|
flutter build web
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -46,5 +69,5 @@ production : https://docs.flutter.dev/deployment
|
|||||||
|
|
||||||
## 💡 Additional Notes
|
## 💡 Additional Notes
|
||||||
|
|
||||||
- This starter project is designed to streamline your Android development with Appwrite.
|
- This starter project is designed to streamline your Flutter development with Appwrite.
|
||||||
- Refer to the [Appwrite Documentation](https://appwrite.io/docs) for detailed integration guidance.
|
- Refer to the [Appwrite Documentation](https://appwrite.io/docs) for detailed integration guidance.
|
||||||
26
build.sh
26
build.sh
@@ -1,26 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if .env file exists
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
echo "Error: .env file not found!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Read .env file and convert it to --dart-define arguments
|
|
||||||
ARGS=""
|
|
||||||
while IFS='=' read -r key value || [ -n "$key" ]; do
|
|
||||||
# Ignore empty lines and comments
|
|
||||||
if [[ -n "$key" && ! "$key" =~ ^# ]]; then
|
|
||||||
ARGS+=" --dart-define=${key}=\"${value}\""
|
|
||||||
fi
|
|
||||||
done < .env
|
|
||||||
|
|
||||||
# Build Flutter web
|
|
||||||
eval flutter build web "$ARGS"
|
|
||||||
|
|
||||||
# If --preview flag is provided, run a local preview server
|
|
||||||
if [ "$1" == "--preview" ]; then
|
|
||||||
echo "Starting preview server at http://localhost:3000..."
|
|
||||||
cd build/web || exit 1
|
|
||||||
python3 -m http.server 3000
|
|
||||||
fi
|
|
||||||
5
lib/config/environment.dart
Normal file
5
lib/config/environment.dart
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class Environment {
|
||||||
|
static const String appwritePublicEndpoint = '[appwritePublicEndpoint]';
|
||||||
|
static const String appwriteProjectId = '[appwriteProjectId]';
|
||||||
|
static const String appwriteProjectName = '[appwriteProjectName]';
|
||||||
|
}
|
||||||
@@ -2,15 +2,16 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:appwrite/appwrite.dart';
|
import 'package:appwrite/appwrite.dart';
|
||||||
import 'package:appwrite_flutter_starter_kit/data/models/log.dart';
|
import 'package:appwrite_flutter_starter_kit/data/models/log.dart';
|
||||||
import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart';
|
import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart';
|
||||||
|
import 'package:appwrite_flutter_starter_kit/config/environment.dart';
|
||||||
|
|
||||||
/// A repository responsible for handling network interactions with the Appwrite server.
|
/// A repository responsible for handling network interactions with the Appwrite server.
|
||||||
///
|
///
|
||||||
/// It provides a helper method to ping the server.
|
/// It provides a helper method to ping the server.
|
||||||
class AppwriteRepository {
|
class AppwriteRepository {
|
||||||
static const String pingPath = "/ping";
|
static const String pingPath = "/ping";
|
||||||
static const String appwriteProjectId = String.fromEnvironment('APPWRITE_PROJECT_ID');
|
static const String appwriteProjectId = Environment.appwriteProjectId;
|
||||||
static const String appwriteProjectName = String.fromEnvironment('APPWRITE_PROJECT_NAME');
|
static const String appwriteProjectName = Environment.appwriteProjectName;
|
||||||
static const String appwritePublicEndpoint = String.fromEnvironment('APPWRITE_PUBLIC_ENDPOINT');
|
static const String appwritePublicEndpoint = Environment.appwritePublicEndpoint;
|
||||||
|
|
||||||
final Client _client = Client()
|
final Client _client = Client()
|
||||||
.setProject(appwriteProjectId)
|
.setProject(appwriteProjectId)
|
||||||
|
|||||||
13
prepare-env.sh
Normal file
13
prepare-env.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Script used during deployment on Appwrite Sites
|
||||||
|
|
||||||
|
# Replace [appwritePublicEndpoint] with APPWRITE_PUBLIC_ENDPOINT in environment file
|
||||||
|
sed -i "s|\[appwritePublicEndpoint\]|$APPWRITE_PUBLIC_ENDPOINT|g" lib/config/environment.dart
|
||||||
|
|
||||||
|
# Replace [appwriteProjectId] with APPWRITE_PROJECT_ID in environment file
|
||||||
|
sed -i "s|\[appwriteProjectId\]|$APPWRITE_PROJECT_ID|g" lib/config/environment.dart
|
||||||
|
|
||||||
|
# Replace [appwriteProjectName] with APPWRITE_PROJECT_NAME in environment file
|
||||||
|
sed -i "s|\[appwriteProjectName\]|$APPWRITE_PROJECT_NAME|g" lib/config/environment.dart
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
echo "APPWRITE_PROJECT_ID=$APPWRITE_PROJECT_ID" >> .env
|
|
||||||
echo "APPWRITE_PROJECT_NAME=$APPWRITE_PROJECT_NAME" >> .env
|
|
||||||
echo "APPWRITE_PUBLIC_ENDPOINT=$APPWRITE_PUBLIC_ENDPOINT" >> .env
|
|
||||||
40
pubspec.lock
40
pubspec.lock
@@ -13,10 +13,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: appwrite
|
name: appwrite
|
||||||
sha256: "3e1f618c8f75bafa49ef7b1b445f64c53cf4620a195443f4d119bbc95a666d0a"
|
sha256: "1daa7b4aeff4a6e8af84fb54c66944e2bf202af7647f355a822a427c23728ec9"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.0.0"
|
version: "20.2.1"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -45,10 +45,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.4.0"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -77,10 +77,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
|
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.0"
|
version: "1.19.1"
|
||||||
cookie_jar:
|
cookie_jar:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -125,26 +125,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: device_info_plus
|
name: device_info_plus
|
||||||
sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074
|
sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.1.2"
|
version: "11.5.0"
|
||||||
device_info_plus_platform_interface:
|
device_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: device_info_plus_platform_interface
|
name: device_info_plus_platform_interface
|
||||||
sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2"
|
sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.2"
|
version: "7.0.3"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: ffi
|
name: ffi
|
||||||
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.4"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -271,10 +271,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.16.0"
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -572,18 +572,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
|
sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.10.1"
|
version: "5.15.0"
|
||||||
win32_registry:
|
win32_registry:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32_registry
|
name: win32_registry
|
||||||
sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852"
|
sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.5"
|
version: "2.1.0"
|
||||||
window_manager:
|
window_manager:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -625,5 +625,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.3"
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.6.0 <4.0.0"
|
dart: ">=3.8.0 <4.0.0"
|
||||||
flutter: ">=3.27.0"
|
flutter: ">=3.29.0"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
intl: ^0.20.2
|
intl: ^0.20.2
|
||||||
appwrite: ^14.0.0
|
appwrite: ^20.2.1
|
||||||
url_launcher: ^6.3.1
|
url_launcher: ^6.3.1
|
||||||
window_manager: ^0.4.3
|
window_manager: ^0.4.3
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
|
|||||||
Reference in New Issue
Block a user