wip: not complete but still starting.
This commit is contained in:
parent
ae3e6ea16d
commit
e32da995a2
4
.env.example
Normal file
4
.env.example
Normal file
@ -0,0 +1,4 @@
|
||||
APPWRITE_VERSION=
|
||||
APPWRITE_PROJECT_ID=
|
||||
APPWRITE_PROJECT_NAME=
|
||||
APPWRITE_PUBLIC_ENDPOINT=
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -33,6 +33,8 @@ migrate_working_dir/
|
||||
.pub/
|
||||
/build/
|
||||
|
||||
.env
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
|
||||
|
||||
@ -1,17 +1,18 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:appwrite_flutter_starter_kit/data/models/log.dart';
|
||||
import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
/// A repository responsible for handling network interactions with the Appwrite server.
|
||||
///
|
||||
/// It provides a helper method to ping the server.
|
||||
class AppwriteRepository {
|
||||
static const String pingPath = "/ping";
|
||||
static const String appwriteVersion = "1.6.1";
|
||||
static const String appwriteProjectId = "project-id";
|
||||
static const String appwriteProjectName = "My project";
|
||||
static const String appwritePublicEndpoint = "https://cloud.appwrite.io/v1";
|
||||
static final String appwriteVersion = dotenv.env['APPWRITE_VERSION']!;
|
||||
static final String appwriteProjectId = dotenv.env['APPWRITE_PROJECT_ID']!;
|
||||
static final String appwriteProjectName = dotenv.env['APPWRITE_PROJECT_NAME']!;
|
||||
static final String appwritePublicEndpoint = dotenv.env['APPWRITE_PUBLIC_ENDPOINT']!;
|
||||
|
||||
final Client _client = Client()
|
||||
.setProject(appwriteProjectId)
|
||||
|
||||
@ -3,6 +3,7 @@ import 'dart:io';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
/// A utility class for initializing the Flutter application.
|
||||
@ -17,6 +18,7 @@ class AppInitializer {
|
||||
/// and configures device orientation settings.
|
||||
static initialize() async {
|
||||
_ensureInitialized();
|
||||
await _loadDotEnvVariables();
|
||||
await _setupWindowDimensions();
|
||||
await _setupDeviceOrientation();
|
||||
}
|
||||
@ -26,6 +28,11 @@ class AppInitializer {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
}
|
||||
|
||||
/// Ensures that Flutter bindings are initialized.
|
||||
static _loadDotEnvVariables() async {
|
||||
await dotenv.load(fileName: ".env");
|
||||
}
|
||||
|
||||
/// Configures the window dimensions for desktop applications.
|
||||
///
|
||||
/// Ensures the window manager is initialized and sets a minimum window size.
|
||||
|
||||
22
pubspec.lock
22
pubspec.lock
@ -45,10 +45,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.4.0"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -77,10 +77,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.0"
|
||||
version: "1.19.1"
|
||||
cookie_jar:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -158,6 +158,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_dotenv:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_dotenv
|
||||
sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.1"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -271,10 +279,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
package_info_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -625,5 +633,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.6.0 <4.0.0"
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
flutter: ">=3.27.0"
|
||||
|
||||
@ -14,6 +14,7 @@ dependencies:
|
||||
intl: ^0.20.2
|
||||
appwrite: ^14.0.0
|
||||
url_launcher: ^6.3.1
|
||||
flutter_dotenv: ^5.2.1
|
||||
window_manager: ^0.4.3
|
||||
cupertino_icons: ^1.0.8
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user