diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml new file mode 100644 index 0000000..d9a8e36 --- /dev/null +++ b/.github/workflows/gitleaks.yaml @@ -0,0 +1,38 @@ +name: Secret Value found! +on: + push: + public: +jobs: + scan: + name: gitleaks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install the gitleaks + run: wget https://github.com/zricethezav/gitleaks/releases/download/v8.15.2/gitleaks_8.15.2_linux_x64.tar.gz + shell: pwsh + - name: Extract the tar file + run: tar xzvf gitleaks_8.15.2_linux_x64.tar.gz + - name: Generate the report + id: gitleaks + run: $GITHUB_WORKSPACE/gitleaks detect -s $GITHUB_WORKSPACE -f json -r $GITHUB_WORKSPACE/leaksreport.json + shell: bash + continue-on-error: true + - name: Setup NuGet.exe + if: steps.gitleaks.outcome != 'success' + uses: nuget/setup-nuget@v1 + with: + nuget-version: latest + - name: Install the dotnet + if: steps.gitleaks.outcome != 'success' + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '3.1.x' + - name: Install the report tool packages + if: steps.gitleaks.outcome != 'success' + run: | + nuget install "Syncfusion.Email" -source "https://nexus.syncfusion.com/repository/nuget-hosted/" + dir $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1 + dotnet $GITHUB_WORKSPACE/Syncfusion.Email.1.0.0/lib/netcoreapp3.1/Email.dll "citeam@syncfusion.com" "$GITHUB_REF_NAME" ${{ secrets.NETWORKCREDENTIALS }} ${{ secrets.NETWORKKEY }} "$GITHUB_WORKSPACE" + exit 1 \ No newline at end of file diff --git a/README.md b/README.md index 85bab2b..5621e03 100644 --- a/README.md +++ b/README.md @@ -1 +1,31 @@ -**[View document in Syncfusion Flutter Knowledge base](https://www.syncfusion.com/kb/12661/how-to-perform-the-crud-operations-in-flutter-calendar-using-firestore-database)** +# How to perform the CRUD operations in Flutter Calendar using Firestore database? + +A quick-start example to help you to perform the CRUD operations in Flutter Calendar using Firestore database. + +In the Flutter Event Calendar, you can perform CRUD operations on appointments using Firebase Firestore as the database. + +Step 1: + +Refer to the following guidelines to create a Firebase Firestore database: +https://firebase.google.com/docs/firestore/quickstart + +Also, refer to this article to add appointments to the Firestore database and display them in the Flutter calendar: +https://www.syncfusion.com/kb/12616/how-to-add-the-appointments-to-firestore-database-using-flutter-calendar + +Step 2: + +Next, fetch the data from the created Firestore and assign the events to the dataSource property of the Flutter Calendar. + +For more details, refer to our [KB](https://www.syncfusion.com/kb/12661/how-to-perform-the-crud-operations-in-flutter-calendar-using-firestore-database) documentation. + +## Requirements to run the demo +* [VS Code](https://code.visualstudio.com/download) +* [Flutter SDK v1.22+](https://flutter.dev/docs/development/tools/sdk/overview) +* [For more development tools](https://flutter.dev/docs/development/tools/devtools/overview) + +## How to run this application +To run this application, you need to first clone or download the ‘create a flutter maps widget in 10 minutes’ repository and open it in your preferred IDE. Then, build and run your project to view the output. + +## Further help +For more help, check the [Syncfusion Flutter documentation](https://help.syncfusion.com/flutter/introduction/overview), + [Flutter documentation](https://flutter.dev/docs/get-started/install). \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,29 @@ +# 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-lang.github.io/linter/lints/index.html. + # + # 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/android/.gitignore b/android/.gitignore deleted file mode 100644 index bc2100d..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java diff --git a/android/app/build.gradle b/android/app/build.gradle index e04d839..a5e8195 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,26 +22,34 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -apply plugin: 'com.google.gms.google-services' android { - compileSdkVersion 28 + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } - lintOptions { - disable 'InvalidPackage' + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.flutter_firebase_calendar" - minSdkVersion 16 - targetSdkVersion 28 + applicationId "com.example.flutterfirebasecalendar" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + minSdkVersion 19 + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true @@ -62,5 +70,6 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.firebase:firebase-analytics:17.5.0' + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.android.support:multidex:1.0.3' } diff --git a/android/app/google-services.json b/android/app/google-services.json index 3846820..62309a4 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,34 +1,33 @@ { "project_info": { - "project_number": "320188306436", - "firebase_url": "https://calendarfirebase-39afa.firebaseio.com", - "project_id": "calendarfirebase-39afa", - "storage_bucket": "calendarfirebase-39afa.appspot.com" + "project_number": "1084958066336", + "project_id": "fir-appointments-f6cce", + "storage_bucket": "fir-appointments-f6cce.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:320188306436:android:563a0b0a292248d10f5151", + "mobilesdk_app_id": "1:1084958066336:android:13c13c63b768900b4b2bc5", "android_client_info": { - "package_name": "com.example.flutter_firebase_calendar" + "package_name": "com.example.flutterfirebasecalendar" } }, "oauth_client": [ { - "client_id": "320188306436-7l44ouqogmrj9s0jgnorvf9atipdj1su.apps.googleusercontent.com", + "client_id": "1084958066336-56p0b1m8dgvp9ttgmblvd6umsm0k3347.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBzEzdqdfiYmXLqkcDaLlnw3Osb3cVNU_k" + "current_key": "AIzaSyBcNPARmEdyciHfeSKDFg3iFmOZWhuo-fk" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "320188306436-7l44ouqogmrj9s0jgnorvf9atipdj1su.apps.googleusercontent.com", + "client_id": "1084958066336-56p0b1m8dgvp9ttgmblvd6umsm0k3347.apps.googleusercontent.com", "client_type": 3 } ] diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 61478a8..f7d1137 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,7 @@ - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c9e9940..c498916 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,16 +1,12 @@ - - + - - diff --git a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 0000000..007e3f2 --- /dev/null +++ b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,29 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin cloud_firestore, io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e); + } + } +} diff --git a/android/app/src/main/kotlin/com/example/flutter_firebase_calendar/MainActivity.kt b/android/app/src/main/kotlin/com/example/flutterfirebasecalendar/MainActivity.kt similarity index 67% rename from android/app/src/main/kotlin/com/example/flutter_firebase_calendar/MainActivity.kt rename to android/app/src/main/kotlin/com/example/flutterfirebasecalendar/MainActivity.kt index 3d38fdb..fa11c60 100644 --- a/android/app/src/main/kotlin/com/example/flutter_firebase_calendar/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/flutterfirebasecalendar/MainActivity.kt @@ -1,4 +1,4 @@ -package com.example.flutter_firebase_calendar +package com.example.flutterfirebasecalendar import io.flutter.embedding.android.FlutterActivity diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 1f83a33..cb1ef88 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,18 +1,18 @@ - - - diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 61478a8..f7d1137 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,6 +1,7 @@ - diff --git a/android/build.gradle b/android/build.gradle index 4273368..99f1e0e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,21 +1,21 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.3' + classpath 'com.google.gms:google-services:4.3.13' } } allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/android/flutter_firebase_calendar_android.iml b/android/flutterfirebasecalendar_android.iml similarity index 87% rename from android/flutter_firebase_calendar_android.iml rename to android/flutterfirebasecalendar_android.iml index 068decc..3e44773 100644 --- a/android/flutter_firebase_calendar_android.iml +++ b/android/flutterfirebasecalendar_android.iml @@ -4,6 +4,8 @@