diff --git a/creche_app/.gitignore b/creche_app/.gitignore
new file mode 100644
index 0000000..3820a95
--- /dev/null
+++ b/creche_app/.gitignore
@@ -0,0 +1,45 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.build/
+.buildlog/
+.history
+.svn/
+.swiftpm/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins-dependencies
+.pub-cache/
+.pub/
+/build/
+/coverage/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/creche_app/.metadata b/creche_app/.metadata
new file mode 100644
index 0000000..26d3e69
--- /dev/null
+++ b/creche_app/.metadata
@@ -0,0 +1,45 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: "67323de285b00232883f53b84095eb72be97d35c"
+ channel: "stable"
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: android
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: ios
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: linux
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: macos
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: web
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+ - platform: windows
+ create_revision: 67323de285b00232883f53b84095eb72be97d35c
+ base_revision: 67323de285b00232883f53b84095eb72be97d35c
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/creche_app/.vscode/settings.json b/creche_app/.vscode/settings.json
new file mode 100644
index 0000000..8932098
--- /dev/null
+++ b/creche_app/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "flutterTools.displayGetxContextMenu": false,
+ "flutterTools.displayMobxContextMenu": false,
+ "flutterTools.displayRiverpodContextMenu": true,
+ "flutterTools.displayModularContextMenu": false
+}
\ No newline at end of file
diff --git a/creche_app/README.md b/creche_app/README.md
new file mode 100644
index 0000000..d124c1f
--- /dev/null
+++ b/creche_app/README.md
@@ -0,0 +1,16 @@
+# creche_app
+
+A new Flutter project.
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
+
+For help getting started with Flutter development, view the
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/creche_app/analysis_options.yaml b/creche_app/analysis_options.yaml
new file mode 100644
index 0000000..0d29021
--- /dev/null
+++ b/creche_app/analysis_options.yaml
@@ -0,0 +1,28 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at https://dart.dev/lints.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/creche_app/android/.gitignore b/creche_app/android/.gitignore
new file mode 100644
index 0000000..be3943c
--- /dev/null
+++ b/creche_app/android/.gitignore
@@ -0,0 +1,14 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+.cxx/
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/to/reference-keystore
+key.properties
+**/*.keystore
+**/*.jks
diff --git a/creche_app/android/app/build.gradle.kts b/creche_app/android/app/build.gradle.kts
new file mode 100644
index 0000000..37ab22d
--- /dev/null
+++ b/creche_app/android/app/build.gradle.kts
@@ -0,0 +1,44 @@
+plugins {
+ id("com.android.application")
+ id("kotlin-android")
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id("dev.flutter.flutter-gradle-plugin")
+}
+
+android {
+ namespace = "Hilaritech.com.creche_app"
+ compileSdk = flutter.compileSdkVersion
+ ndkVersion = flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ jvmTarget = JavaVersion.VERSION_17.toString()
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId = "Hilaritech.com.creche_app"
+ // You can update the following values to match your application needs.
+ // For more information, see: https://flutter.dev/to/review-gradle-config.
+ minSdk = flutter.minSdkVersion
+ targetSdk = flutter.targetSdkVersion
+ versionCode = flutter.versionCode
+ versionName = flutter.versionName
+ }
+
+ buildTypes {
+ release {
+ // TODO: Add your own signing config for the release build.
+ // Signing with the debug keys for now, so `flutter run --release` works.
+ signingConfig = signingConfigs.getByName("debug")
+ }
+ }
+}
+
+flutter {
+ source = "../.."
+}
diff --git a/creche_app/android/app/src/debug/AndroidManifest.xml b/creche_app/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/creche_app/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/creche_app/android/app/src/main/AndroidManifest.xml b/creche_app/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c795fec
--- /dev/null
+++ b/creche_app/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/creche_app/android/app/src/main/kotlin/Hilaritech/com/creche_app/MainActivity.kt b/creche_app/android/app/src/main/kotlin/Hilaritech/com/creche_app/MainActivity.kt
new file mode 100644
index 0000000..d572f9b
--- /dev/null
+++ b/creche_app/android/app/src/main/kotlin/Hilaritech/com/creche_app/MainActivity.kt
@@ -0,0 +1,5 @@
+package Hilaritech.com.creche_app
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity : FlutterActivity()
diff --git a/creche_app/android/app/src/main/res/drawable-v21/launch_background.xml b/creche_app/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 0000000..f74085f
--- /dev/null
+++ b/creche_app/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/creche_app/android/app/src/main/res/drawable/launch_background.xml b/creche_app/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..304732f
--- /dev/null
+++ b/creche_app/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/creche_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/creche_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..db77bb4
Binary files /dev/null and b/creche_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/creche_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/creche_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..17987b7
Binary files /dev/null and b/creche_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/creche_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/creche_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..09d4391
Binary files /dev/null and b/creche_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/creche_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/creche_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..d5f1c8d
Binary files /dev/null and b/creche_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/creche_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/creche_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..4d6372e
Binary files /dev/null and b/creche_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/creche_app/android/app/src/main/res/values-night/styles.xml b/creche_app/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..06952be
--- /dev/null
+++ b/creche_app/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/creche_app/android/app/src/main/res/values/styles.xml b/creche_app/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..cb1ef88
--- /dev/null
+++ b/creche_app/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/creche_app/android/app/src/profile/AndroidManifest.xml b/creche_app/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/creche_app/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/creche_app/android/build.gradle.kts b/creche_app/android/build.gradle.kts
new file mode 100644
index 0000000..dbee657
--- /dev/null
+++ b/creche_app/android/build.gradle.kts
@@ -0,0 +1,24 @@
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+val newBuildDir: Directory =
+ rootProject.layout.buildDirectory
+ .dir("../../build")
+ .get()
+rootProject.layout.buildDirectory.value(newBuildDir)
+
+subprojects {
+ val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
+ project.layout.buildDirectory.value(newSubprojectBuildDir)
+}
+subprojects {
+ project.evaluationDependsOn(":app")
+}
+
+tasks.register("clean") {
+ delete(rootProject.layout.buildDirectory)
+}
diff --git a/creche_app/android/gradle.properties b/creche_app/android/gradle.properties
new file mode 100644
index 0000000..fbee1d8
--- /dev/null
+++ b/creche_app/android/gradle.properties
@@ -0,0 +1,2 @@
+org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+android.useAndroidX=true
diff --git a/creche_app/android/gradle/wrapper/gradle-wrapper.properties b/creche_app/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..e4ef43f
--- /dev/null
+++ b/creche_app/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
diff --git a/creche_app/android/settings.gradle.kts b/creche_app/android/settings.gradle.kts
new file mode 100644
index 0000000..ca7fe06
--- /dev/null
+++ b/creche_app/android/settings.gradle.kts
@@ -0,0 +1,26 @@
+pluginManagement {
+ val flutterSdkPath =
+ run {
+ val properties = java.util.Properties()
+ file("local.properties").inputStream().use { properties.load(it) }
+ val flutterSdkPath = properties.getProperty("flutter.sdk")
+ require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
+ flutterSdkPath
+ }
+
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
+
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
+plugins {
+ id("dev.flutter.flutter-plugin-loader") version "1.0.0"
+ id("com.android.application") version "8.11.1" apply false
+ id("org.jetbrains.kotlin.android") version "2.2.20" apply false
+}
+
+include(":app")
diff --git a/creche_app/assets/logo.png b/creche_app/assets/logo.png
new file mode 100644
index 0000000..fcc1947
Binary files /dev/null and b/creche_app/assets/logo.png differ
diff --git a/creche_app/assets/splash_animation.json b/creche_app/assets/splash_animation.json
new file mode 100644
index 0000000..73016ac
--- /dev/null
+++ b/creche_app/assets/splash_animation.json
@@ -0,0 +1 @@
+{"v":"5.5.7","fr":30,"ip":0,"op":60,"w":200,"h":200,"layers":[]}
diff --git a/creche_app/assets/waiting.json b/creche_app/assets/waiting.json
new file mode 100644
index 0000000..73016ac
--- /dev/null
+++ b/creche_app/assets/waiting.json
@@ -0,0 +1 @@
+{"v":"5.5.7","fr":30,"ip":0,"op":60,"w":200,"h":200,"layers":[]}
diff --git a/creche_app/ios/.gitignore b/creche_app/ios/.gitignore
new file mode 100644
index 0000000..7a7f987
--- /dev/null
+++ b/creche_app/ios/.gitignore
@@ -0,0 +1,34 @@
+**/dgph
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/ephemeral/
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/creche_app/ios/Flutter/AppFrameworkInfo.plist b/creche_app/ios/Flutter/AppFrameworkInfo.plist
new file mode 100644
index 0000000..1dc6cf7
--- /dev/null
+++ b/creche_app/ios/Flutter/AppFrameworkInfo.plist
@@ -0,0 +1,26 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ App
+ CFBundleIdentifier
+ io.flutter.flutter.app
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ App
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ MinimumOSVersion
+ 13.0
+
+
diff --git a/creche_app/ios/Flutter/Debug.xcconfig b/creche_app/ios/Flutter/Debug.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/creche_app/ios/Flutter/Debug.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/creche_app/ios/Flutter/Release.xcconfig b/creche_app/ios/Flutter/Release.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/creche_app/ios/Flutter/Release.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/creche_app/ios/Runner.xcodeproj/project.pbxproj b/creche_app/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..14946b3
--- /dev/null
+++ b/creche_app/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,616 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;
+ remoteInfo = Runner;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
+ 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
+ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 331C8082294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C807B294A618700263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
+ 9740EEB11CF90186004384FC /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,
+ );
+ name = Flutter;
+ sourceTree = "";
+ };
+ 97C146E51CF9000F007C117D = {
+ isa = PBXGroup;
+ children = (
+ 9740EEB11CF90186004384FC /* Flutter */,
+ 97C146F01CF9000F007C117D /* Runner */,
+ 97C146EF1CF9000F007C117D /* Products */,
+ 331C8082294A63A400263BE5 /* RunnerTests */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C8080294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 331C807D294A63A400263BE5 /* Sources */,
+ 331C807F294A63A400263BE5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 97C146E61CF9000F007C117D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1510;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C8080294A63A400263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 97C146ED1CF9000F007C117D;
+ };
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 97C146E51CF9000F007C117D;
+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 97C146ED1CF9000F007C117D /* Runner */,
+ 331C8080294A63A400263BE5 /* RunnerTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C807F294A63A400263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EC1CF9000F007C117D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
+ );
+ name = "Thin Binary";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ };
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C807D294A63A400263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 97C146ED1CF9000F007C117D /* Runner */;
+ targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C146FB1CF9000F007C117D /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C147001CF9000F007C117D /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 331C8088294A63A400263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Debug;
+ };
+ 331C8089294A63A400263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Release;
+ };
+ 331C808A294A63A400263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 97C147041CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = Hilari-tech.com.crecheApp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C8088294A63A400263BE5 /* Debug */,
+ 331C8089294A63A400263BE5 /* Release */,
+ 331C808A294A63A400263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147031CF9000F007C117D /* Debug */,
+ 97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147061CF9000F007C117D /* Debug */,
+ 97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 97C146E61CF9000F007C117D /* Project object */;
+}
diff --git a/creche_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/creche_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/creche_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/creche_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..e3773d4
--- /dev/null
+++ b/creche_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/creche_app/ios/Runner.xcworkspace/contents.xcworkspacedata b/creche_app/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..1d526a1
--- /dev/null
+++ b/creche_app/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/creche_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/creche_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/creche_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/creche_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/creche_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/creche_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/creche_app/ios/Runner/AppDelegate.swift b/creche_app/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..6266644
--- /dev/null
+++ b/creche_app/ios/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import Flutter
+import UIKit
+
+@main
+@objc class AppDelegate: FlutterAppDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ GeneratedPluginRegistrant.register(with: self)
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+}
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d36b1fa
--- /dev/null
+++ b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,122 @@
+{
+ "images" : [
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-83.5x83.5@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "filename" : "Icon-App-1024x1024@1x.png",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 0000000..dc9ada4
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 0000000..7353c41
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 0000000..6ed2d93
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 0000000..4cd7b00
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 0000000..fe73094
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 0000000..321773c
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 0000000..502f463
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 0000000..e9f5fea
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 0000000..84ac32a
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 0000000..8953cba
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 0000000..0467bf1
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 0000000..0bedcf2
--- /dev/null
+++ b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 0000000..89c2725
--- /dev/null
+++ b/creche_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
@@ -0,0 +1,5 @@
+# Launch Screen Assets
+
+You can customize the launch screen with your own desired assets by replacing the image files in this directory.
+
+You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/creche_app/ios/Runner/Base.lproj/LaunchScreen.storyboard b/creche_app/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..f2e259c
--- /dev/null
+++ b/creche_app/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/creche_app/ios/Runner/Base.lproj/Main.storyboard b/creche_app/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..f3c2851
--- /dev/null
+++ b/creche_app/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/creche_app/ios/Runner/Info.plist b/creche_app/ios/Runner/Info.plist
new file mode 100644
index 0000000..036276a
--- /dev/null
+++ b/creche_app/ios/Runner/Info.plist
@@ -0,0 +1,60 @@
+
+
+
+
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLSchemes
+
+ io.sementesfuturo.creche
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleDisplayName
+ Creche App
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ creche_app
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ CADisableMinimumFrameDurationOnPhone
+
+ UIApplicationSupportsIndirectInputEvents
+
+
+
diff --git a/creche_app/ios/Runner/Runner-Bridging-Header.h b/creche_app/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 0000000..308a2a5
--- /dev/null
+++ b/creche_app/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/creche_app/ios/RunnerTests/RunnerTests.swift b/creche_app/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..86a7c3b
--- /dev/null
+++ b/creche_app/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/creche_app/lib/core/auth_provider.dart b/creche_app/lib/core/auth_provider.dart
new file mode 100644
index 0000000..c90284d
--- /dev/null
+++ b/creche_app/lib/core/auth_provider.dart
@@ -0,0 +1,162 @@
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import 'package:flutter_secure_storage/flutter_secure_storage.dart';
+import 'package:local_auth/local_auth.dart';
+import 'package:geolocator/geolocator.dart';
+import 'package:http/http.dart' as http;
+import '/models/profile.dart';
+import '/models/daily_access_approval.dart';
+import '/models/creche_settings.dart';
+
+part 'auth_provider.g.dart';
+
+// Provider para a sessão atual
+@riverpod
+Future currentSession(CurrentSessionRef ref) {
+ return Future.value(Supabase.instance.client.auth.currentSession);
+}
+
+// Provider para o perfil do utilizador logado
+@riverpod
+Future currentProfile(CurrentProfileRef ref) async {
+ final session = await ref.watch(currentSessionProvider.future);
+ if (session == null) return null;
+ final data = await Supabase.instance.client
+ .from('profiles')
+ .select()
+ .eq('user_id', session.user.id)
+ .maybeSingle();
+ if (data == null) return null;
+ return Profile.fromMap(data);
+}
+
+@riverpod
+class AuthNotifier extends _$AuthNotifier {
+ final _storage = const FlutterSecureStorage();
+ final _localAuth = LocalAuthentication();
+
+ @override
+ Future build() async {
+ final token = await _storage.read(key: 'access_token');
+ if (token != null) {
+ try {
+ await Supabase.instance.client.auth.setSession(token);
+ ref.invalidate(currentSessionProvider);
+ ref.invalidate(currentProfileProvider);
+ } catch (_) {
+ await _storage.delete(key: 'access_token');
+ }
+ }
+ }
+
+ Future signIn(String email, String password) async {
+ final supabase = Supabase.instance.client;
+ final response = await supabase.auth.signInWithPassword(
+ email: email,
+ password: password,
+ );
+ await _storage.write(
+ key: 'access_token', value: response.session!.accessToken);
+ await _performSecurityChecks();
+ ref.invalidate(currentSessionProvider);
+ ref.invalidate(currentProfileProvider);
+ }
+
+ Future biometricSignIn() async {
+ final canAuthenticate = await _localAuth.canCheckBiometrics;
+ if (!canAuthenticate) throw Exception('Biometria não disponível');
+
+ final didAuthenticate = await _localAuth.authenticate(
+ localizedReason: 'Autentique para entrar no Diário do Candengue',
+ );
+ if (!didAuthenticate) throw Exception('Falha na autenticação biométrica');
+
+ final token = await _storage.read(key: 'access_token');
+ if (token == null) throw Exception('Sem sessão guardada. Faça login primeiro.');
+
+ await Supabase.instance.client.auth.setSession(token);
+ await _performSecurityChecks();
+ ref.invalidate(currentSessionProvider);
+ ref.invalidate(currentProfileProvider);
+ }
+
+ Future _performSecurityChecks() async {
+ final supabase = Supabase.instance.client;
+ final user = supabase.auth.currentUser;
+ if (user == null) throw Exception('Utilizador não autenticado');
+
+ // Verificar IP
+ final ipRes = await http.get(Uri.parse('https://api.ipify.org?format=text'));
+ final ip = ipRes.body.trim();
+
+ // Verificar localização
+ LocationPermission permission = await Geolocator.checkPermission();
+ if (permission == LocationPermission.denied) {
+ permission = await Geolocator.requestPermission();
+ }
+ final position = await Geolocator.getCurrentPosition(
+ desiredAccuracy: LocationAccuracy.high,
+ );
+
+ // Carregar configurações da creche
+ final settingsData =
+ await supabase.from('creche_settings').select().single();
+ final settings = CrecheSettings.fromMap(settingsData);
+
+ // Verificar IP (se lista não vazia)
+ if (settings.allowedIps.isNotEmpty && !settings.allowedIps.contains(ip)) {
+ throw Exception('Endereço IP não autorizado ($ip)');
+ }
+
+ // Verificar geofence (se coordenadas configuradas)
+ if (settings.geofenceLat != null && settings.geofenceLng != null) {
+ final distance = Geolocator.distanceBetween(
+ position.latitude,
+ position.longitude,
+ settings.geofenceLat!,
+ settings.geofenceLng!,
+ );
+ if (distance > settings.geofenceRadiusMeters) {
+ throw Exception(
+ 'Fora da área permitida da creche (${distance.toInt()}m)');
+ }
+ }
+
+ // Verificar aprovação diária para teacher/staff
+ final profileData = await supabase
+ .from('profiles')
+ .select()
+ .eq('user_id', user.id)
+ .single();
+ final profile = Profile.fromMap(profileData);
+
+ if (profile.role == 'teacher' || profile.role == 'staff') {
+ final today = DateTime.now().toIso8601String().split('T')[0];
+ final approvalData = await supabase
+ .from('daily_access_approvals')
+ .select()
+ .eq('user_id', profile.id)
+ .eq('approval_date', today)
+ .maybeSingle();
+
+ if (approvalData == null ||
+ DailyAccessApproval.fromMap(approvalData).status != 'approved') {
+ // Lança exceção especial para redirecionar para sala de espera
+ throw WaitingApprovalException();
+ }
+ }
+ }
+
+ Future signOut() async {
+ await Supabase.instance.client.auth.signOut();
+ await _storage.delete(key: 'access_token');
+ ref.invalidate(currentSessionProvider);
+ ref.invalidate(currentProfileProvider);
+ }
+}
+
+// Exceção especial para sala de espera
+class WaitingApprovalException implements Exception {
+ @override
+ String toString() => 'Acesso pendente de aprovação da Diretora';
+}
diff --git a/creche_app/lib/core/auth_provider.g.dart b/creche_app/lib/core/auth_provider.g.dart
new file mode 100644
index 0000000..48eb06b
--- /dev/null
+++ b/creche_app/lib/core/auth_provider.g.dart
@@ -0,0 +1,54 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'auth_provider.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$currentSessionHash() => r'currentSessionHash';
+
+@ProviderFor(currentSession)
+final currentSessionProvider = AutoDisposeFutureProvider.internal(
+ currentSession,
+ name: r'currentSessionProvider',
+ debugGetCreateSourceHash:
+ const bool.fromEnvironment('dart.vm.product') ? null : _$currentSessionHash,
+ dependencies: null,
+ allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+typedef CurrentSessionRef = AutoDisposeFutureProviderRef;
+
+String _$currentProfileHash() => r'currentProfileHash';
+
+@ProviderFor(currentProfile)
+final currentProfileProvider = AutoDisposeFutureProvider.internal(
+ currentProfile,
+ name: r'currentProfileProvider',
+ debugGetCreateSourceHash:
+ const bool.fromEnvironment('dart.vm.product') ? null : _$currentProfileHash,
+ dependencies: null,
+ allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+typedef CurrentProfileRef = AutoDisposeFutureProviderRef;
+
+String _$authNotifierHash() => r'authNotifierHash';
+
+@ProviderFor(AuthNotifier)
+final authNotifierProvider =
+ AutoDisposeAsyncNotifierProvider.internal(
+ AuthNotifier.new,
+ name: r'authNotifierProvider',
+ debugGetCreateSourceHash:
+ const bool.fromEnvironment('dart.vm.product') ? null : _$authNotifierHash,
+ dependencies: null,
+ allTransitiveDependencies: null,
+);
+
+typedef _$AuthNotifier = AutoDisposeAsyncNotifier;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
diff --git a/creche_app/lib/core/routes.dart b/creche_app/lib/core/routes.dart
new file mode 100644
index 0000000..a7407c9
--- /dev/null
+++ b/creche_app/lib/core/routes.dart
@@ -0,0 +1,104 @@
+import 'package:flutter/material.dart';
+import 'package:go_router/go_router.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import 'auth_provider.dart';
+import '../features/auth/login_screen.dart';
+import '../features/auth/waiting_approval_screen.dart';
+import '../features/splash/splash_screen.dart';
+import '../features/home/home_dashboard.dart';
+import '../features/children/children_list_screen.dart';
+import '../features/children/child_detail_screen.dart';
+import '../features/diary/new_diary_screen.dart';
+import '../features/diary/diary_history_screen.dart';
+import '../features/attendance/attendance_screen.dart';
+import '../features/payments/payments_screen.dart';
+import '../features/announcements/announcements_screen.dart';
+import '../features/chat/chat_list_screen.dart';
+import '../features/chat/chat_screen.dart';
+import '../features/profile/profile_screen.dart';
+import '../features/users/users_management_screen.dart';
+import '../features/settings/settings_screen.dart';
+import '../features/medication/medication_screen.dart';
+import '../features/menu/menu_screen.dart';
+
+const _adminRoles = ['principal', 'admin'];
+const _staffRoles = ['principal', 'admin', 'teacher', 'staff'];
+const _allRoles = ['principal', 'admin', 'teacher', 'staff', 'parent'];
+
+final goRouterProvider = Provider((ref) {
+ return GoRouter(
+ initialLocation: '/splash',
+ redirect: (context, state) {
+ final session = Supabase.instance.client.auth.currentSession;
+ final publicPaths = ['/login', '/splash', '/waiting'];
+ final isPublic = publicPaths.any((p) => state.fullPath?.startsWith(p) ?? false);
+ if (session == null && !isPublic) return '/login';
+ return null;
+ },
+ routes: [
+ GoRoute(path: '/splash', builder: (_, __) => const SplashScreen()),
+ GoRoute(path: '/login', builder: (_, __) => const LoginScreen()),
+ GoRoute(path: '/waiting', builder: (_, __) => const WaitingApprovalScreen()),
+ GoRoute(path: '/home', builder: (_, __) => const HomeDashboard()),
+ GoRoute(path: '/profile', builder: (_, __) => const ProfileScreen()),
+
+ // ── Todos (incluindo encarregados) ─────────────────────
+ GoRoute(path: '/chat', builder: (_, __) => const _Guard(roles: _allRoles, child: ChatListScreen())),
+ GoRoute(path: '/chat/:userId', builder: (_, state) => _Guard(
+ roles: _allRoles, child: ChatScreen(toUserId: state.pathParameters['userId']!))),
+ GoRoute(path: '/menu', builder: (_, __) => const _Guard(roles: _allRoles, child: MenuScreen())),
+ GoRoute(path: '/medication', builder: (_, __) => const _Guard(roles: _allRoles, child: MedicationScreen())),
+ GoRoute(path: '/announcements', builder: (_, __) => const _Guard(roles: _allRoles, child: AnnouncementsScreen())),
+
+ // ── Staff (educadoras, auxiliares, admins) ─────────────
+ GoRoute(path: '/children', builder: (_, __) => const _Guard(roles: _staffRoles, child: ChildrenListScreen())),
+ GoRoute(path: '/child/:id', builder: (_, state) => _Guard(
+ roles: _staffRoles, child: ChildDetailScreen(id: state.pathParameters['id']!))),
+ GoRoute(path: '/new-diary', builder: (_, state) => _Guard(
+ roles: _staffRoles, child: NewDiaryScreen(childId: state.uri.queryParameters['childId']))),
+ GoRoute(path: '/diary-history/:childId', builder: (_, state) => _Guard(
+ roles: _staffRoles, child: DiaryHistoryScreen(childId: state.pathParameters['childId']!))),
+ GoRoute(path: '/attendance', builder: (_, __) => const _Guard(roles: _staffRoles, child: AttendanceScreen())),
+
+ // ── Admin / Principal apenas ───────────────────────────
+ GoRoute(path: '/payments', builder: (_, __) => const _Guard(roles: _adminRoles, child: PaymentsScreen())),
+ GoRoute(path: '/users', builder: (_, __) => const _Guard(roles: _adminRoles, child: UsersManagementScreen())),
+ GoRoute(path: '/settings', builder: (_, __) => const _Guard(roles: _adminRoles, child: SettingsScreen())),
+ ],
+ );
+});
+
+class _Guard extends ConsumerWidget {
+ final List roles;
+ final Widget child;
+ const _Guard({required this.roles, required this.child});
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ final async = ref.watch(currentProfileProvider);
+ return async.when(
+ data: (profile) {
+ if (profile != null && roles.contains(profile.role)) return child;
+ return Scaffold(
+ backgroundColor: const Color(0xFF0D1117),
+ body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
+ const Icon(Icons.lock_outline, color: Color(0xFFE74C3C), size: 64),
+ const SizedBox(height: 16),
+ const Text('Acesso Não Autorizado',
+ style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold)),
+ const SizedBox(height: 8),
+ Text('A tua função não tem permissão para esta área.',
+ style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 13)),
+ const SizedBox(height: 24),
+ TextButton(onPressed: () => context.go('/home'),
+ child: const Text('← Voltar ao início', style: TextStyle(color: Color(0xFF4FC3F7)))),
+ ])),
+ );
+ },
+ loading: () => const Scaffold(backgroundColor: Color(0xFF0D1117),
+ body: Center(child: CircularProgressIndicator(color: Color(0xFF4FC3F7)))),
+ error: (_, __) => const Scaffold(body: Center(child: Text('Erro'))),
+ );
+ }
+}
diff --git a/creche_app/lib/core/supabase_client.dart b/creche_app/lib/core/supabase_client.dart
new file mode 100644
index 0000000..eaf164f
--- /dev/null
+++ b/creche_app/lib/core/supabase_client.dart
@@ -0,0 +1,4 @@
+import 'package:supabase_flutter/supabase_flutter.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+
+final supabaseProvider = Provider((ref) => Supabase.instance.client);
diff --git a/creche_app/lib/features/announcements/announcements_screen.dart b/creche_app/lib/features/announcements/announcements_screen.dart
new file mode 100644
index 0000000..96ab246
--- /dev/null
+++ b/creche_app/lib/features/announcements/announcements_screen.dart
@@ -0,0 +1,309 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:intl/intl.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import '/models/announcement.dart';
+
+class AnnouncementsScreen extends ConsumerStatefulWidget {
+ const AnnouncementsScreen({super.key});
+
+ @override
+ ConsumerState createState() =>
+ _AnnouncementsScreenState();
+}
+
+class _AnnouncementsScreenState extends ConsumerState {
+ String? _filterRole;
+ final _titleController = TextEditingController();
+ final _contentController = TextEditingController();
+ String? _targetRole;
+
+ @override
+ void dispose() {
+ _titleController.dispose();
+ _contentController.dispose();
+ super.dispose();
+ }
+
+ void _showNewAnnouncementDialog() {
+ showModalBottomSheet(
+ context: context,
+ isScrollControlled: true,
+ backgroundColor: const Color(0xFF16213E),
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
+ ),
+ builder: (context) => Padding(
+ padding: EdgeInsets.only(
+ bottom: MediaQuery.of(context).viewInsets.bottom,
+ left: 20,
+ right: 20,
+ top: 20,
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Text('Novo Aviso',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 20,
+ fontWeight: FontWeight.bold)),
+ const SizedBox(height: 16),
+ TextField(
+ controller: _titleController,
+ style: const TextStyle(color: Colors.white),
+ decoration: _inputDec('Título', Icons.title),
+ ),
+ const SizedBox(height: 12),
+ TextField(
+ controller: _contentController,
+ maxLines: 4,
+ style: const TextStyle(color: Colors.white),
+ decoration: _inputDec('Conteúdo do aviso...', Icons.message),
+ ),
+ const SizedBox(height: 12),
+ DropdownButtonFormField(
+ value: _targetRole,
+ dropdownColor: const Color(0xFF16213E),
+ style: const TextStyle(color: Colors.white),
+ decoration: _inputDec('Público-alvo', Icons.group),
+ items: const [
+ DropdownMenuItem(value: null, child: Text('Todos')),
+ DropdownMenuItem(value: 'parent', child: Text('Encarregados')),
+ DropdownMenuItem(
+ value: 'teacher', child: Text('Educadoras')),
+ DropdownMenuItem(value: 'staff', child: Text('Funcionários')),
+ ],
+ onChanged: (v) => setState(() => _targetRole = v),
+ ),
+ const SizedBox(height: 20),
+ ElevatedButton(
+ onPressed: _saveAnnouncement,
+ style: ElevatedButton.styleFrom(
+ backgroundColor: const Color(0xFF4FC3F7),
+ minimumSize: const Size(double.infinity, 48),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12)),
+ ),
+ child: const Text('Publicar Aviso',
+ style: TextStyle(color: Colors.white)),
+ ),
+ const SizedBox(height: 20),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Future _saveAnnouncement() async {
+ if (_titleController.text.trim().isEmpty) return;
+ final supabase = Supabase.instance.client;
+ await supabase.from('announcements').insert({
+ 'title': _titleController.text.trim(),
+ 'content': _contentController.text.trim(),
+ 'target_role': _targetRole,
+ });
+ _titleController.clear();
+ _contentController.clear();
+ if (mounted) Navigator.pop(context);
+ }
+
+ InputDecoration _inputDec(String hint, IconData icon) {
+ return InputDecoration(
+ hintText: hint,
+ hintStyle: const TextStyle(color: Color(0xFF888888)),
+ prefixIcon: Icon(icon, color: const Color(0xFF4FC3F7)),
+ filled: true,
+ fillColor: const Color(0xFF1A1A2E),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(10),
+ borderSide: const BorderSide(color: Color(0xFF333366)),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(10),
+ borderSide: const BorderSide(color: Color(0xFF4FC3F7), width: 2),
+ ),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final supabase = Supabase.instance.client;
+
+ return Scaffold(
+ backgroundColor: const Color(0xFF1A1A2E),
+ appBar: AppBar(
+ backgroundColor: const Color(0xFF16213E),
+ title:
+ const Text('Avisos', style: TextStyle(color: Color(0xFF4FC3F7))),
+ ),
+ body: Column(
+ children: [
+ // Filtro tabs
+ Container(
+ color: const Color(0xFF16213E),
+ padding:
+ const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ child: SingleChildScrollView(
+ scrollDirection: Axis.horizontal,
+ child: Row(
+ children: [
+ _FilterChip(
+ label: 'Todos',
+ selected: _filterRole == null,
+ onTap: () => setState(() => _filterRole = null)),
+ const SizedBox(width: 8),
+ _FilterChip(
+ label: 'Encarregados',
+ selected: _filterRole == 'parent',
+ onTap: () =>
+ setState(() => _filterRole = 'parent')),
+ const SizedBox(width: 8),
+ _FilterChip(
+ label: 'Funcionários',
+ selected: _filterRole == 'teacher',
+ onTap: () =>
+ setState(() => _filterRole = 'teacher')),
+ ],
+ ),
+ ),
+ ),
+
+ // Lista
+ Expanded(
+ child: StreamBuilder>>(
+ stream:
+ supabase.from('announcements').stream(primaryKey: ['id']),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return const Center(
+ child: CircularProgressIndicator(
+ color: Color(0xFF4FC3F7)));
+ }
+
+ var list = snapshot.data!
+ .map(Announcement.fromMap)
+ .toList()
+ ..sort((a, b) => b.createdAt.compareTo(a.createdAt));
+
+ if (_filterRole != null) {
+ list = list
+ .where((a) =>
+ a.targetRole == null ||
+ a.targetRole == _filterRole)
+ .toList();
+ }
+
+ if (list.isEmpty) {
+ return const Center(
+ child: Text('Sem avisos',
+ style: TextStyle(color: Color(0xFF888888))));
+ }
+
+ return ListView.builder(
+ padding: const EdgeInsets.all(16),
+ itemCount: list.length,
+ itemBuilder: (context, i) {
+ final ann = list[i];
+ return Container(
+ margin: const EdgeInsets.only(bottom: 12),
+ padding: const EdgeInsets.all(16),
+ decoration: BoxDecoration(
+ color: const Color(0xFF16213E),
+ borderRadius: BorderRadius.circular(14),
+ border:
+ Border.all(color: const Color(0xFF333366)),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: Text(ann.title,
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ fontSize: 15)),
+ ),
+ if (ann.targetRole != null)
+ Container(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 8, vertical: 3),
+ decoration: BoxDecoration(
+ color: const Color(0xFF4FC3F7)
+ .withOpacity(0.15),
+ borderRadius:
+ BorderRadius.circular(20),
+ ),
+ child: Text(ann.targetRole!,
+ style: const TextStyle(
+ color: Color(0xFF4FC3F7),
+ fontSize: 11)),
+ ),
+ ],
+ ),
+ const SizedBox(height: 8),
+ Text(ann.content,
+ style: const TextStyle(
+ color: Color(0xFF888888),
+ fontSize: 13)),
+ const SizedBox(height: 8),
+ Text(
+ DateFormat('d MMM yyyy, HH:mm', 'pt_PT')
+ .format(ann.createdAt),
+ style: const TextStyle(
+ color: Color(0xFF555577), fontSize: 11),
+ ),
+ ],
+ ),
+ );
+ },
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ floatingActionButton: FloatingActionButton.extended(
+ backgroundColor: const Color(0xFF4FC3F7),
+ icon: const Icon(Icons.add, color: Colors.white),
+ label: const Text('Novo Aviso',
+ style: TextStyle(color: Colors.white)),
+ onPressed: _showNewAnnouncementDialog,
+ ),
+ );
+ }
+}
+
+class _FilterChip extends StatelessWidget {
+ final String label;
+ final bool selected;
+ final VoidCallback onTap;
+ const _FilterChip(
+ {required this.label,
+ required this.selected,
+ required this.onTap});
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: onTap,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
+ decoration: BoxDecoration(
+ color: selected
+ ? const Color(0xFF4FC3F7)
+ : const Color(0xFF333366),
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Text(label,
+ style: TextStyle(
+ color: selected ? Colors.white : const Color(0xFF888888),
+ fontSize: 13,
+ fontWeight: selected ? FontWeight.bold : FontWeight.normal)),
+ ),
+ );
+ }
+}
diff --git a/creche_app/lib/features/attendance/attendance_screen.dart b/creche_app/lib/features/attendance/attendance_screen.dart
new file mode 100644
index 0000000..c77a0a8
--- /dev/null
+++ b/creche_app/lib/features/attendance/attendance_screen.dart
@@ -0,0 +1,243 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:intl/intl.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import '/core/supabase_client.dart';
+import '/models/child.dart';
+
+class AttendanceScreen extends ConsumerStatefulWidget {
+ const AttendanceScreen({super.key});
+
+ @override
+ ConsumerState createState() => _AttendanceScreenState();
+}
+
+class _AttendanceScreenState extends ConsumerState {
+ DateTime _selectedDate = DateTime.now();
+ final Map _presence = {};
+ final Map _timeIn = {};
+ bool _isSaving = false;
+
+ Future _pickDate() async {
+ final picked = await showDatePicker(
+ context: context,
+ initialDate: _selectedDate,
+ firstDate: DateTime(2024),
+ lastDate: DateTime.now(),
+ builder: (c, child) => Theme(
+ data: ThemeData.dark()
+ .copyWith(colorScheme: const ColorScheme.dark(primary: Color(0xFF4FC3F7))),
+ child: child!,
+ ),
+ );
+ if (picked != null) setState(() => _selectedDate = picked);
+ }
+
+ Future _markAllPresent(List children) async {
+ setState(() {
+ for (final c in children) {
+ _presence[c.id] = true;
+ }
+ });
+ }
+
+ Future _saveAttendance(List children) async {
+ setState(() => _isSaving = true);
+ final supabase = ref.read(supabaseProvider);
+ final today = _selectedDate.toIso8601String().split('T')[0];
+ try {
+ for (final child in children) {
+ final isPresent = _presence[child.id] ?? false;
+ await supabase.from('attendance').upsert({
+ 'child_id': child.id,
+ 'date': today,
+ 'status': isPresent ? 'present' : 'absent',
+ 'time_in': _timeIn[child.id],
+ });
+ }
+ if (mounted) {
+ ScaffoldMessenger.of(context).showSnackBar(
+ const SnackBar(
+ content: Text('Presença guardada com sucesso!'),
+ backgroundColor: Color(0xFFA5D6A7),
+ ),
+ );
+ }
+ } catch (e) {
+ if (mounted) {
+ ScaffoldMessenger.of(context).showSnackBar(
+ SnackBar(content: Text('Erro: $e'), backgroundColor: Colors.red));
+ }
+ } finally {
+ if (mounted) setState(() => _isSaving = false);
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final supabase = ref.read(supabaseProvider);
+
+ return Scaffold(
+ backgroundColor: const Color(0xFF1A1A2E),
+ appBar: AppBar(
+ backgroundColor: const Color(0xFF16213E),
+ title: const Text('Presença',
+ style: TextStyle(color: Color(0xFF4FC3F7))),
+ ),
+ body: Column(
+ children: [
+ // Header: data + filtro
+ Container(
+ padding: const EdgeInsets.all(16),
+ color: const Color(0xFF16213E),
+ child: Row(
+ children: [
+ const Icon(Icons.calendar_today, color: Color(0xFF4FC3F7)),
+ const SizedBox(width: 10),
+ Text(
+ DateFormat('d MMMM yyyy', 'pt_PT').format(_selectedDate),
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ fontSize: 15),
+ ),
+ const Spacer(),
+ TextButton(
+ onPressed: _pickDate,
+ child: const Text('Alterar',
+ style: TextStyle(color: Color(0xFF4FC3F7))),
+ ),
+ ],
+ ),
+ ),
+
+ // Lista de crianças
+ Expanded(
+ child: StreamBuilder>>(
+ stream: supabase.from('children').stream(primaryKey: ['id']),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return const Center(
+ child: CircularProgressIndicator(
+ color: Color(0xFF4FC3F7)));
+ }
+ final children = snapshot.data!.map(Child.fromMap).toList();
+
+ return Column(
+ children: [
+ // Botão marcar todos
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16, vertical: 8),
+ child: ElevatedButton.icon(
+ icon: const Icon(Icons.check_circle_outline,
+ color: Colors.white),
+ label: const Text('Marcar Todos Presentes',
+ style: TextStyle(color: Colors.white)),
+ style: ElevatedButton.styleFrom(
+ backgroundColor: const Color(0xFFA5D6A7),
+ minimumSize: const Size(double.infinity, 46),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12)),
+ ),
+ onPressed: () => _markAllPresent(children),
+ ),
+ ),
+ Expanded(
+ child: ListView.builder(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ itemCount: children.length,
+ itemBuilder: (context, i) {
+ final child = children[i];
+ final isPresent = _presence[child.id] ?? false;
+ return Container(
+ margin: const EdgeInsets.only(bottom: 8),
+ padding: const EdgeInsets.symmetric(
+ horizontal: 14, vertical: 10),
+ decoration: BoxDecoration(
+ color: const Color(0xFF16213E),
+ borderRadius: BorderRadius.circular(14),
+ border: Border.all(
+ color: isPresent
+ ? const Color(0xFFA5D6A7).withOpacity(0.5)
+ : const Color(0xFF333366),
+ ),
+ ),
+ child: Row(
+ children: [
+ CircleAvatar(
+ radius: 20,
+ backgroundImage: child.photoUrl != null
+ ? NetworkImage(child.photoUrl!)
+ : null,
+ backgroundColor:
+ const Color(0xFF4FC3F7).withOpacity(0.2),
+ child: child.photoUrl == null
+ ? const Icon(Icons.child_care,
+ color: Color(0xFF4FC3F7), size: 20)
+ : null,
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ Text(child.fullName,
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold)),
+ Text(child.classId,
+ style: const TextStyle(
+ color: Color(0xFF888888),
+ fontSize: 12)),
+ ],
+ ),
+ ),
+ Switch(
+ value: isPresent,
+ activeColor: const Color(0xFFA5D6A7),
+ onChanged: (v) => setState(
+ () => _presence[child.id] = v),
+ ),
+ ],
+ ),
+ );
+ },
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.all(16),
+ child: ElevatedButton.icon(
+ icon: _isSaving
+ ? const SizedBox(
+ height: 18,
+ width: 18,
+ child: CircularProgressIndicator(
+ color: Colors.white, strokeWidth: 2))
+ : const Icon(Icons.save, color: Colors.white),
+ label: Text(
+ _isSaving ? 'A guardar...' : 'Guardar Presenças',
+ style: const TextStyle(color: Colors.white),
+ ),
+ style: ElevatedButton.styleFrom(
+ backgroundColor: const Color(0xFF4FC3F7),
+ minimumSize: const Size(double.infinity, 50),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12)),
+ ),
+ onPressed: _isSaving
+ ? null
+ : () => _saveAttendance(children),
+ ),
+ ),
+ ],
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/creche_app/lib/features/auth/invite_pending_screen.dart b/creche_app/lib/features/auth/invite_pending_screen.dart
new file mode 100644
index 0000000..9f7e153
--- /dev/null
+++ b/creche_app/lib/features/auth/invite_pending_screen.dart
@@ -0,0 +1,309 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:go_router/go_router.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import '/core/auth_provider.dart';
+import '/models/invite.dart';
+
+// ─── Cores ───────────────────────────────────────────────
+const _bg = Color(0xFF0D1117);
+const _card = Color(0xFF161B22);
+const _blue = Color(0xFF4FC3F7);
+
+String _roleLabel(String r) {
+ switch (r) {
+ case 'teacher': return 'Educadora';
+ case 'staff': return 'Auxiliar';
+ case 'admin': return 'Administrador';
+ case 'parent': return 'Encarregado de Educação';
+ default: return r;
+ }
+}
+
+String _roleDesc(String r) {
+ switch (r) {
+ case 'teacher': return 'Gerir turmas, registar presenças, escrever diários diários das crianças.';
+ case 'staff': return 'Acesso operacional à app da creche com funcionalidades essenciais.';
+ case 'admin': return 'Gestão de pagamentos, relatórios e utilizadores do sistema.';
+ case 'parent': return 'Consultar o diário do seu filho, ver presenças e comunicar com a equipa.';
+ default: return '';
+ }
+}
+
+IconData _roleIcon(String r) {
+ switch (r) {
+ case 'teacher': return Icons.school_outlined;
+ case 'staff': return Icons.cleaning_services_outlined;
+ case 'admin': return Icons.admin_panel_settings_outlined;
+ case 'parent': return Icons.family_restroom;
+ default: return Icons.person_outline;
+ }
+}
+
+Color _roleColor(String r) {
+ switch (r) {
+ case 'teacher': return _blue;
+ case 'staff': return const Color(0xFFA5D6A7);
+ case 'admin': return const Color(0xFFFF7043);
+ case 'parent': return const Color(0xFFFFB300);
+ default: return Colors.grey;
+ }
+}
+
+/// Verificar convites pendentes quando o utilizador entra pela primeira vez
+class InvitePendingScreen extends ConsumerStatefulWidget {
+ final Invite invite;
+ const InvitePendingScreen({super.key, required this.invite});
+ @override
+ ConsumerState createState() => _State();
+}
+
+class _State extends ConsumerState with SingleTickerProviderStateMixin {
+ late AnimationController _anim;
+ late Animation _fade;
+ late Animation _slide;
+ bool _accepting = false;
+ bool _rejecting = false;
+
+ @override
+ void initState() {
+ super.initState();
+ _anim = AnimationController(vsync: this, duration: const Duration(milliseconds: 700));
+ _fade = CurvedAnimation(parent: _anim, curve: Curves.easeOut);
+ _slide = Tween(begin: const Offset(0, 0.06), end: Offset.zero)
+ .animate(CurvedAnimation(parent: _anim, curve: Curves.easeOut));
+ _anim.forward();
+ }
+
+ @override
+ void dispose() { _anim.dispose(); super.dispose(); }
+
+ Future _accept() async {
+ setState(() => _accepting = true);
+ final supabase = Supabase.instance.client;
+ final user = supabase.auth.currentUser!;
+
+ try {
+ // 1 ─ Actualizar o convite: accepted + expirar imediatamente
+ await supabase.from('invites').update({
+ 'status': 'accepted',
+ 'accepted_at': DateTime.now().toIso8601String(),
+ 'expires_at': DateTime.now().toIso8601String(), // expirar agora → nunca mais aparece
+ }).eq('id', widget.invite.id);
+
+ // 2 ─ Verificar se já tem perfil
+ final existing = await supabase.from('profiles').select().eq('user_id', user.id).maybeSingle();
+
+ if (existing == null) {
+ // 3a ─ Criar o perfil com a função do convite
+ await supabase.from('profiles').insert({
+ 'user_id': user.id,
+ 'full_name': user.email?.split('@').first ?? 'Utilizador',
+ 'role': widget.invite.role,
+ 'phone': widget.invite.phone,
+ });
+ } else {
+ // 3b ─ Actualizar role do perfil existente
+ await supabase.from('profiles').update({'role': widget.invite.role}).eq('user_id', user.id);
+ }
+
+ // 4 ─ Se for encarregado e tiver criança, criar ligação
+ if (widget.invite.role == 'parent' && widget.invite.childId != null) {
+ await supabase.from('child_guardians').upsert({
+ 'child_id': widget.invite.childId,
+ 'guardian_id': (await supabase.from('profiles').select('id').eq('user_id', user.id).single())['id'],
+ 'relationship': 'parent',
+ });
+ }
+
+ // 5 ─ Invalidar o provider e navegar
+ ref.invalidate(currentProfileProvider);
+ ref.invalidate(currentSessionProvider);
+
+ if (mounted) {
+ _showSnack('Bem-vindo à equipa! 🎉', success: true);
+ await Future.delayed(const Duration(milliseconds: 800));
+ if (mounted) context.go('/home');
+ }
+ } catch (e) {
+ setState(() => _accepting = false);
+ _showSnack('Erro ao aceitar convite: $e');
+ }
+ }
+
+ Future _reject() async {
+ setState(() => _rejecting = true);
+ try {
+ await Supabase.instance.client.from('invites').update({
+ 'status': 'rejected',
+ 'expires_at': DateTime.now().toIso8601String(), // expirar agora
+ }).eq('id', widget.invite.id);
+ await ref.read(authNotifierProvider.notifier).signOut();
+ if (mounted) context.go('/login');
+ } catch (_) {
+ setState(() => _rejecting = false);
+ }
+ }
+
+ void _showSnack(String msg, {bool success = false}) {
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(
+ content: Text(msg, style: const TextStyle(color: Colors.white)),
+ backgroundColor: success ? const Color(0xFF2ECC71) : Colors.red,
+ behavior: SnackBarBehavior.floating,
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
+ ));
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final inv = widget.invite;
+ final color = _roleColor(inv.role);
+
+ return Scaffold(
+ backgroundColor: _bg,
+ body: SafeArea(
+ child: FadeTransition(
+ opacity: _fade,
+ child: SlideTransition(
+ position: _slide,
+ child: SingleChildScrollView(
+ padding: const EdgeInsets.all(24),
+ child: Column(children: [
+ const SizedBox(height: 32),
+ // Logo / header
+ Container(
+ width: 80, height: 80,
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ gradient: RadialGradient(colors: [color.withOpacity(0.2), Colors.transparent]),
+ border: Border.all(color: color.withOpacity(0.4), width: 2),
+ ),
+ child: Icon(_roleIcon(inv.role), color: color, size: 36),
+ ),
+ const SizedBox(height: 20),
+ const Text('Convite Recebido 🎉',
+ style: TextStyle(color: Colors.white, fontSize: 24, fontWeight: FontWeight.bold)),
+ const SizedBox(height: 8),
+ Text('A Diretora convidou-te para a equipa',
+ style: TextStyle(color: Colors.white.withOpacity(0.45), fontSize: 14)),
+ const SizedBox(height: 32),
+
+ // Card do convite
+ Container(
+ width: double.infinity,
+ padding: const EdgeInsets.all(20),
+ decoration: BoxDecoration(
+ color: _card,
+ borderRadius: BorderRadius.circular(20),
+ border: Border.all(color: color.withOpacity(0.3), width: 1.5),
+ boxShadow: [BoxShadow(color: color.withOpacity(0.1), blurRadius: 30, offset: const Offset(0, 8))],
+ ),
+ child: Column(children: [
+ // Role badge
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ decoration: BoxDecoration(
+ color: color.withOpacity(0.12),
+ borderRadius: BorderRadius.circular(30),
+ border: Border.all(color: color.withOpacity(0.3)),
+ ),
+ child: Row(mainAxisSize: MainAxisSize.min, children: [
+ Icon(_roleIcon(inv.role), color: color, size: 16),
+ const SizedBox(width: 8),
+ Text(_roleLabel(inv.role),
+ style: TextStyle(color: color, fontWeight: FontWeight.bold, fontSize: 14, letterSpacing: 0.5)),
+ ]),
+ ),
+ const SizedBox(height: 20),
+ Text(_roleDesc(inv.role),
+ textAlign: TextAlign.center,
+ style: TextStyle(color: Colors.white.withOpacity(0.6), fontSize: 14, height: 1.6)),
+ const SizedBox(height: 20),
+ const Divider(color: Color(0xFF222244)),
+ const SizedBox(height: 16),
+ // Detalhes
+ _DetailRow(icon: Icons.mail_outline, label: 'Email', value: inv.email),
+ if (inv.phone != null) ...[
+ const SizedBox(height: 8),
+ _DetailRow(icon: Icons.phone_outlined, label: 'Telefone', value: inv.phone!),
+ ],
+ const SizedBox(height: 8),
+ _DetailRow(
+ icon: Icons.timer_outlined,
+ label: 'Expira em',
+ value: '${inv.expiresAt.difference(DateTime.now()).inDays} dias',
+ ),
+ ]),
+ ),
+ const SizedBox(height: 28),
+
+ // Botões
+ _GradientBtn(
+ label: 'Aceitar e Entrar na Equipa',
+ color: color,
+ isLoading: _accepting,
+ icon: Icons.check_circle_outline,
+ onTap: _accept,
+ ),
+ const SizedBox(height: 12),
+ GestureDetector(
+ onTap: _rejecting ? null : _reject,
+ child: Container(
+ height: 50, width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(14),
+ border: Border.all(color: Colors.red.withOpacity(0.4)),
+ ),
+ child: Center(child: _rejecting
+ ? const SizedBox(height: 18, width: 18, child: CircularProgressIndicator(color: Colors.red, strokeWidth: 2))
+ : const Text('Recusar convite', style: TextStyle(color: Colors.red, fontSize: 14))),
+ ),
+ ),
+ const SizedBox(height: 32),
+ ]),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+class _DetailRow extends StatelessWidget {
+ final IconData icon; final String label, value;
+ const _DetailRow({required this.icon, required this.label, required this.value});
+ @override
+ Widget build(BuildContext context) => Row(children: [
+ Icon(icon, size: 16, color: const Color(0xFF888888)),
+ const SizedBox(width: 8),
+ Text('$label: ', style: const TextStyle(color: Color(0xFF888888), fontSize: 12)),
+ Expanded(child: Text(value, style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
+ overflow: TextOverflow.ellipsis)),
+ ]);
+}
+
+class _GradientBtn extends StatelessWidget {
+ final String label; final Color color; final bool isLoading;
+ final IconData icon; final VoidCallback onTap;
+ const _GradientBtn({required this.label, required this.color, required this.isLoading, required this.icon, required this.onTap});
+ @override
+ Widget build(BuildContext context) => GestureDetector(
+ onTap: isLoading ? null : onTap,
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ height: 54, width: double.infinity,
+ decoration: BoxDecoration(
+ gradient: LinearGradient(colors: isLoading ? [color.withOpacity(0.4), color.withOpacity(0.4)] : [color, color.withOpacity(0.7)]),
+ borderRadius: BorderRadius.circular(14),
+ boxShadow: isLoading ? [] : [BoxShadow(color: color.withOpacity(0.3), blurRadius: 20, offset: const Offset(0, 6))],
+ ),
+ child: Center(child: isLoading
+ ? const SizedBox(height: 22, width: 22, child: CircularProgressIndicator(color: Colors.white, strokeWidth: 2.5))
+ : Row(mainAxisAlignment: MainAxisAlignment.center, children: [
+ Icon(icon, color: Colors.white, size: 20),
+ const SizedBox(width: 10),
+ Text(label, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15)),
+ ])),
+ ),
+ );
+}
diff --git a/creche_app/lib/features/auth/login_screen.dart b/creche_app/lib/features/auth/login_screen.dart
new file mode 100644
index 0000000..c109ad3
--- /dev/null
+++ b/creche_app/lib/features/auth/login_screen.dart
@@ -0,0 +1,449 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/foundation.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:go_router/go_router.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import '/core/auth_provider.dart';
+
+class LoginScreen extends ConsumerStatefulWidget {
+ const LoginScreen({super.key});
+ @override
+ ConsumerState createState() => _LoginScreenState();
+}
+
+class _LoginScreenState extends ConsumerState
+ with SingleTickerProviderStateMixin {
+ final _emailCtrl = TextEditingController();
+ final _passCtrl = TextEditingController();
+ final _nameCtrl = TextEditingController(); // só no registo
+ bool _isRegister = false; // toggle login/registo
+ bool _obscure = true;
+ bool _loading = false;
+ bool _biometricLoading = false;
+ String? _error;
+ late AnimationController _animCtrl;
+ late Animation _fadeAnim;
+ late Animation _slideAnim;
+
+ @override
+ void initState() {
+ super.initState();
+ _animCtrl = AnimationController(vsync: this, duration: const Duration(milliseconds: 700));
+ _fadeAnim = CurvedAnimation(parent: _animCtrl, curve: Curves.easeOut);
+ _slideAnim = Tween(begin: const Offset(0, 0.07), end: Offset.zero)
+ .animate(CurvedAnimation(parent: _animCtrl, curve: Curves.easeOut));
+ _animCtrl.forward();
+ }
+
+ @override
+ void dispose() {
+ _animCtrl.dispose();
+ _emailCtrl.dispose();
+ _passCtrl.dispose();
+ _nameCtrl.dispose();
+ super.dispose();
+ }
+
+ // ── toggle entre Login e Registo ─────────────────────────────
+ void _toggleMode() {
+ setState(() { _isRegister = !_isRegister; _error = null; });
+ _animCtrl.forward(from: 0);
+ }
+
+ // ── Login ─────────────────────────────────────────────────────
+ Future _signIn() async {
+ if (_emailCtrl.text.trim().isEmpty || _passCtrl.text.isEmpty) {
+ setState(() => _error = 'Preencha o email e a senha.');
+ return;
+ }
+ setState(() { _loading = true; _error = null; });
+ try {
+ await ref.read(authNotifierProvider.notifier).signIn(
+ _emailCtrl.text.trim(), _passCtrl.text,
+ );
+ if (mounted) context.go('/home');
+ } on WaitingApprovalException {
+ if (mounted) context.go('/waiting');
+ } catch (e) {
+ setState(() => _error = _friendly(e.toString()));
+ } finally {
+ if (mounted) setState(() => _loading = false);
+ }
+ }
+
+ // ── Registo ───────────────────────────────────────────────────
+ Future _signUp() async {
+ final email = _emailCtrl.text.trim();
+ final name = _nameCtrl.text.trim();
+ final pass = _passCtrl.text;
+
+ if (email.isEmpty || pass.isEmpty || name.isEmpty) {
+ setState(() => _error = 'Preencha todos os campos.');
+ return;
+ }
+ if (pass.length < 6) {
+ setState(() => _error = 'A senha deve ter pelo menos 6 caracteres.');
+ return;
+ }
+
+ setState(() { _loading = true; _error = null; });
+ try {
+ final sb = Supabase.instance.client;
+
+ // 1. Criar conta no Supabase Auth
+ final res = await sb.auth.signUp(email: email, password: pass);
+ final user = res.user;
+ if (user == null) throw Exception('Erro ao criar conta.');
+
+ // 2. Criar perfil (sem role — será atribuído pelo convite)
+ await sb.from('profiles').upsert({
+ 'user_id': user.id,
+ 'full_name': name,
+ 'role': 'parent', // role temporário; convite vai actualizar
+ });
+
+ // 3. Ir para o splash — ele detecta convites pendentes automaticamente
+ if (mounted) {
+ _showSnack('Conta criada! A verificar convites...', ok: true);
+ await Future.delayed(const Duration(milliseconds: 800));
+ if (mounted) context.go('/splash');
+ }
+ } catch (e) {
+ setState(() => _error = _friendly(e.toString()));
+ } finally {
+ if (mounted) setState(() => _loading = false);
+ }
+ }
+
+ // ── Recuperar senha ───────────────────────────────────────────
+ Future _forgotPassword() async {
+ final email = _emailCtrl.text.trim();
+ if (email.isEmpty) {
+ setState(() => _error = 'Digite o seu email primeiro.');
+ return;
+ }
+ try {
+ await Supabase.instance.client.auth.resetPasswordForEmail(email);
+ if (mounted) _showSnack('Email de recuperação enviado para $email.', ok: true);
+ } catch (e) {
+ setState(() => _error = 'Erro ao enviar email: $e');
+ }
+ }
+
+ // ── Biometria ────────────────────────────────────────────────
+ Future _biometricSignIn() async {
+ if (kIsWeb) {
+ setState(() => _error = 'Biometria não disponível no Web.');
+ return;
+ }
+ setState(() { _biometricLoading = true; _error = null; });
+ try {
+ await ref.read(authNotifierProvider.notifier).biometricSignIn();
+ if (mounted) context.go('/home');
+ } on WaitingApprovalException {
+ if (mounted) context.go('/waiting');
+ } catch (e) {
+ setState(() => _error = _friendly(e.toString()));
+ } finally {
+ if (mounted) setState(() => _biometricLoading = false);
+ }
+ }
+
+ void _showSnack(String msg, {bool ok = false}) {
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(
+ content: Text(msg, style: const TextStyle(color: Colors.white)),
+ backgroundColor: ok ? const Color(0xFF2ECC71) : Colors.red,
+ behavior: SnackBarBehavior.floating,
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
+ duration: const Duration(seconds: 3),
+ ));
+ }
+
+ String _friendly(String e) {
+ if (e.contains('Invalid login')) return 'Email ou senha incorrectos.';
+ if (e.contains('Email not confirmed')) return 'Confirme o seu email primeiro.';
+ if (e.contains('already registered')) return 'Este email já tem conta. Faça login.';
+ if (e.contains('Password should')) return 'A senha deve ter pelo menos 6 caracteres.';
+ if (e.contains('IP')) return e;
+ return 'Erro. Tente novamente.';
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: const Color(0xFF0D1117),
+ body: Stack(children: [
+ Positioned(top: -80, right: -60, child: _Orb(size: 280, color: const Color(0xFF4FC3F7).withOpacity(0.11))),
+ Positioned(bottom: -60, left: -40, child: _Orb(size: 220, color: const Color(0xFFA5D6A7).withOpacity(0.09))),
+ SafeArea(
+ child: SingleChildScrollView(
+ padding: const EdgeInsets.symmetric(horizontal: 28),
+ child: FadeTransition(
+ opacity: _fadeAnim,
+ child: SlideTransition(
+ position: _slideAnim,
+ child: Column(children: [
+ const SizedBox(height: 44),
+
+ // ── Logo ──────────────────────────────────────
+ Container(
+ padding: const EdgeInsets.all(18),
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ gradient: RadialGradient(colors: [
+ const Color(0xFF4FC3F7).withOpacity(0.18), Colors.transparent,
+ ]),
+ border: Border.all(color: const Color(0xFF4FC3F7).withOpacity(0.25), width: 1.5),
+ ),
+ child: Image.asset('assets/logo.png', height: 80,
+ errorBuilder: (_, __, ___) => const Icon(Icons.child_care, size: 75, color: Color(0xFF4FC3F7))),
+ ),
+ const SizedBox(height: 20),
+ const Text('Creche e Berçário',
+ style: TextStyle(color: Color(0xFF4FC3F7), fontSize: 13, letterSpacing: 2.5, fontWeight: FontWeight.w500)),
+ const SizedBox(height: 3),
+ const Text('SEMENTES DO FUTURO',
+ style: TextStyle(color: Colors.white, fontSize: 21, fontWeight: FontWeight.w900, letterSpacing: 1.2)),
+ const SizedBox(height: 5),
+ Text('"Conforto, cuidado e aprendizagem"',
+ style: TextStyle(color: Colors.white.withOpacity(0.35), fontSize: 11, fontStyle: FontStyle.italic)),
+ const SizedBox(height: 36),
+
+ // ── Card principal ────────────────────────────
+ Container(
+ padding: const EdgeInsets.all(26),
+ decoration: BoxDecoration(
+ color: const Color(0xFF161B22),
+ borderRadius: BorderRadius.circular(24),
+ border: Border.all(color: Colors.white.withOpacity(0.07)),
+ boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.35), blurRadius: 40, offset: const Offset(0, 16))],
+ ),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+
+ // Título dinâmico
+ Text(
+ _isRegister ? 'Criar conta 📝' : 'Bem-vindo de volta 👋',
+ style: const TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold),
+ ),
+ const SizedBox(height: 4),
+ Text(
+ _isRegister
+ ? 'Cria a tua conta — um convite vai atribuir o teu acesso'
+ : 'Faz login para continuar',
+ style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 12),
+ ),
+ const SizedBox(height: 22),
+
+ // Erro
+ if (_error != null) ...[
+ Container(
+ padding: const EdgeInsets.all(12),
+ decoration: BoxDecoration(color: Colors.red.withOpacity(0.1),
+ borderRadius: BorderRadius.circular(10), border: Border.all(color: Colors.red.withOpacity(0.3))),
+ child: Row(children: [
+ const Icon(Icons.error_outline, color: Colors.red, size: 16),
+ const SizedBox(width: 8),
+ Expanded(child: Text(_error!, style: const TextStyle(color: Colors.red, fontSize: 12))),
+ GestureDetector(onTap: () => setState(() => _error = null),
+ child: const Icon(Icons.close, color: Colors.red, size: 14)),
+ ]),
+ ),
+ const SizedBox(height: 16),
+ ],
+
+ // Nome (só no registo)
+ if (_isRegister) ...[
+ _Field(ctrl: _nameCtrl, label: 'Nome completo', icon: Icons.person_outline),
+ const SizedBox(height: 14),
+ ],
+
+ // Email
+ _Field(ctrl: _emailCtrl, label: 'Email', icon: Icons.alternate_email, type: TextInputType.emailAddress),
+ const SizedBox(height: 14),
+
+ // Senha
+ _Field(
+ ctrl: _passCtrl, label: 'Senha', icon: Icons.lock_outline, obscure: _obscure,
+ onSubmitted: (_) => _isRegister ? _signUp() : _signIn(),
+ suffix: IconButton(
+ icon: Icon(_obscure ? Icons.visibility_off : Icons.visibility, color: Colors.white38, size: 20),
+ onPressed: () => setState(() => _obscure = !_obscure),
+ ),
+ ),
+
+ if (!_isRegister) ...[
+ const SizedBox(height: 12),
+ Align(
+ alignment: Alignment.centerRight,
+ child: GestureDetector(
+ onTap: _forgotPassword,
+ child: const Text('Esqueci a senha',
+ style: TextStyle(color: Color(0xFF4FC3F7), fontSize: 12, fontWeight: FontWeight.w500)),
+ ),
+ ),
+ ],
+
+ const SizedBox(height: 24),
+
+ // Botão principal
+ _GradButton(
+ label: _isRegister ? 'Criar Conta' : 'Entrar',
+ isLoading: _loading,
+ onTap: _isRegister ? _signUp : _signIn,
+ ),
+
+ if (!_isRegister) ...[
+ const SizedBox(height: 14),
+ Row(children: [
+ Expanded(child: Divider(color: Colors.white.withOpacity(0.09))),
+ Padding(padding: const EdgeInsets.symmetric(horizontal: 12),
+ child: Text('ou', style: TextStyle(color: Colors.white.withOpacity(0.25), fontSize: 11))),
+ Expanded(child: Divider(color: Colors.white.withOpacity(0.09))),
+ ]),
+ const SizedBox(height: 14),
+ _BiometricBtn(isLoading: _biometricLoading, onTap: _biometricSignIn),
+ ],
+ ]),
+ ),
+
+ const SizedBox(height: 22),
+
+ // ── Toggle Login / Registo ─────────────────────
+ GestureDetector(
+ onTap: _toggleMode,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
+ decoration: BoxDecoration(
+ color: const Color(0xFF161B22),
+ borderRadius: BorderRadius.circular(14),
+ border: Border.all(color: Colors.white.withOpacity(0.07)),
+ ),
+ child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
+ Text(
+ _isRegister ? 'Já tens conta? ' : 'Ainda não tens conta? ',
+ style: TextStyle(color: Colors.white.withOpacity(0.45), fontSize: 13),
+ ),
+ Text(
+ _isRegister ? 'Fazer login' : 'Criar conta',
+ style: const TextStyle(color: Color(0xFF4FC3F7), fontSize: 13, fontWeight: FontWeight.bold),
+ ),
+ ]),
+ ),
+ ),
+
+ const SizedBox(height: 20),
+ // Aviso do fluxo de convites
+ if (_isRegister) Container(
+ padding: const EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ color: const Color(0xFF4FC3F7).withOpacity(0.06),
+ borderRadius: BorderRadius.circular(12),
+ border: Border.all(color: const Color(0xFF4FC3F7).withOpacity(0.2)),
+ ),
+ child: const Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Icon(Icons.info_outline, color: Color(0xFF4FC3F7), size: 16),
+ SizedBox(width: 10),
+ Expanded(child: Text(
+ 'Após criar a conta, se tiveres um convite da Diretora, verás automaticamente o ecrã de convite para aceitar o teu acesso.',
+ style: TextStyle(color: Color(0xFF888888), fontSize: 11, height: 1.5),
+ )),
+ ]),
+ ),
+
+ const SizedBox(height: 20),
+ Text('v1.0 · Diário do Candengue',
+ style: TextStyle(color: Colors.white.withOpacity(0.15), fontSize: 10)),
+ const SizedBox(height: 24),
+ ]),
+ ),
+ ),
+ ),
+ ),
+ ]),
+ );
+ }
+}
+
+// ── Widgets auxiliares ─────────────────────────────────────────────
+
+class _Field extends StatelessWidget {
+ final TextEditingController ctrl;
+ final String label;
+ final IconData icon;
+ final bool obscure;
+ final TextInputType type;
+ final Widget? suffix;
+ final Function(String)? onSubmitted;
+ const _Field({required this.ctrl, required this.label, required this.icon,
+ this.obscure = false, this.type = TextInputType.text, this.suffix, this.onSubmitted});
+ @override
+ Widget build(BuildContext context) => TextField(
+ controller: ctrl, obscureText: obscure, keyboardType: type, onSubmitted: onSubmitted,
+ style: const TextStyle(color: Colors.white, fontSize: 14),
+ decoration: InputDecoration(
+ labelText: label,
+ labelStyle: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 13),
+ prefixIcon: Icon(icon, color: const Color(0xFF4FC3F7).withOpacity(0.7), size: 19),
+ suffixIcon: suffix,
+ filled: true, fillColor: Colors.white.withOpacity(0.05),
+ enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.white.withOpacity(0.1))),
+ focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: const BorderSide(color: Color(0xFF4FC3F7), width: 1.5)),
+ contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
+ ),
+ );
+}
+
+class _GradButton extends StatelessWidget {
+ final String label; final bool isLoading; final VoidCallback onTap;
+ const _GradButton({required this.label, required this.isLoading, required this.onTap});
+ @override
+ Widget build(BuildContext context) => GestureDetector(
+ onTap: isLoading ? null : onTap,
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200), height: 52,
+ decoration: BoxDecoration(
+ gradient: LinearGradient(colors: isLoading
+ ? [const Color(0xFF2A6A8A), const Color(0xFF2A6A8A)]
+ : [const Color(0xFF4FC3F7), const Color(0xFF0288D1)]),
+ borderRadius: BorderRadius.circular(14),
+ boxShadow: isLoading ? [] : [BoxShadow(color: const Color(0xFF4FC3F7).withOpacity(0.3), blurRadius: 18, offset: const Offset(0, 6))],
+ ),
+ child: Center(child: isLoading
+ ? const SizedBox(height: 22, width: 22, child: CircularProgressIndicator(color: Colors.white, strokeWidth: 2.5))
+ : Text(label, style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold))),
+ ),
+ );
+}
+
+class _BiometricBtn extends StatelessWidget {
+ final bool isLoading; final VoidCallback onTap;
+ const _BiometricBtn({required this.isLoading, required this.onTap});
+ @override
+ Widget build(BuildContext context) => GestureDetector(
+ onTap: isLoading ? null : onTap,
+ child: Container(
+ height: 50,
+ decoration: BoxDecoration(color: Colors.white.withOpacity(0.04), borderRadius: BorderRadius.circular(14),
+ border: Border.all(color: Colors.white.withOpacity(0.1))),
+ child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
+ isLoading
+ ? const SizedBox(height: 20, width: 20, child: CircularProgressIndicator(color: Color(0xFF4FC3F7), strokeWidth: 2))
+ : const Icon(Icons.fingerprint, color: Color(0xFF4FC3F7), size: 22),
+ const SizedBox(width: 10),
+ Text(kIsWeb ? 'Biometria (só mobile)' : 'Entrar com biometria',
+ style: TextStyle(color: kIsWeb ? Colors.white24 : Colors.white60, fontSize: 13)),
+ ]),
+ ),
+ );
+}
+
+class _Orb extends StatelessWidget {
+ final double size; final Color color;
+ const _Orb({required this.size, required this.color});
+ @override
+ Widget build(BuildContext context) => Container(
+ width: size, height: size,
+ decoration: BoxDecoration(shape: BoxShape.circle, color: color,
+ boxShadow: [BoxShadow(color: color, blurRadius: size / 2)]),
+ );
+}
diff --git a/creche_app/lib/features/auth/waiting_approval_screen.dart b/creche_app/lib/features/auth/waiting_approval_screen.dart
new file mode 100644
index 0000000..96e32d4
--- /dev/null
+++ b/creche_app/lib/features/auth/waiting_approval_screen.dart
@@ -0,0 +1,167 @@
+import 'package:flutter/material.dart';
+import 'package:lottie/lottie.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import 'package:go_router/go_router.dart';
+import '/core/auth_provider.dart';
+import '/models/daily_access_approval.dart';
+
+class WaitingApprovalScreen extends ConsumerStatefulWidget {
+ const WaitingApprovalScreen({super.key});
+ @override
+ ConsumerState createState() => _State();
+}
+
+class _State extends ConsumerState {
+ String? _profileId;
+ bool _requesting = false;
+
+ @override
+ void initState() {
+ super.initState();
+ _loadProfileAndRequest();
+ }
+
+ Future _loadProfileAndRequest() async {
+ final sb = Supabase.instance.client;
+ final uid = sb.auth.currentUser?.id;
+ if (uid == null) return;
+
+ // Buscar profiles.id (NÃO auth.uid!)
+ final profile = await sb.from('profiles').select('id').eq('user_id', uid).maybeSingle();
+ if (profile == null || !mounted) return;
+
+ final profileId = profile['id'] as String;
+ setState(() => _profileId = profileId);
+
+ // Criar pedido de aprovação se não existir hoje
+ final today = DateTime.now().toIso8601String().split('T')[0];
+ final existing = await sb.from('daily_access_approvals')
+ .select().eq('user_id', profileId).eq('approval_date', today).maybeSingle();
+
+ if (existing == null && mounted) {
+ setState(() => _requesting = true);
+ try {
+ await sb.from('daily_access_approvals').insert({
+ 'user_id': profileId,
+ 'approval_date': today,
+ 'status': 'pending',
+ });
+ } catch (_) {}
+ if (mounted) setState(() => _requesting = false);
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final sb = Supabase.instance.client;
+ final today = DateTime.now().toIso8601String().split('T')[0];
+
+ return Scaffold(
+ backgroundColor: const Color(0xFF0D1117),
+ body: SafeArea(
+ child: Center(
+ child: Padding(
+ padding: const EdgeInsets.all(24),
+ child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
+ Image.asset('assets/logo.png', height: 72,
+ errorBuilder: (_, __, ___) =>
+ const Icon(Icons.child_care, size: 72, color: Color(0xFF4FC3F7))),
+ const SizedBox(height: 24),
+ Lottie.asset('assets/waiting.json', height: 160,
+ errorBuilder: (_, __, ___) =>
+ const Icon(Icons.hourglass_top, size: 80, color: Color(0xFF4FC3F7))),
+ const SizedBox(height: 20),
+ const Text('Sala de Espera',
+ style: TextStyle(color: Color(0xFF4FC3F7), fontSize: 24, fontWeight: FontWeight.bold)),
+ const SizedBox(height: 8),
+ const Text('Aguardando aprovação da Diretora',
+ style: TextStyle(color: Colors.white, fontSize: 15), textAlign: TextAlign.center),
+ const SizedBox(height: 6),
+ Text('O teu acesso de hoje será aprovado em breve.',
+ style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 12),
+ textAlign: TextAlign.center),
+ const SizedBox(height: 32),
+
+ if (_requesting)
+ const CircularProgressIndicator(color: Color(0xFF4FC3F7))
+ else if (_profileId != null)
+ StreamBuilder>>(
+ stream: sb.from('daily_access_approvals')
+ .stream(primaryKey: ['id'])
+ .eq('user_id', _profileId!) // usa profiles.id CORRECTO
+ .order('created_at', ascending: false),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return const CircularProgressIndicator(color: Color(0xFF4FC3F7));
+ }
+ final todayRows = snapshot.data!
+ .where((r) => r['approval_date'] == today).toList();
+
+ if (todayRows.isEmpty) {
+ return Column(children: [
+ const CircularProgressIndicator(color: Color(0xFF4FC3F7)),
+ const SizedBox(height: 12),
+ Text('A criar pedido...', style: TextStyle(color: Colors.white.withOpacity(0.4))),
+ ]);
+ }
+
+ final approval = DailyAccessApproval.fromMap(todayRows.first);
+
+ if (approval.status == 'approved') {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) context.go('/home');
+ });
+ return const Column(children: [
+ Icon(Icons.check_circle, color: Color(0xFF2ECC71), size: 48),
+ SizedBox(height: 8),
+ Text('Aprovado! A redirecionar...', style: TextStyle(color: Color(0xFF2ECC71))),
+ ]);
+ }
+
+ if (approval.status == 'rejected') {
+ return Column(children: [
+ const Icon(Icons.block, color: Colors.red, size: 48),
+ const SizedBox(height: 8),
+ const Text('Acesso negado hoje',
+ style: TextStyle(color: Colors.red, fontSize: 17, fontWeight: FontWeight.bold)),
+ const SizedBox(height: 4),
+ Text('Contacta a Diretora para mais informações.',
+ style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 12),
+ textAlign: TextAlign.center),
+ ]);
+ }
+
+ return Row(mainAxisAlignment: MainAxisAlignment.center, children: [
+ const SizedBox(width: 20, height: 20,
+ child: CircularProgressIndicator(color: Color(0xFF4FC3F7), strokeWidth: 2)),
+ const SizedBox(width: 12),
+ Text('Pendente... aguarda',
+ style: TextStyle(color: Colors.white.withOpacity(0.5), fontSize: 13)),
+ ]);
+ },
+ )
+ else
+ const CircularProgressIndicator(color: Color(0xFF4FC3F7)),
+
+ const SizedBox(height: 36),
+ OutlinedButton.icon(
+ icon: const Icon(Icons.logout, color: Colors.red, size: 18),
+ label: const Text('Terminar Sessão', style: TextStyle(color: Colors.red)),
+ onPressed: () async {
+ await ref.read(authNotifierProvider.notifier).signOut();
+ if (context.mounted) context.go('/login');
+ },
+ style: OutlinedButton.styleFrom(
+ minimumSize: const Size(double.infinity, 46),
+ side: const BorderSide(color: Colors.red),
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
+ ),
+ ),
+ ]),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/creche_app/lib/features/chat/chat_list_screen.dart b/creche_app/lib/features/chat/chat_list_screen.dart
new file mode 100644
index 0000000..21960e1
--- /dev/null
+++ b/creche_app/lib/features/chat/chat_list_screen.dart
@@ -0,0 +1,203 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:go_router/go_router.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+import '/core/auth_provider.dart';
+import '/models/profile.dart';
+
+const _bg = Color(0xFF0D1117);
+const _card = Color(0xFF161B22);
+const _blue = Color(0xFF4FC3F7);
+
+String _roleLabel(String r) {
+ switch (r) {
+ case 'principal': return 'Diretora';
+ case 'admin': return 'Administrador';
+ case 'teacher': return 'Educadora';
+ case 'staff': return 'Auxiliar';
+ case 'parent': return 'Encarregado';
+ default: return r;
+ }
+}
+
+class ChatListScreen extends ConsumerWidget {
+ const ChatListScreen({super.key});
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ final sb = Supabase.instance.client;
+ final profileAsync = ref.watch(currentProfileProvider);
+
+ return profileAsync.when(
+ data: (myProfile) {
+ if (myProfile == null) {
+ return const Scaffold(
+ backgroundColor: _bg,
+ body: Center(child: Text('Perfil não encontrado', style: TextStyle(color: Colors.white))),
+ );
+ }
+ return Scaffold(
+ backgroundColor: _bg,
+ appBar: AppBar(
+ backgroundColor: _card,
+ title: const Text('Mensagens', style: TextStyle(color: _blue, fontWeight: FontWeight.bold)),
+ elevation: 0,
+ ),
+ body: StreamBuilder>>(
+ stream: sb.from('profiles').stream(primaryKey: ['id']),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData) {
+ return const Center(child: CircularProgressIndicator(color: _blue));
+ }
+ final profiles = snapshot.data!
+ .map(Profile.fromMap)
+ .where((p) => p.id != myProfile.id)
+ .toList()
+ ..sort((a, b) => a.fullName.compareTo(b.fullName));
+
+ if (profiles.isEmpty) {
+ return Center(child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
+ Icon(Icons.chat_bubble_outline, size: 64, color: Colors.white.withOpacity(0.07)),
+ const SizedBox(height: 12),
+ const Text('Sem utilizadores para contactar',
+ style: TextStyle(color: Color(0xFF888888))),
+ ]));
+ }
+
+ return ListView.separated(
+ padding: const EdgeInsets.symmetric(vertical: 8),
+ itemCount: profiles.length,
+ separatorBuilder: (_, __) => Divider(
+ height: 1, indent: 72,
+ color: Colors.white.withOpacity(0.05),
+ ),
+ itemBuilder: (context, i) {
+ final profile = profiles[i];
+ return _ChatTile(
+ profile: profile,
+ myProfileId: myProfile.id,
+ onTap: () => context.go('/chat/${profile.id}'),
+ );
+ },
+ );
+ },
+ ),
+ );
+ },
+ loading: () => const Scaffold(
+ backgroundColor: _bg,
+ body: Center(child: CircularProgressIndicator(color: _blue)),
+ ),
+ error: (e, _) => Scaffold(
+ backgroundColor: _bg,
+ body: Center(child: Text('Erro: $e', style: const TextStyle(color: Colors.red))),
+ ),
+ );
+ }
+}
+
+class _ChatTile extends StatelessWidget {
+ final Profile profile;
+ final String myProfileId;
+ final VoidCallback onTap;
+ const _ChatTile({required this.profile, required this.myProfileId, required this.onTap});
+
+ @override
+ Widget build(BuildContext context) {
+ final sb = Supabase.instance.client;
+ return FutureBuilder