Skip to content

Commit

Permalink
Update packages to latest versions (#1872)
Browse files Browse the repository at this point in the history
* update packages

* updates packages and ignore checks

Signed-off-by: Ravi Dev Pandey <[email protected]>

* wrote documentation for `lib/firebase_options.dart`

Signed-off-by: Ravi Dev Pandey <[email protected]>

* downgrade syncfusion packages

Signed-off-by: Ravi Dev Pandey <[email protected]>

* update kotlin version

Signed-off-by: Ravi Dev Pandey <[email protected]>

---------

Signed-off-by: Ravi Dev Pandey <[email protected]>
  • Loading branch information
literalEval authored May 31, 2023
1 parent 65c488a commit 84c0b7d
Show file tree
Hide file tree
Showing 9 changed files with 308 additions and 287 deletions.
8 changes: 7 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ linter:
# ```

avoid_dynamic_calls: true


#############################################
################### REMOVE ##################
#############################################
unreachable_from_main: false
implicit_call_tearoffs: false
dangling_library_doc_comments: false
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand Down
44 changes: 34 additions & 10 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// ignore_for_file: talawa_api_doc
// ignore_for_file: talawa_good_doc_comments

// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars

import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
show TargetPlatform, defaultTargetPlatform, kIsWeb;

/// Default [FirebaseOptions] for use with your Firebase apps.
///
Expand All @@ -18,6 +15,18 @@ import 'package:flutter/foundation.dart'
/// );
/// ```
class DefaultFirebaseOptions {
/// Builds and returns [FirebaseOptions] based on the current platform.
///
/// Switches on the current platform and calls [android] or [iOS]
/// methods accordingly to build the [FirebaseOptions]. Throws
/// [UnsupportedError] if the platform is other than these two.
///
/// **params**:
/// * `androidFirebaseOptions`: Firebase Options for Android
/// * `iosFirebaseOptions`: Firebase Options for iOS
///
/// **returns**:
/// * `FirebaseOptions`: The [FirebaseOptions] built according to the platform.
static FirebaseOptions currentPlatform(
Map<String, dynamic> androidFirebaseOptions,
Map<String, dynamic> iosFirebaseOptions,
Expand All @@ -28,7 +37,6 @@ class DefaultFirebaseOptions {
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
// ignore: missing_enum_constant_in_switch
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android(androidFirebaseOptions);
Expand All @@ -39,13 +47,20 @@ class DefaultFirebaseOptions {
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}

throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}

/// Scaffolds androidFirebaseOptions around FirebaseOptions.
///
/// **params**:
/// * `androidFirebaseOptions`: The options which we want to scaffold
///
/// **returns**:
/// * `FirebaseOptions`: Scaffolded FirebaseOptions
static FirebaseOptions android(Map<String, dynamic> androidFirebaseOptions) =>
FirebaseOptions(
apiKey: androidFirebaseOptions['apiKey'] as String,
Expand All @@ -56,6 +71,15 @@ class DefaultFirebaseOptions {
storageBucket: androidFirebaseOptions['storageBucket'] as String,
);

/// Scaffolds iosFirebaseOptions around FirebaseOptions.
///
/// more_info_if_required
///
/// **params**:
/// * `iosFirebaseOptions`: The options which we want to scaffold
///
/// **returns**:
/// * `FirebaseOptions`: Scaffolded FirebaseOptions
static FirebaseOptions ios(Map<String, dynamic> iosFirebaseOptions) =>
FirebaseOptions(
apiKey: iosFirebaseOptions['apiKey'] as String,
Expand Down
Loading

0 comments on commit 84c0b7d

Please sign in to comment.