From e47fe8cabbf911f71560c7f2a33400a1e32e64b7 Mon Sep 17 00:00:00 2001 From: Muniappan Date: Thu, 29 Dec 2022 14:34:53 +0530 Subject: [PATCH 1/3] sample updated --- README.md | 17 +- analysis_options.yaml | 29 ++ android/.gitignore | 7 - android/app/build.gradle | 29 +- android/app/google-services.json | 17 +- android/app/src/debug/AndroidManifest.xml | 5 +- android/app/src/main/AndroidManifest.xml | 23 +- .../plugins/GeneratedPluginRegistrant.java | 29 ++ .../MainActivity.kt | 2 +- .../res/drawable-v21/launch_background.xml | 12 + .../app/src/main/res/values-night/styles.xml | 18 ++ android/app/src/main/res/values/styles.xml | 12 +- android/app/src/profile/AndroidManifest.xml | 5 +- android/build.gradle | 10 +- ...ml => flutterfirebasecalendar_android.iml} | 4 +- android/gradle.properties | 1 - android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes .../gradle/wrapper/gradle-wrapper.properties | 3 +- android/gradlew | 160 +++++++++++ android/gradlew.bat | 90 +++++++ android/local.properties | 5 + android/settings.gradle | 18 +- ...alendar.iml => flutterfirebasecalendar.iml | 9 +- gitignore | 78 ------ ios/.gitignore | 2 + ios/Flutter/AppFrameworkInfo.plist | 4 +- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 41 +++ ios/Runner.xcodeproj/project.pbxproj | 57 ++-- .../contents.xcworkspacedata | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 10 +- ios/Runner/Info.plist | 8 +- lib/generated_plugin_registrant.dart | 17 -- lib/main.dart | 127 ++++----- pubspec.lock | 250 ------------------ pubspec.yaml | 40 ++- test/widget_test.dart | 6 +- web/favicon.png | Bin 917 -> 0 bytes web/icons/Icon-192.png | Bin 5292 -> 0 bytes web/icons/Icon-512.png | Bin 8252 -> 0 bytes web/index.html | 33 --- web/manifest.json | 23 -- 43 files changed, 597 insertions(+), 608 deletions(-) create mode 100644 analysis_options.yaml delete mode 100644 android/.gitignore create mode 100644 android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java rename android/app/src/main/kotlin/com/example/{flutter_firebase_calendar => flutterfirebasecalendar}/MainActivity.kt (67%) create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/values-night/styles.xml rename android/{flutter_firebase_calendar_android.iml => flutterfirebasecalendar_android.iml} (87%) create mode 100644 android/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/gradlew create mode 100644 android/gradlew.bat create mode 100644 android/local.properties rename flutter_firebase_calendar.iml => flutterfirebasecalendar.iml (77%) delete mode 100644 gitignore create mode 100644 ios/Podfile delete mode 100644 lib/generated_plugin_registrant.dart delete mode 100644 pubspec.lock delete mode 100644 web/favicon.png delete mode 100644 web/icons/Icon-192.png delete mode 100644 web/icons/Icon-512.png delete mode 100644 web/index.html delete mode 100644 web/manifest.json diff --git a/README.md b/README.md index 85bab2b..70abb49 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -**[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)** +# flutterfirebasecalendar + +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/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 @@