Skip to content

Commit

Permalink
Build Fix v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mr0kaushik committed Oct 14, 2021
1 parent 91d5828 commit 092a0a6
Show file tree
Hide file tree
Showing 32 changed files with 290 additions and 228 deletions.
13 changes: 7 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ android {
noCompress "tflite"
}

compileSdkVersion 29
compileSdkVersion 31
ndkVersion "20.0.5594570"

lintOptions {
disable 'InvalidPackage'
Expand All @@ -40,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "tech.mr0kaushik.sms_spam_detection"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -63,9 +64,9 @@ flutter {

dependencies {

implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.tensorflow:tensorflow-lite:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:3.6.4'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
Binary file added assets/images/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -508,4 +508,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions lib/screens/Home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class _HomeState extends State<HomeScreen> {
});

var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
threadId.toString(), 'sms_spam', 'Spam Sms detection',
importance: Importance.Max, priority: Priority.High);
threadId.toString(), 'sms_spam', channelDescription: 'Spam Sms detection',
importance: Importance.max, priority: Priority.high);
var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
var platformChannelSpecifics = new NotificationDetails(
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(
threadId,
head,
Expand All @@ -108,10 +108,10 @@ class _HomeState extends State<HomeScreen> {
}

var initializationSettingsAndroid =
new AndroidInitializationSettings('@mipmap/ic_launcher');
new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = new IOSInitializationSettings();
var initializationSettings = new InitializationSettings(
initializationSettingsAndroid, initializationSettingsIOS);
android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
flutterLocalNotificationsPlugin.initialize(initializationSettings,
onSelectNotification: onNotificationSelected);
Expand Down Expand Up @@ -192,7 +192,7 @@ class _HomeState extends State<HomeScreen> {
child: new Column(
children: <Widget>[
new UserAccountsDrawerHeader(
currentAccountPicture: Image.asset('assets/images/logo.png'),
currentAccountPicture: Image.asset('assets/images/app_icon.png'),
accountName: new Text("SMS Spam Detection"),
accountEmail: null),
new Column(children: drawerOptions)
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/ImportScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class _ImportedScreenState extends State<ImportedScreen> {
Flexible(
child: Center(
child: Image.asset(
"assets/images/logo.png",
"assets/images/app_icon.png",
width: imageSize,
height: imageSize,
// fit: BoxFit.cover,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/onboarding_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
});
}
break;
case PermissionStatus.undetermined:
case PermissionStatus.limited:
case PermissionStatus.restricted:
case PermissionStatus.permanentlyDenied:
if (mounted) {
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/select_contacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class _SelectContactState extends State<SelectContact> {
ContactsService.getContacts(orderByGivenName: true).then((value) {
if (mounted) {
setState(() {
contacts = value.toList();
contacts = value;
filteredContacts = contacts;
showProgress = false;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _SplashscreenState extends State<Splashscreen> {
Center(
child: Image(
image: AssetImage(
'assets/images/logo.png',
'assets/images/app_icon.png',
),
height: 200.0,
width: 200.0,
Expand Down
36 changes: 22 additions & 14 deletions lib/sms/contacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,45 @@ class ContactsService {
static const MethodChannel _channel =
MethodChannel('github.com/clovisnicolas/flutter_contacts');

static Future<Iterable<Contact>> getContacts(
static Future<List<Contact>> getContacts(
{String query,
bool withThumbnails = true,
bool photoHighResolution = true,
bool orderByGivenName = true}) async {
bool withThumbnails = true,
bool photoHighResolution = true,
bool orderByGivenName = true,
bool iOSLocalizedLabels = true,
bool androidLocalizedLabels = true}) async {
Iterable contacts =
await _channel.invokeMethod('getContacts', <String, dynamic>{
await _channel.invokeMethod('getContacts', <String, dynamic>{
'query': query,
'withThumbnails': withThumbnails,
'photoHighResolution': photoHighResolution,
'orderByGivenName': orderByGivenName
'orderByGivenName': orderByGivenName,
'iOSLocalizedLabels': iOSLocalizedLabels,
'androidLocalizedLabels': androidLocalizedLabels,
});
return contacts.map((m) => Contact.fromMap(m));
return contacts.map((m) => Contact.fromMap(m)).toList();
}

/// Fetches all contacts, or when specified, the contacts with a name
/// matching [query]
static Future<Iterable<Contact>> getContactsForPhone(String phone,
static Future<List<Contact>> getContactsForPhone(String phone,
{bool withThumbnails = true,
bool photoHighResolution = true,
bool orderByGivenName = true}) async {
if (phone == null || phone.isEmpty) return Iterable.empty();
bool photoHighResolution = true,
bool orderByGivenName = true,
bool iOSLocalizedLabels = true,
bool androidLocalizedLabels = true}) async {
if (phone == null || phone.isEmpty) return List.empty();

Iterable contacts =
await _channel.invokeMethod('getContactsForPhone', <String, dynamic>{
await _channel.invokeMethod('getContactsForPhone', <String, dynamic>{
'phone': phone,
'withThumbnails': withThumbnails,
'photoHighResolution': photoHighResolution,
'orderByGivenName': orderByGivenName
'orderByGivenName': orderByGivenName,
'iOSLocalizedLabels': iOSLocalizedLabels,
'androidLocalizedLabels': androidLocalizedLabels,
});
return contacts.map((m) => Contact.fromMap(m));
return contacts.map((m) => Contact.fromMap(m)).toList();
}

/// Loads the avatar for the given contact and returns it. If the user does
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/ChatItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ class _ChatItemState extends State<ChatItem> {
return GestureDetector(
onTap: () {
if (contact != null) {
String label = contact.displayName;
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChatScreen(
contact.getPrimaryAddress(), widget._thread.threadId)));
label, widget._thread.threadId)));
} else {
Navigator.push(
context,
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/ChatMessage.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_widgets/flutter_widgets.dart';
// import 'package:flutter_widgets/flutter_widgets.dart';
import 'package:intl/intl.dart';
import 'package:sms_spam_detection/presentation/MatColor.dart';
import 'package:sms_spam_detection/sms/sms_service.dart';
import 'package:sms_spam_detection/sqflite/SmsDatabase.dart';
import 'package:visibility_detector/visibility_detector.dart';

abstract class ChatScreenItem {}

Expand Down
68 changes: 16 additions & 52 deletions lib/widgets/contact_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,39 @@ import 'package:flutter/material.dart';
import 'package:sms_spam_detection/screens/ChatScreen.dart';
import 'package:sms_spam_detection/sms/contacts.dart';

class ContactItem extends StatefulWidget {
class ContactItem extends StatelessWidget {
final Contact contact;

ContactItem(this.contact);

@override
_ContactItemState createState() => _ContactItemState();
}

class _ContactItemState extends State<ContactItem> {
String title, address;
List<String> addresses = [];
bool showItem = true;

@override
void initState() {
super.initState();
if (widget.contact != null) {
title = (widget.contact.displayName != null)
? widget.contact.displayName
: '';
if (widget.contact.getPhonesString == null) {
Widget build(BuildContext context) {
String title, address;
if (contact != null) {
title = (contact.displayName != null) ? contact.displayName : '';
if (contact.getPhonesString == null) {
address = '';
return;
}

String str = widget.contact.getPhonesString();
String str = contact.getPhonesString();
if (str.length > 0) {
address = str.split(RegExp(','))[0];
}
}
}

getSubTitle(List<String> addresses) {
String s = addresses[0];
if (showItem && addresses.length > 1) {
for (int i = 1; i < addresses.length; i++) {
if (addresses[i] != null) {
s = s + ' ' + addresses[i];
}
}
}
}

@override
Widget build(BuildContext context) {
// subTitle += (phones.length > 1) ? ", + ${phones.length - 1}" : "";
// String subTitle = address;
// if (showItem && addresses.length > 1) {
// for (int i = 1; i < addresses.length; i++) {
// if (addresses[i] != null) {
// subTitle = subTitle + ' ' + addresses[i];
// }
// }
// }
String subTitle = widget.contact.getPhonesString();
String subTitle = contact.getPhonesString();

return ListTile(
leading: CircleAvatar(
child:
(widget.contact.avatar != null && widget.contact.avatar.length > 0)
? ClipOval(child: Image.memory(widget.contact.avatar))
: Icon(
Icons.person,
color: Colors.white,
),
child: (contact.avatar != null && contact.avatar.length > 0)
? ClipOval(child: Image.memory(contact.avatar))
: Icon(
Icons.person,
color: Colors.white,
),
),
title: Text(title != null ? title : 'Deepak'),
subtitle: Text((subTitle != null) ? subTitle : '14729822'),
title: Text(title != null ? title : '<>'),
subtitle: Text((subTitle != null) ? subTitle : '<>'),
onTap: () {
Navigator.pop(context);
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
Expand Down
Loading

0 comments on commit 092a0a6

Please sign in to comment.