Skip to content

Commit 1ae5710

Browse files
authored
Merge pull request #2 from appwrite/env-support
Env support
2 parents e314312 + bc66bcd commit 1ae5710

File tree

6 files changed

+17
-25
lines changed

6 files changed

+17
-25
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APPWRITE_PROJECT_ID=
2+
APPWRITE_PROJECT_NAME=
3+
APPWRITE_PUBLIC_ENDPOINT=

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ migrate_working_dir/
3333
.pub/
3434
/build/
3535

36+
.env
37+
3638
# Symbolication related
3739
app.*.symbols
3840

@@ -80,4 +82,4 @@ fastlane/sign&cert
8082
*~
8183
*.save
8284
._*
83-
*.bak
85+
*.bak

lib/data/models/project_info.dart

-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ class ProjectInfo {
33
final String endpoint;
44
final String projectId;
55
final String projectName;
6-
final String version;
76

87
ProjectInfo({
98
required this.endpoint,
109
required this.projectId,
1110
required this.projectName,
12-
required this.version,
1311
});
1412
}

lib/data/repository/appwrite_repository.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
import 'package:intl/intl.dart';
12
import 'package:appwrite/appwrite.dart';
23
import 'package:appwrite_flutter_starter_kit/data/models/log.dart';
34
import 'package:appwrite_flutter_starter_kit/data/models/project_info.dart';
4-
import 'package:intl/intl.dart';
55

66
/// A repository responsible for handling network interactions with the Appwrite server.
77
///
88
/// It provides a helper method to ping the server.
99
class AppwriteRepository {
1010
static const String pingPath = "/ping";
11-
static const String appwriteVersion = "1.6.1";
12-
static const String appwriteProjectId = "project-id";
13-
static const String appwriteProjectName = "My project";
14-
static const String appwritePublicEndpoint = "https://cloud.appwrite.io/v1";
11+
static const String appwriteProjectId = String.fromEnvironment('APPWRITE_PROJECT_ID');
12+
static const String appwriteProjectName = String.fromEnvironment('APPWRITE_PROJECT_NAME');
13+
static const String appwritePublicEndpoint = String.fromEnvironment('APPWRITE_PUBLIC_ENDPOINT');
1514

1615
final Client _client = Client()
1716
.setProject(appwriteProjectId)
@@ -35,7 +34,6 @@ class AppwriteRepository {
3534
endpoint: appwritePublicEndpoint,
3635
projectId: appwriteProjectId,
3736
projectName: appwriteProjectName,
38-
version: appwriteVersion,
3937
);
4038
}
4139

lib/ui/components/collapsible_bottomsheet.dart

-9
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,6 @@ class ProjectSection extends StatelessWidget {
242242
ProjectRow(title: "Project ID", value: projectInfo.projectId),
243243
],
244244
),
245-
const SizedBox(height: 16),
246-
Row(
247-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
248-
children: [
249-
ProjectRow(
250-
title: "Project Name", value: projectInfo.projectName),
251-
ProjectRow(title: "Version", value: projectInfo.version),
252-
],
253-
),
254245
],
255246
),
256247
),

pubspec.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ packages:
4545
dependency: transitive
4646
description:
4747
name: characters
48-
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
48+
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.3.0"
51+
version: "1.4.0"
5252
checked_yaml:
5353
dependency: transitive
5454
description:
@@ -77,10 +77,10 @@ packages:
7777
dependency: transitive
7878
description:
7979
name: collection
80-
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
80+
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
8181
url: "https://pub.dev"
8282
source: hosted
83-
version: "1.19.0"
83+
version: "1.19.1"
8484
cookie_jar:
8585
dependency: transitive
8686
description:
@@ -271,10 +271,10 @@ packages:
271271
dependency: transitive
272272
description:
273273
name: meta
274-
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
274+
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
275275
url: "https://pub.dev"
276276
source: hosted
277-
version: "1.15.0"
277+
version: "1.16.0"
278278
package_info_plus:
279279
dependency: transitive
280280
description:
@@ -625,5 +625,5 @@ packages:
625625
source: hosted
626626
version: "3.1.3"
627627
sdks:
628-
dart: ">=3.6.0 <4.0.0"
628+
dart: ">=3.7.0-0 <4.0.0"
629629
flutter: ">=3.27.0"

0 commit comments

Comments
 (0)