Skip to content

Commit 9652848

Browse files
committed
prefinal
1 parent 6521254 commit 9652848

27 files changed

Lines changed: 4848 additions & 62 deletions

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SUPABASE_URL=https://your_supabase_url.supabase.co
2+
SUPABASE_ANON_KEY=your_supabase_anon_key_here
3+
OPENWEATHER_API_KEY=your_openweather_api_key_here
4+
API_URL=http://localhost:80

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,10 @@ app.*.map.json
4343
/android/app/debug
4444
/android/app/profile
4545
/android/app/release
46+
47+
# Environment variables
48+
.env
49+
.env.local
50+
.env.development
51+
.env.test
52+
.env.production

android/app/build.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ plugins {
66
}
77

88
android {
9-
namespace = "com.example.myapp"
9+
namespace = "com.example.myapp" // Replace with your actual package name
1010
compileSdk = flutter.compileSdkVersion
1111
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14+
// Enable desugaring
15+
isCoreLibraryDesugaringEnabled = true
1416
sourceCompatibility = JavaVersion.VERSION_1_8
1517
targetCompatibility = JavaVersion.VERSION_1_8
1618
}
@@ -20,10 +22,7 @@ android {
2022
}
2123

2224
defaultConfig {
23-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24-
applicationId = "com.example.myapp"
25-
// You can update the following values to match your application needs.
26-
// For more information, see: https://flutter.dev/to/review-gradle-config.
25+
applicationId = "com.example.myapp" // Replace with your actual package name
2726
minSdk = flutter.minSdkVersion
2827
targetSdk = flutter.targetSdkVersion
2928
versionCode = flutter.versionCode
@@ -42,3 +41,8 @@ android {
4241
flutter {
4342
source = "../.."
4443
}
44+
45+
dependencies {
46+
// Updated to the required version 2.0.3 (which is above the minimum required 2.1.4)
47+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
48+
}
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- Internet Permission -->
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
5+
<!-- Location Permissions -->
6+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
7+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
28
<!-- The INTERNET permission is required for development. Specifically,
39
the Flutter tool needs it to communicate with the running application
410
to allow setting breakpoints, to provide hot reload, etc.
511
-->
6-
<uses-permission android:name="android.permission.INTERNET"/>
12+
<queries>
13+
<intent>
14+
<action android:name="android.intent.action.TTS_SERVICE" />
15+
</intent>
16+
<intent>
17+
<action android:name="android.speech.RecognitionService" />
18+
</intent>
19+
</queries>
720
</manifest>

android/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.INTERNET"/>
3+
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
4+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
5+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
26
<application
37
android:label="myapp"
48
android:name="${applicationName}"
@@ -41,5 +45,11 @@
4145
<action android:name="android.intent.action.PROCESS_TEXT"/>
4246
<data android:mimeType="text/plain"/>
4347
</intent>
48+
<intent>
49+
<action android:name="android.intent.action.TTS_SERVICE" />
50+
</intent>
51+
<intent>
52+
<action android:name="android.speech.RecognitionService" />
53+
</intent>
4454
</queries>
4555
</manifest>

android/app/src/profile/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>
7+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
8+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
79
</manifest>

assets/logos/splash_logo.svg

Lines changed: 3 additions & 0 deletions
Loading

backend

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 5420d421f3484ee82ae1069bf3995e6c6865f39e

lib/main.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import 'package:flutter/material.dart';
22
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
3+
import 'package:flutter_dotenv/flutter_dotenv.dart';
34

45
import 'util.dart';
56
import 'theme.dart';
6-
import 'screens/auth_screen.dart';
7+
import 'screens/splash_screen.dart';
78

89
void main() async {
10+
WidgetsFlutterBinding.ensureInitialized();
11+
12+
await dotenv.load();
13+
914
await Supabase.initialize(
10-
url: 'https://jbpeszoljhnymgqhufmd.supabase.co',
11-
anonKey:
12-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpicGVzem9samhueW1ncWh1Zm1kIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDMyNTAzMDIsImV4cCI6MjA1ODgyNjMwMn0.NX3h_DpXqnpabbla3wR-RHQTuZskM3aJeX2qU1HNUe0',
15+
url: dotenv.env['SUPABASE_URL'] ?? '',
16+
anonKey: dotenv.env['SUPABASE_ANON_KEY'] ?? '',
1317
);
18+
1419
runApp(const MyApp());
1520
}
1621

@@ -30,9 +35,9 @@ class MyApp extends StatelessWidget {
3035
MaterialTheme theme = MaterialTheme(textTheme);
3136
return MaterialApp(
3237
debugShowCheckedModeBanner: false,
33-
title: 'Flutter Demo',
38+
title: 'Celesta',
3439
theme: brightness == Brightness.light ? theme.light() : theme.dark(),
35-
home: const AuthScreen(),
40+
home: const SplashScreen(),
3641
);
3742
}
3843
}

lib/models/DiaryEntryModel.dart

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
class DiaryEntryModel {
2+
final int? id;
3+
final int plantId;
4+
final double? height;
5+
final String? notes;
6+
final String? imageUrl;
7+
final DateTime? date;
8+
9+
DiaryEntryModel({
10+
this.id,
11+
required this.plantId,
12+
this.height,
13+
this.notes,
14+
this.imageUrl,
15+
this.date,
16+
});
17+
18+
factory DiaryEntryModel.fromJson(Map<String, dynamic> json) {
19+
return DiaryEntryModel(
20+
id: json['id'],
21+
plantId: json['plant_id'],
22+
height: json['height'] != null ? json['height'].toDouble() : null,
23+
notes: json['notes'],
24+
imageUrl: json['image_url'],
25+
date: json['date'] != null ? DateTime.parse(json['date']) : null,
26+
);
27+
}
28+
29+
Map<String, dynamic> toJson() {
30+
return {
31+
'id': id,
32+
'plant_id': plantId,
33+
'height': height,
34+
'notes': notes,
35+
'image_url': imageUrl,
36+
'date': date?.toIso8601String(),
37+
};
38+
}
39+
40+
DiaryEntryModel copyWith({
41+
int? id,
42+
int? plantId,
43+
double? height,
44+
String? notes,
45+
String? imageUrl,
46+
DateTime? date,
47+
}) {
48+
return DiaryEntryModel(
49+
id: id ?? this.id,
50+
plantId: plantId ?? this.plantId,
51+
height: height ?? this.height,
52+
notes: notes ?? this.notes,
53+
imageUrl: imageUrl ?? this.imageUrl,
54+
date: date ?? this.date,
55+
);
56+
}
57+
}

0 commit comments

Comments
 (0)