wip: not complete but still starting.

This commit is contained in:
ItzNotABug 2025-02-24 16:58:12 +05:30
parent ae3e6ea16d
commit e32da995a2
6 changed files with 35 additions and 12 deletions

4
.env.example Normal file
View File

@ -0,0 +1,4 @@
APPWRITE_VERSION=
APPWRITE_PROJECT_ID=
APPWRITE_PROJECT_NAME=
APPWRITE_PUBLIC_ENDPOINT=

2
.gitignore vendored
View File

@ -33,6 +33,8 @@ migrate_working_dir/
.pub/ .pub/
/build/ /build/
.env
# Symbolication related # Symbolication related
app.*.symbols app.*.symbols

View File

@ -1,17 +1,18 @@
import 'package:intl/intl.dart';
import 'package:appwrite/appwrite.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/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:intl/intl.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 appwriteVersion = "1.6.1"; static final String appwriteVersion = dotenv.env['APPWRITE_VERSION']!;
static const String appwriteProjectId = "project-id"; static final String appwriteProjectId = dotenv.env['APPWRITE_PROJECT_ID']!;
static const String appwriteProjectName = "My project"; static final String appwriteProjectName = dotenv.env['APPWRITE_PROJECT_NAME']!;
static const String appwritePublicEndpoint = "https://cloud.appwrite.io/v1"; static final String appwritePublicEndpoint = dotenv.env['APPWRITE_PUBLIC_ENDPOINT']!;
final Client _client = Client() final Client _client = Client()
.setProject(appwriteProjectId) .setProject(appwriteProjectId)

View File

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:window_manager/window_manager.dart'; import 'package:window_manager/window_manager.dart';
/// A utility class for initializing the Flutter application. /// A utility class for initializing the Flutter application.
@ -17,6 +18,7 @@ class AppInitializer {
/// and configures device orientation settings. /// and configures device orientation settings.
static initialize() async { static initialize() async {
_ensureInitialized(); _ensureInitialized();
await _loadDotEnvVariables();
await _setupWindowDimensions(); await _setupWindowDimensions();
await _setupDeviceOrientation(); await _setupDeviceOrientation();
} }
@ -26,6 +28,11 @@ class AppInitializer {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
} }
/// Ensures that Flutter bindings are initialized.
static _loadDotEnvVariables() async {
await dotenv.load(fileName: ".env");
}
/// Configures the window dimensions for desktop applications. /// Configures the window dimensions for desktop applications.
/// ///
/// Ensures the window manager is initialized and sets a minimum window size. /// Ensures the window manager is initialized and sets a minimum window size.

View File

@ -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:
@ -158,6 +158,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" 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: flutter_launcher_icons:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -271,10 +279,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:
@ -625,5 +633,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.7.0-0 <4.0.0"
flutter: ">=3.27.0" flutter: ">=3.27.0"

View File

@ -14,6 +14,7 @@ dependencies:
intl: ^0.20.2 intl: ^0.20.2
appwrite: ^14.0.0 appwrite: ^14.0.0
url_launcher: ^6.3.1 url_launcher: ^6.3.1
flutter_dotenv: ^5.2.1
window_manager: ^0.4.3 window_manager: ^0.4.3
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8