Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Plugin Upgrade and Build Error solved #218

Merged
merged 3 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.history
.svn/
android/app/google-services.json
android/android.zip
android/google-services.json
android/app/key.jks
android/key.properties
Expand Down
Binary file added scp/android/android.zip
Binary file not shown.
7 changes: 3 additions & 4 deletions scp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ android {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
Expand All @@ -92,10 +91,10 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.0'
implementation "com.airbnb.android:lottie:3.5.0"
implementation "com.android.support.constraint:constraint-layout:2.0.4"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.crashlytics'
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import androidx.annotation.NonNull;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.android.FlutterActivity;

Expand Down
9 changes: 3 additions & 6 deletions scp/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
buildscript {
ext.kotlin_version = '1.3.41'
ext.kotlin_version = '1.3.50'
repositories {
maven {
url 'https://maven.google.com/'
}
google()
jcenter()
maven { url 'https://dl.bintray.com/android/android-tools' }
maven {
url 'https://maven.fabric.io/public'
}
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.1'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion scp/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
26 changes: 14 additions & 12 deletions scp/lib/chat.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:scp/utils/chatArgs.dart';
import 'package:webview_flutter/webview_flutter.dart';

class ChatView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ChatArguments args = ModalRoute.of(context).settings.arguments;
return SafeArea(
child: WebviewScaffold(
url:args.url,
withZoom: true,
hidden: true,
withJavascript: true,
resizeToAvoidBottomInset: true,
initialChild: Center(
child: CircularProgressIndicator(),
),
),
);
child: Scaffold(
nayakastha marked this conversation as resolved.
Show resolved Hide resolved
body: WebView(
initialUrl: args.url,
javascriptMode: JavascriptMode.unrestricted,
zoomEnabled: true,
onWebResourceError: (error) {
print(error.errorCode);
return CircularProgressIndicator();
},
onProgress: (int progress) {
print("WebView is loading (progress : $progress%)");
}),
));
}
}
4 changes: 3 additions & 1 deletion scp/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
Expand All @@ -25,8 +26,9 @@ final playstoreURL =
// Or do other work.
} */

void main() {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
Expand Down
24 changes: 10 additions & 14 deletions scp/lib/ui/views/mentor_search/mentor_page.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_contacts/flutter_contacts.dart';
import 'package:graphql_flutter/graphql_flutter.dart';

import 'package:url_launcher/url_launcher.dart';
import 'package:native_contact_dialog/native_contact_dialog.dart';
import 'package:scp/utils/grapgQLconfig.dart';

final Color primaryColor = Color.fromARGB(255, 49, 68, 76);
Expand Down Expand Up @@ -301,9 +301,10 @@ class MentorDetails extends StatelessWidget {
),
onPressed: () {
saveContact(Contact(
givenName: mentorName,
phones: [Item(value: mentorContact)],
emails: [Item(value: mentorEmail)]));
displayName: mentorName,
phones: [Phone(mentorContact)],
emails: [Email(mentorEmail)],
));
},
child: Text(
message,
Expand Down Expand Up @@ -343,17 +344,12 @@ class MentorDetails extends StatelessWidget {
});
}

void saveContact(Contact newContact) async {
NativeContactDialog.addContact(newContact).then((result) {
// NOTE: The user could cancel the dialog, but not add
// them to their addressbook. Whether or not the user decides
// to add [contactToAdd] to their addressbook, you will end up
// here.

print('add contact dialog closed.');
void saveContact(Contact contact) async {
// save contact
final result = FlutterContacts.insertContact(contact).then((value) {
print('add contact dialog closed');
}).catchError((error) {
// FlutterError, most likely unsupported operating system.
print('Error adding contact!');
print('pata nai bhai kya error hai');
nayakastha marked this conversation as resolved.
Show resolved Hide resolved
});
}
}
8 changes: 4 additions & 4 deletions scp/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ dependencies:
firebase_database: ^7.2.2
firebase_messaging: ^10.0.7
firebase_remote_config: ^0.11.0
firebase_storage: ^10.0.3
flutter_webview_plugin: ^0.4.0
firebase_storage: ^10.0.3
flutter_contacts: ^1.1.1+2
font_awesome_flutter: ^9.1.0
get_it: ^5.0.3
graphql_flutter: ^5.0.0
http: ^0.13.3
in_app_review: ^2.0.3
intl: ^0.17.0
lite_rolling_switch: ^0.1.1
lottie: ^1.1.0
native_contact_dialog: ^0.2.2
lottie: ^1.1.0
ndialog: ^4.1.0
package_info: ^2.0.2
path_provider: ^2.0.3
Expand All @@ -44,6 +43,7 @@ dependencies:
stacked: ^1.7.6
table_calendar: ^2.2.3
url_launcher: ^6.0.10
webview_flutter: ^2.3.0
firebase_analytics: ^8.3.2

dev_dependencies:
Expand Down