Skip to content

Commit 52a279b

Browse files
xsahil03xdiegoveloperNash0x7E2imtoorid3xvn
authored
feat(repo): move sample app to monorepo (#2105)
Co-authored-by: diegoveloper <[email protected]> Co-authored-by: Neevash Ramdial (Nash) <[email protected]> Co-authored-by: Salvatore Giordano <[email protected]> Co-authored-by: Deven Joshi <[email protected]> Co-authored-by: sonykurian96 <[email protected]> Co-authored-by: Márton Braun <[email protected]> Co-authored-by: Gordon Hayes <[email protected]> Co-authored-by: Ayush Shekhar <[email protected]> Co-authored-by: Leandro Borges Ferreira <[email protected]> Co-authored-by: kanat <> Co-authored-by: kanat <[email protected]>
1 parent 3023e74 commit 52a279b

File tree

184 files changed

+11003
-4
lines changed

Some content is hidden

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

184 files changed

+11003
-4
lines changed

.gitignore

+15-1
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,25 @@ Podfile.lock
8282
!**/ios/**/default.pbxuser
8383
!**/ios/**/default.perspectivev3
8484

85+
# macOS-related
86+
**/macos/**/Pods/
87+
**/macos/**/xcuserdata
88+
**/macos/**/Flutter/ephemeral
89+
90+
# Windows-related
91+
**/windows/flutter/ephemeral/
92+
93+
# Linux-related
94+
**/linux/flutter/ephemeral/
95+
8596
# Generated files
8697
*.dart.js
8798
*.info.json
8899
*.js
89100
*.js_
90101
*.js.deps
91102
*.js.map
103+
*.wasm
92104
**/lcov.info
93105

94106
# Other ignored files
@@ -115,4 +127,6 @@ gradle-wrapper.jar
115127
# Exceptions to the above rules
116128
!/pubspec.lock
117129
!**/example/web/sql-wasm.js
118-
!**/example/web/sql-wasm.wasm
130+
!**/example/web/sql-wasm.wasm
131+
!/sample_app/web/sql-wasm.js
132+
!/sample_app/web/sql-wasm.wasm

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Stream allows developers to rapidly deploy scalable feeds and chat messaging wit
2020

2121
For upgrading from V7 to V8, please refer to the [V8 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_8_0/)
2222

23-
## Sample apps and demos
24-
Our team maintains a dedicated repository for full fledged sample applications and demos. Consider checking out [GetStream/flutter-samples](https://github.com/GetStream/flutter-samples) to learn more or get started by looking at our latest [Stream Chat demo](https://github.com/GetStream/flutter-samples/tree/main/packages/stream_chat_v1).
23+
## Sample apps and demos
24+
Check out our [sample_app](sample_app) to see Stream Chat's core features in action. For more sample apps and demos, visit [GetStream/flutter-samples](https://github.com/GetStream/flutter-samples).
2525

2626
## Free for Makers
2727

melos.yaml

+22-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ name: stream_chat_flutter
22
repository: https://github.com/GetStream/stream-chat-flutter
33

44
packages:
5-
- packages/**
5+
- sample_app
6+
- packages/*
7+
- packages/*/example
8+
9+
categories:
10+
sample_app:
11+
- sample_app
12+
packages:
13+
- packages/*
14+
examples:
15+
- packages/*/example
616

717
command:
818
bootstrap:
@@ -27,13 +37,20 @@ command:
2737
drift: ^2.22.1
2838
equatable: ^2.0.5
2939
ezanimation: ^0.6.0
40+
firebase_core: ^3.0.0
41+
firebase_messaging: ^15.0.0
3042
file_picker: ^8.0.5
3143
file_selector: ^1.0.3
44+
flutter_app_badger: ^1.5.0
45+
flutter_local_notifications: ^18.0.1
3246
flutter_markdown: ^0.7.2+1
3347
flutter_portal: ^1.1.4
48+
flutter_secure_storage: ^9.2.2
49+
flutter_slidable: ^3.1.1
3450
flutter_svg: ^2.0.10+1
3551
freezed_annotation: ^2.4.1
3652
get_thumbnail_video: ^0.7.3
53+
go_router: ^14.6.2
3754
http_parser: ^4.0.2
3855
image_gallery_saver_plus: ^3.0.5
3956
image_picker: ^1.1.2
@@ -52,10 +69,12 @@ command:
5269
path_provider: ^2.1.3
5370
photo_manager: ^3.2.0
5471
photo_view: ^0.15.0
72+
provider: ^6.0.5
5573
rate_limiter: ^1.0.0
5674
record: ^5.2.0
5775
responsive_builder: ^0.7.0
5876
rxdart: ^0.28.0
77+
sentry_flutter: ^8.3.0
5978
share_plus: ^10.0.2
6079
shimmer: ^3.0.0
6180
sqlite3_flutter_libs: ^0.5.26
@@ -64,6 +83,7 @@ command:
6483
stream_chat_flutter_core: ^9.3.0
6584
stream_chat_localizations: ^9.3.0
6685
stream_chat_persistence: ^9.3.0
86+
streaming_shared_preferences: ^2.0.0
6787
svg_icon_widget: ^0.0.1
6888
synchronized: ^3.1.0+1
6989
thumblr: ^0.0.4
@@ -79,6 +99,7 @@ command:
7999
drift_dev: ^2.22.1
80100
fake_async: ^1.3.1
81101
faker_dart: ^0.2.1
102+
flutter_launcher_icons: ^0.14.2
82103
freezed: ^2.4.2
83104
json_serializable: ^6.7.1
84105
mocktail: ^1.0.0

sample_app/.metadata

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled.
5+
6+
version:
7+
revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
17+
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
18+
- platform: android
19+
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
20+
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

sample_app/README.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Stream Chat v1
2+
3+
![](https://raw.githubusercontent.com/GetStream/flutter-samples/master/images/sdk_hero_v4.png)
4+
5+
Stream Chat V1 is a sample app implemented using Stream Chat and Flutter. It is a fully fledged messaging app built using a combination of our pre-made widgets and custom Flutter widgets.
6+
7+
It supports several advanced features like:
8+
9+
- Channels list UI
10+
- Channel UI
11+
- Message reactions
12+
- Link preview
13+
- Image, video and file attachments
14+
- Editing and deleting messages
15+
- Typing indicators
16+
- Read indicators
17+
- Image gallery
18+
- GIF support
19+
- Light and dark themes
20+
- Threads
21+
- Slash commands
22+
- Markdown message formatting
23+
- Count for unread messages
24+
25+
![Features iOS](https://user-images.githubusercontent.com/20601437/110333493-eb023a80-8021-11eb-8fb1-b74f9ef37897.gif)
26+
27+
## Getting Started
28+
29+
Before running this project please ensure Flutter is installed and configured on your machine. If you're new to Flutter, please checkout the [official guide](https://flutter.dev/docs/get-started/install) with installation instructions for your OS.
30+
31+
32+
33+
This project is only configured to support the following platforms:
34+
35+
- Android
36+
- iOS
37+
38+
Web and Desktop are not supported at this time.
39+
40+
After installing Flutter and the necessary toolchain for your device (Android or iOS), connect your device or open your emulator before running the following:
41+
42+
**Clone the repo**
43+
44+
```bash
45+
git clone https://github.com/GetStream/flutter-samples
46+
```
47+
48+
**Open the app folder**
49+
50+
```bash
51+
cd flutter-samples/stream_chat_v1
52+
```
53+
54+
**Install package dependencies:**
55+
56+
```bash
57+
flutter packages get
58+
```
59+
60+
**Open or create an emulator**
61+
62+
```bash
63+
# To run an emulator, run 'flutter emulators --launch <emulator id>'.
64+
# To create a new emulator, run 'flutter emulators --create [--name xyz]'.
65+
# You can find more information on managing emulators at the links below:
66+
# [https://developer.android.com/studio/run/managing-avds](https://developer.android.com/studio/run/managing-avds)[https://developer.android.com/studio/command-line/avdmanager](https://developer.android.com/studio/command-line/avdmanager)
67+
```
68+
69+
**Run the project on your device or emulator:**
70+
71+
```bash
72+
flutter run
73+
```

sample_app/analysis_options.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include: ../analysis_options.yaml
2+
3+
linter:
4+
rules:
5+
cascade_invocations: false
6+
public_member_api_docs: false
7+
lines_longer_than_80_chars: false

sample_app/android/app/build.gradle

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
16+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
17+
if (flutterVersionCode == null) {
18+
flutterVersionCode = '1'
19+
}
20+
21+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
22+
if (flutterVersionName == null) {
23+
flutterVersionName = '1.0'
24+
}
25+
26+
android {
27+
namespace "com.example.example"
28+
29+
compileSdkVersion 35
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
34+
35+
lintOptions {
36+
disable 'InvalidPackage'
37+
checkReleaseBuilds false
38+
}
39+
40+
defaultConfig {
41+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
42+
applicationId "com.example.example"
43+
minSdkVersion 23
44+
targetSdkVersion 34
45+
versionCode flutterVersionCode.toInteger()
46+
versionName flutterVersionName
47+
multiDexEnabled true
48+
}
49+
50+
compileOptions {
51+
// Flag to enable support for the new language APIs
52+
coreLibraryDesugaringEnabled true
53+
}
54+
55+
// Added this block:
56+
afterEvaluate { project ->
57+
if (project.hasProperty("kotlin")) {
58+
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
59+
kotlinOptions {
60+
jvmTarget = "1.8"
61+
}
62+
}
63+
}
64+
}
65+
66+
signingConfigs {
67+
debug {
68+
storeFile file('debug.keystore')
69+
storePassword 'android'
70+
keyAlias 'androiddebugkey'
71+
keyPassword 'android'
72+
}
73+
}
74+
75+
buildTypes {
76+
release {
77+
// TODO: Add your own signing config for the release build.
78+
// Signing with the debug keys for now, so `flutter run --release` works.
79+
signingConfig signingConfigs.debug
80+
}
81+
}
82+
}
83+
84+
flutter {
85+
source '../..'
86+
}
87+
88+
dependencies {
89+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
90+
}

sample_app/android/app/debug.keystore

2.06 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
8+
<application android:usesCleartextTraffic="true">
9+
<!-- possibly other elements -->
10+
</application>
11+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
4+
calls FlutterMain.startInitialization(this); in its onCreate method.
5+
In most cases you can leave this as-is, but you if you want to provide
6+
additional functionality it is fine to subclass or reimplement
7+
FlutterApplication and put your custom class here. -->
8+
<uses-permission android:name="android.permission.INTERNET"/>
9+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
10+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
11+
<application
12+
android:label="Chat Sample Flutter"
13+
android:name="${applicationName}"
14+
android:icon="@mipmap/ic_launcher"
15+
android:requestLegacyExternalStorage="true"
16+
>
17+
<activity
18+
android:name=".MainActivity"
19+
android:launchMode="singleTop"
20+
android:theme="@style/LaunchTheme"
21+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
22+
android:hardwareAccelerated="true"
23+
android:windowSoftInputMode="adjustResize"
24+
android:exported="true">
25+
<!-- Specifies an Android theme to apply to this Activity as soon as
26+
the Android process has started. This theme is visible to the user
27+
while the Flutter UI initializes. After that, this theme continues
28+
to determine the Window background behind the Flutter UI. -->
29+
<meta-data
30+
android:name="io.flutter.embedding.android.NormalTheme"
31+
android:resource="@style/NormalTheme"
32+
/>
33+
<!-- Action mentioned in Notification Template:
34+
{
35+
"title": "{{ sender.name }} @ {{ channel.name }}",
36+
"body": "{{ truncate message.text 2000 }}",
37+
"click_action": "FLUTTER_NOTIFICATION_CLICK",
38+
"sound": "default"
39+
}
40+
-->
41+
<intent-filter>
42+
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
43+
<category android:name="android.intent.category.DEFAULT" />
44+
</intent-filter>
45+
<intent-filter>
46+
<action android:name="android.intent.action.MAIN"/>
47+
<category android:name="android.intent.category.LAUNCHER"/>
48+
</intent-filter>
49+
</activity>
50+
<!-- Don't delete the meta-data below.
51+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
52+
<meta-data
53+
android:name="flutterEmbedding"
54+
android:value="2" />
55+
56+
<!-- Set custom default icon. This is used when no icon is set for background notification messages.
57+
See README(https://goo.gl/l4GJaQ) for more. -->
58+
<meta-data
59+
android:name="com.google.firebase.messaging.default_notification_icon"
60+
android:resource="@drawable/ic_notification" />
61+
</application>
62+
</manifest>

0 commit comments

Comments
 (0)