From e32da995a2cd08fe89deafd82fe1707ce6903799 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Mon, 24 Feb 2025 16:58:12 +0530 Subject: [PATCH 1/3] wip: not complete but still starting. --- .env.example | 4 ++++ .gitignore | 2 ++ lib/data/repository/appwrite_repository.dart | 11 +++++----- lib/utils/app_initializer.dart | 7 +++++++ pubspec.lock | 22 +++++++++++++------- pubspec.yaml | 1 + 6 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..4a3653e --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +APPWRITE_VERSION= +APPWRITE_PROJECT_ID= +APPWRITE_PROJECT_NAME= +APPWRITE_PUBLIC_ENDPOINT= diff --git a/.gitignore b/.gitignore index 3cded81..d19409e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ migrate_working_dir/ .pub/ /build/ +.env + # Symbolication related app.*.symbols diff --git a/lib/data/repository/appwrite_repository.dart b/lib/data/repository/appwrite_repository.dart index b518b1f..d906372 100644 --- a/lib/data/repository/appwrite_repository.dart +++ b/lib/data/repository/appwrite_repository.dart @@ -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) diff --git a/lib/utils/app_initializer.dart b/lib/utils/app_initializer.dart index 6b1d365..36e28cc 100644 --- a/lib/utils/app_initializer.dart +++ b/lib/utils/app_initializer.dart @@ -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. diff --git a/pubspec.lock b/pubspec.lock index 359de51..0099d7a 100644 --- a/pubspec.lock +++ b/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" diff --git a/pubspec.yaml b/pubspec.yaml index 97e0dfb..c1a3d21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 From 761fcd7cd76a672a610e570377b66c5d65b8e519 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 24 Feb 2025 17:29:20 +0530 Subject: [PATCH 2/3] update: for sites run. --- .gitignore | 4 +++- lib/data/repository/appwrite_repository.dart | 9 ++++----- lib/utils/app_initializer.dart | 7 ------- pubspec.lock | 8 -------- pubspec.yaml | 1 - 5 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index d19409e..8c76384 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,6 @@ fastlane/sign&cert *~ *.save ._* -*.bak \ No newline at end of file +*.bak + +*.sh \ No newline at end of file diff --git a/lib/data/repository/appwrite_repository.dart b/lib/data/repository/appwrite_repository.dart index d906372..5e274a5 100644 --- a/lib/data/repository/appwrite_repository.dart +++ b/lib/data/repository/appwrite_repository.dart @@ -1,6 +1,5 @@ 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'; @@ -9,10 +8,10 @@ import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart'; /// It provides a helper method to ping the server. class AppwriteRepository { static const String pingPath = "/ping"; - 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']!; + static const String appwriteVersion = String.fromEnvironment('APPWRITE_VERSION'); + static const String appwriteProjectId = String.fromEnvironment('APPWRITE_PROJECT_ID'); + static const String appwriteProjectName = String.fromEnvironment('APPWRITE_PROJECT_NAME'); + static const String appwritePublicEndpoint = String.fromEnvironment('APPWRITE_PUBLIC_ENDPOINT'); final Client _client = Client() .setProject(appwriteProjectId) diff --git a/lib/utils/app_initializer.dart b/lib/utils/app_initializer.dart index 36e28cc..6b1d365 100644 --- a/lib/utils/app_initializer.dart +++ b/lib/utils/app_initializer.dart @@ -3,7 +3,6 @@ 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. @@ -18,7 +17,6 @@ class AppInitializer { /// and configures device orientation settings. static initialize() async { _ensureInitialized(); - await _loadDotEnvVariables(); await _setupWindowDimensions(); await _setupDeviceOrientation(); } @@ -28,11 +26,6 @@ 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. diff --git a/pubspec.lock b/pubspec.lock index 0099d7a..aedf45c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -158,14 +158,6 @@ 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: diff --git a/pubspec.yaml b/pubspec.yaml index c1a3d21..97e0dfb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,6 @@ 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 From bc66bcdbeb0ee1272ce21dfe295d93e5c6944a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 11 Mar 2025 13:22:30 +0000 Subject: [PATCH 3/3] Remove version --- .env.example | 1 - .gitignore | 2 -- lib/data/models/project_info.dart | 2 -- lib/data/repository/appwrite_repository.dart | 2 -- lib/ui/components/collapsible_bottomsheet.dart | 9 --------- 5 files changed, 16 deletions(-) diff --git a/.env.example b/.env.example index 4a3653e..549edfc 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,3 @@ -APPWRITE_VERSION= APPWRITE_PROJECT_ID= APPWRITE_PROJECT_NAME= APPWRITE_PUBLIC_ENDPOINT= diff --git a/.gitignore b/.gitignore index 8c76384..26e5e28 100644 --- a/.gitignore +++ b/.gitignore @@ -83,5 +83,3 @@ fastlane/sign&cert *.save ._* *.bak - -*.sh \ No newline at end of file diff --git a/lib/data/models/project_info.dart b/lib/data/models/project_info.dart index 79574b7..dd310ac 100644 --- a/lib/data/models/project_info.dart +++ b/lib/data/models/project_info.dart @@ -3,12 +3,10 @@ class ProjectInfo { final String endpoint; final String projectId; final String projectName; - final String version; ProjectInfo({ required this.endpoint, required this.projectId, required this.projectName, - required this.version, }); } diff --git a/lib/data/repository/appwrite_repository.dart b/lib/data/repository/appwrite_repository.dart index 5e274a5..4619a6f 100644 --- a/lib/data/repository/appwrite_repository.dart +++ b/lib/data/repository/appwrite_repository.dart @@ -8,7 +8,6 @@ import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart'; /// It provides a helper method to ping the server. class AppwriteRepository { static const String pingPath = "/ping"; - static const String appwriteVersion = String.fromEnvironment('APPWRITE_VERSION'); static const String appwriteProjectId = String.fromEnvironment('APPWRITE_PROJECT_ID'); static const String appwriteProjectName = String.fromEnvironment('APPWRITE_PROJECT_NAME'); static const String appwritePublicEndpoint = String.fromEnvironment('APPWRITE_PUBLIC_ENDPOINT'); @@ -35,7 +34,6 @@ class AppwriteRepository { endpoint: appwritePublicEndpoint, projectId: appwriteProjectId, projectName: appwriteProjectName, - version: appwriteVersion, ); } diff --git a/lib/ui/components/collapsible_bottomsheet.dart b/lib/ui/components/collapsible_bottomsheet.dart index b1695ea..0b46a07 100644 --- a/lib/ui/components/collapsible_bottomsheet.dart +++ b/lib/ui/components/collapsible_bottomsheet.dart @@ -242,15 +242,6 @@ class ProjectSection extends StatelessWidget { ProjectRow(title: "Project ID", value: projectInfo.projectId), ], ), - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - ProjectRow( - title: "Project Name", value: projectInfo.projectName), - ProjectRow(title: "Version", value: projectInfo.version), - ], - ), ], ), ),