Skip to content

Commit

Permalink
Merge branch 'main' into 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilaair authored Oct 16, 2021
2 parents ae88cf4 + 0f6fd98 commit 651a907
Show file tree
Hide file tree
Showing 24 changed files with 875 additions and 119 deletions.
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/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-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
1 change: 1 addition & 0 deletions example/android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
41 changes: 41 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
104 changes: 101 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
file_picker:
dependency: transitive
description:
name: file_picker
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
flex_color_picker:
dependency: "direct main"
description:
Expand All @@ -97,6 +118,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -113,7 +141,7 @@ packages:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0"
version: "0.13.3"
http_parser:
dependency: transitive
description:
Expand Down Expand Up @@ -177,6 +205,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
pedantic:
dependency: transitive
description:
Expand All @@ -191,13 +254,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.1"
quiver:
dependency: transitive
description:
Expand Down Expand Up @@ -264,7 +341,7 @@ packages:
description:
path: "."
ref: main
resolved-ref: "30e3c6ae592305adbb4d32cec2e1b627002f310f"
resolved-ref: d5271adc99a3199b4cdb0df321a999dd61fb5832
url: "git://github.com/aguilaair/thememode_selector"
source: git
version: "0.1.0"
Expand All @@ -282,13 +359,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
universal_io:
dependency: transitive
description:
name: universal_io
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.2"
version: "6.0.3"
url_launcher_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -338,6 +422,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.22.0"
12 changes: 5 additions & 7 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Papercups.io Flutter Example App.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand All @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 2.0.0

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.12.0 <3.0.0"

dependencies:
flutter:
Expand All @@ -31,15 +31,14 @@ dependencies:
# the parent directory to use the current plugin's version.
path: ../


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
flex_color_picker: ^2.0.0-nullsafety.3
thememode_selector:
thememode_selector:
git:
url: git://github.com/aguilaair/thememode_selector
ref: main
url: git://github.com/aguilaair/thememode_selector
ref: main
url_launcher: ^6.0.2

dev_dependencies:
Expand All @@ -51,7 +50,6 @@ dev_dependencies:

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
Expand Down
8 changes: 8 additions & 0 deletions lib/models/attachment.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class PapercupsAttachment {
String? id;
String? fileName;
String? fileUrl;
String? contentType;

PapercupsAttachment({this.id, this.fileName, this.fileUrl, this.contentType});
}
37 changes: 37 additions & 0 deletions lib/models/classes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,18 @@ class Props {
/// This is the top section of the widget, normally a welcome text.
String title;

/// This is the top widget text style
TextStyle titleStyle;

/// This is the top widget title alignment
TextAlign titleAlign;

/// This is a smaller piece of text under the title.
String subtitle;

/// This is the subtitle TextStyle
TextStyle? subtitleStyle;

/// Color in which the header is going to be in, if not defined will be primary color used in app.
Color? primaryColor;

Expand All @@ -74,6 +83,9 @@ class Props {
/// This is the placeholder text in the email input section.
String enterEmailPlaceholer;

/// This is the close button in the header section.
Widget closeIcon;

/// This text will be shown if the showAgentAvailability is true and you are online.
//String agentAvailableText;

Expand All @@ -92,13 +104,23 @@ class Props {
/// Company name to show on greeting
String companyName;

/// header Padding
EdgeInsetsGeometry headerPadding;

/// header Height
double? headerHeight;

/// message send icon for the chat section.
Widget? sendIcon;

//Class definition.
Props({
required this.accountId,
//this.agentAvailableText,
//this.agentUnavailableText,
this.baseUrl = "app.papercups.io",
this.customer,
this.closeIcon = const Icon(Icons.close_rounded),
this.greeting,
this.newMessagePlaceholder = "Start typing...",
this.primaryColor,
Expand All @@ -107,8 +129,23 @@ class Props {
//this.showAgentAvailability = false,
this.subtitle = "How can we help you?",
this.title = "Welcome!",
this.titleStyle = const TextStyle(
color: Colors.white,
fontSize: 21,
fontWeight: FontWeight.w600,
),
this.subtitleStyle,
this.titleAlign = TextAlign.left,
this.headerHeight,
this.headerPadding = const EdgeInsets.only(
top: 16,
right: 20,
left: 20,
bottom: 12,
),
this.companyName = "Bot",
this.primaryGradient,
this.enterEmailPlaceholer = "Enter your email",
this.sendIcon,
});
}
10 changes: 10 additions & 0 deletions lib/models/message.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Imports
import 'package:papercups_flutter/models/models.dart';

import 'user.dart';
import 'customer.dart';
export 'user.dart';
Expand Down Expand Up @@ -34,6 +36,12 @@ class PapercupsMessage {
/// The userID of the person sending. Is nullable is the person sending is a customer.
int? userId;

/// The file ids of files to be sent, could be null if message does not contain files
List<String>? fileIds;

/// the metadata of files attached
List<PapercupsAttachment>? attachments;

PapercupsMessage({
this.accountId,
this.body,
Expand All @@ -46,5 +54,7 @@ class PapercupsMessage {
this.user,
this.userId,
this.customer,
this.fileIds,
this.attachments,
});
}
Loading

0 comments on commit 651a907

Please sign in to comment.