Skip to content

Commit d3b87a6

Browse files
authored
Merge pull request #175 from GetStream/upload-core
2 parents 3f6b93d + b8a7640 commit d3b87a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1962
-110
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: Build
22

3-
on:
4-
push:
5-
pull_request:
3+
on: [push, pull_request]
64

5+
# cancel in progress builds
6+
# new pushes to the same branch will cancel old builds.
7+
concurrency:
8+
group: ${{ github.head_ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
build:
913
runs-on: ubuntu-latest
@@ -12,7 +16,6 @@ jobs:
1216
matrix:
1317
channel:
1418
- dev
15-
# - stable
1619

1720
steps:
1821
- uses: actions/checkout@v2

melos.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: stream_feed_flutter
22

33
packages:
44
- packages/**
5-
- example/**
65

76
scripts:
87
format:

packages/stream_feed/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.0+2: 22/12/2021
2+
3+
- fix: export image_storage_client.dart
4+
15
## 0.4.0+1: 07/12/2021
26

37
- fix: support null values `extraData`'s map

packages/stream_feed/example/main.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Future<void> main() async {
4040
final user1 = clientWithSecret.flatFeed('user', '1');
4141

4242
// Create an activity object
43-
var activity = Activity(actor: 'User:1', verb: 'pin', object: 'Place:42');
43+
var activity =
44+
const Activity(actor: 'User:1', verb: 'pin', object: 'Place:42');
4445

4546
// Add an activity to the feed
4647
final pinActivity = await user1.addActivity(activity);
@@ -77,7 +78,7 @@ Future<void> main() async {
7778
secret: secret,
7879
appId: appId,
7980
runner: Runner.server,
80-
options: StreamHttpClientOptions(location: Location.usEast),
81+
options: const StreamHttpClientOptions(location: Location.usEast),
8182
);
8283

8384
final userToken = client.frontendToken('user.id');
@@ -103,7 +104,7 @@ Future<void> main() async {
103104
object: "3",
104105
time: now,
105106
foreignId: "like:3",
106-
extraData: {
107+
extraData: const {
107108
'popularity': 100,
108109
});
109110

@@ -207,7 +208,7 @@ Future<void> main() async {
207208
// Add the activity to Eric's feed and to Jessica's notification feed
208209
activity = Activity(
209210
actor: 'user:Eric',
210-
extraData: {
211+
extraData: const {
211212
'message': "@Jessica check out getstream.io it's awesome!",
212213
},
213214
verb: 'tweet',
@@ -316,7 +317,7 @@ Future<void> main() async {
316317

317318
// First create a collection entry with upsert api
318319
await clientWithSecret.collections.upsert('food', [
319-
CollectionEntry(id: 'cheese-burger', data: {'name': 'Cheese Burger'}),
320+
const CollectionEntry(id: 'cheese-burger', data: {'name': 'Cheese Burger'}),
320321
]);
321322

322323
// Then create a user
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export 'analytics_client.dart';
22
export 'file_storage_client.dart';
33
export 'flat_feed.dart';
4+
export 'image_storage_client.dart';
45
export 'reactions_client.dart';
56
export 'stream_feed_client.dart';
67
export 'stream_user.dart';

packages/stream_feed/lib/src/client/stream_feed_client_impl.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class StreamFeedClientImpl implements StreamFeedClient {
3838
StreamFeedClientImpl(
3939
this.apiKey, {
4040
this.secret,
41-
this.userToken,
41+
this.userToken, //TODO(sacha): remove this and call _ensureCredentials
42+
//in the getters instead (collections etc)
4243
this.appId,
4344
this.fayeUrl = 'wss://faye-us-east.stream-io-api.com/faye',
4445
this.runner = Runner.client,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export 'location.dart';
22
export 'stream_http_client.dart' show StreamHttpClientOptions;
33
export 'token.dart';
4+
export 'typedefs.dart';

packages/stream_feed/lib/src/core/http/stream_http_client_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class StreamHttpClientOptions {
4040

4141
/// Get the current user agent
4242
String get _userAgent => 'stream-feed-dart-client-${CurrentPlatform.name}-'
43-
'${packageVersion.split('+')[0]}';
43+
'${packageVersion.split('+')[0]}'; //TODO(sacha):add a parameter to StreamHttpClientOptions to specify the package used (llc,core,ui)
4444

4545
/// Generates a baseUrl using the provided [serviceName]
4646
String _getBaseUrl(String serviceName) {

packages/stream_feed/lib/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// Current package version
22
/// Used in [HttpClient] to build the `x-stream-client` header
3-
const String packageVersion = '0.4.0+1';
3+
const String packageVersion = '0.4.0+2';

packages/stream_feed/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: stream_feed
22
description: Stream Feed official Dart SDK. Build your own feed experience using Dart and Flutter.
3-
version: 0.4.0+1
3+
version: 0.4.0+2
44
repository: https://github.com/GetStream/stream-feed-flutter
55
issue_tracker: https://github.com/GetStream/stream-feed-flutter/issues
66
homepage: https://getstream.io/

packages/stream_feed_flutter_core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.1: 22/12/2021
2+
3+
- new: UploadListCore and UploadController
4+
15
## 0.4.0+1: 07/12/2021
26

37
- Use secure link in readme

packages/stream_feed_flutter_core/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,18 @@ The package primarily contains three types of classes:
108108
These components allow you to have the maximum and lower-level control of the queries being executed.
109109
The BLoCs we provide are:
110110

111-
1) FeedBloc
111+
1) FeedBloc: manage activity and reaction streams
112+
2) UplaodController: manage upload streams (Progress,Fail,Success)
112113

113114
### Core Components
114115

115116
Core components usually are an easy way to fetch data associated with Stream Feed which are decoupled from UI and often expose UI builders.
116117
Data fetching can be controlled with the controllers of the respective core components.
117118

118-
1) FlatFeedCore (Fetch a list of activities)
119-
2) ReactionListCore (Fetch a list of reactions)
120-
3) FeedProvider (Inherited widget providing bloc to the widget tree)
119+
1) FlatFeedCore : given an Activity Widget builder render a reactive list of activities
120+
2) ReactionListCore: given an Reaction Widget builder render a reactive list of reactions
121+
3) UploadListCore: expose a reactive list of uploads via a callback
122+
4) FeedProvider: an Inherited widget providing access to FeedBloc in the widget tree
121123

122124
## Contributing
123125

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

packages/stream_feed_flutter_core/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1414
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1515
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16+
BACCB9AFA8F1B238760F8ACC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1889E6C1E679C6C6D55CD85 /* Pods_Runner.framework */; };
1617
/* End PBXBuildFile section */
1718

1819
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,30 +32,54 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
34106E03D81D6755EC0C4C96 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3537
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3638
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3739
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
40+
8AFFEA1559E604B66DD1144C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3841
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3942
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4043
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4144
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4245
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4346
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4447
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
48+
A0175A5C8C7A0B022BDCF26E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
49+
D1889E6C1E679C6C6D55CD85 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4550
/* End PBXFileReference section */
4651

4752
/* Begin PBXFrameworksBuildPhase section */
4853
97C146EB1CF9000F007C117D /* Frameworks */ = {
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
BACCB9AFA8F1B238760F8ACC /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
54AE7E6B34C4987F9020D86F /* Pods */ = {
65+
isa = PBXGroup;
66+
children = (
67+
8AFFEA1559E604B66DD1144C /* Pods-Runner.debug.xcconfig */,
68+
34106E03D81D6755EC0C4C96 /* Pods-Runner.release.xcconfig */,
69+
A0175A5C8C7A0B022BDCF26E /* Pods-Runner.profile.xcconfig */,
70+
);
71+
name = Pods;
72+
path = Pods;
73+
sourceTree = "<group>";
74+
};
75+
96773A3827668DFB3CFA0635 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
D1889E6C1E679C6C6D55CD85 /* Pods_Runner.framework */,
79+
);
80+
name = Frameworks;
81+
sourceTree = "<group>";
82+
};
5883
9740EEB11CF90186004384FC /* Flutter */ = {
5984
isa = PBXGroup;
6085
children = (
@@ -72,6 +97,8 @@
7297
9740EEB11CF90186004384FC /* Flutter */,
7398
97C146F01CF9000F007C117D /* Runner */,
7499
97C146EF1CF9000F007C117D /* Products */,
100+
54AE7E6B34C4987F9020D86F /* Pods */,
101+
96773A3827668DFB3CFA0635 /* Frameworks */,
75102
);
76103
sourceTree = "<group>";
77104
};
@@ -105,12 +132,14 @@
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
A00EBE73D22827FBCD247C1E /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
B0502759F7392C698135D7A5 /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -197,6 +226,45 @@
197226
shellPath = /bin/sh;
198227
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199228
};
229+
A00EBE73D22827FBCD247C1E /* [CP] Check Pods Manifest.lock */ = {
230+
isa = PBXShellScriptBuildPhase;
231+
buildActionMask = 2147483647;
232+
files = (
233+
);
234+
inputFileListPaths = (
235+
);
236+
inputPaths = (
237+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
238+
"${PODS_ROOT}/Manifest.lock",
239+
);
240+
name = "[CP] Check Pods Manifest.lock";
241+
outputFileListPaths = (
242+
);
243+
outputPaths = (
244+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
245+
);
246+
runOnlyForDeploymentPostprocessing = 0;
247+
shellPath = /bin/sh;
248+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
249+
showEnvVarsInLog = 0;
250+
};
251+
B0502759F7392C698135D7A5 /* [CP] Embed Pods Frameworks */ = {
252+
isa = PBXShellScriptBuildPhase;
253+
buildActionMask = 2147483647;
254+
files = (
255+
);
256+
inputFileListPaths = (
257+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
258+
);
259+
name = "[CP] Embed Pods Frameworks";
260+
outputFileListPaths = (
261+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
262+
);
263+
runOnlyForDeploymentPostprocessing = 0;
264+
shellPath = /bin/sh;
265+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
266+
showEnvVarsInLog = 0;
267+
};
200268
/* End PBXShellScriptBuildPhase section */
201269

202270
/* Begin PBXSourcesBuildPhase section */

packages/stream_feed_flutter_core/example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/stream_feed_flutter_core/example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>NSPhotoLibraryUsageDescription</key>
45+
<string>Photo Library Access Warning</string>
4446
</dict>
4547
</plist>

0 commit comments

Comments
 (0)