Skip to content

Commit

Permalink
Merge pull request #551 from GetStream/release/2.0.0
Browse files Browse the repository at this point in the history
Release/2.0.0
  • Loading branch information
imtoori authored Jul 16, 2021
2 parents 8674395 + 9813f40 commit a292492
Show file tree
Hide file tree
Showing 466 changed files with 156,297 additions and 26,154 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/docusaurus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: docusaurus

on:
push:
branches:
- master
- develop
paths:
- docusaurus/**
jobs:
push_docusaurus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: push
uses: GetStream/push-stream-chat-docusaurus-action@main
with:
target-branch: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
env:
DOCUSAURUS_GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
13 changes: 0 additions & 13 deletions .github/workflows/scripts/install-flutter.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/scripts/install-tools.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Fast fail the script on failures.
set -e

pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' -r '\.freezed\.dart$'
pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' -r '\.freezed\.dart$'
126 changes: 72 additions & 54 deletions .github/workflows/stream_flutter_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,122 @@ name: stream_flutter_workflow

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
flutter_version: "2.2.2"

on:
pull_request:
push:
branches:
- master
- develop
paths-ignore:
- 'docs/**'

jobs:
analyze:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Git Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: 'Install Tools'
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ env.flutter_version }}-flutter
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.flutter_version }}
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
flutter pub global activate tuneup
- name: 'Bootstrap Workspace'
flutter pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: 'Dart Analyze'
- name: "Dart Analyze"
run: |
melos exec -c 3 --ignore="*example*" -- \
tuneup check
- name: 'Pub Check'
melos run analyze
- name: "Pub Check"
if: github.ref == 'refs/heads/master'
run: |
melos exec -c 1 --no-private --ignore="*example*" -- \
pub publish --dry-run
melos run lint:pub
format:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: "Git Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: 'Install Tools'
run: |
./.github/workflows/scripts/install-tools.sh
- name: 'Bootstrap Workspace'
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ env.flutter_version }}-flutter
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.flutter_version }}
- name: "Install Tools"
run: flutter pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: 'Dart'
- name: "Melos Format"
run: melos run format
- name: "Validate Formatting"
run: |
melos exec -c 1 -- \
flutter format .
./.github/workflows/scripts/validate-formatting.sh
test:
runs-on: ubuntu-latest
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: "Git Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: 'Install Tools'
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /Users/runner/hostedtoolcache/flutter
key: ${{ env.flutter_version }}-flutter
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
flutter-version: ${{ env.flutter_version }}
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
flutter pub global activate coverage
flutter pub global activate remove_from_coverage
- name: 'Bootstrap Workspace'
flutter pub global activate melos
pub global activate remove_from_coverage
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: 'Dart Test'
run: |
cd packages/stream_chat
flutter pub run test --coverage coverage/
format_coverage --lcov --in=coverage/ --out=coverage/lcov.info --packages=.packages --report-on=lib
- name: 'Flutter Test'
run: |
melos exec -c 3 --flutter --dir-exists=test --ignore="*example*" --ignore="*web*" -- \
flutter test --coverage
- name: CodeCov
run: |
melos exec -c 3 --fail-fast --dir-exists=test --ignore="*example*" --ignore="*web*" -- \
"\$MELOS_ROOT_PATH/.github/workflows/scripts/coverage.sh"
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
- uses: VeryGoodOpenSource/[email protected]
- name: "Flutter Test"
run: melos run test:all
- name: "Collect Coverage"
run: melos run coverage:ignore-file --no-select
- name: "Upload Coverage"
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
files: packages/*/coverage/lcov.info
- name: "Stream Chat Coverage Check"
uses: VeryGoodOpenSource/[email protected]
with:
path: packages/stream_chat/coverage/lcov.info
min_coverage: 40
- uses: VeryGoodOpenSource/[email protected]
min_coverage: 80
- name: "Stream Chat Persistence Coverage Check"
uses: VeryGoodOpenSource/[email protected]
with:
path: packages/stream_chat_persistence/coverage/lcov.info
min_coverage: 95
- uses: VeryGoodOpenSource/[email protected]
- name: "Stream Chat Flutter Core Coverage Check"
uses: VeryGoodOpenSource/[email protected]
with:
path: packages/stream_chat_flutter_core/coverage/lcov.info
min_coverage: 90
- uses: VeryGoodOpenSource/[email protected]
- name: "Stream Chat Flutter Coverage Check"
uses: VeryGoodOpenSource/[email protected]
with:
path: packages/stream_chat_flutter/coverage/lcov.info
min_coverage: 16
min_coverage: 67
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
analyzer:
exclude:
- lib/**/*.g.dart
- lib/**/*.freezed.dart
- example/*
- test/*
- packages/*/lib/**/*.g.dart
- packages/*/lib/src/emoji
- packages/*/lib/**/*.freezed.dart

linter:
rules:
# these rules are documented on and in the same order as
# the Dart Lint rules page to make maintenance easier
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
- always_use_package_imports
- avoid_empty_else
- avoid_relative_lib_imports
Expand Down Expand Up @@ -42,7 +45,6 @@ linter:
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_void
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
Expand Down Expand Up @@ -138,8 +140,7 @@ linter:
- package_names
- sort_pub_dependencies

# To be added when null-safe:
# - cast_nullable_to_non_nullable
#- unnecessary_null_checks
# - tighten_type_of_initializing_formals
# - null_check_on_nullable_type_parameter
- cast_nullable_to_non_nullable
- unnecessary_null_checks
- tighten_type_of_initializing_formals
- null_check_on_nullable_type_parameter
Binary file added docusaurus/docs/Flutter/assets/channel_header.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/docs/Flutter/assets/chat_basics.png
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.
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 added docusaurus/docs/Flutter/assets/message_input.png
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.
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 added docusaurus/docs/Flutter/assets/sdk_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/docs/Flutter/assets/server_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/docs/Flutter/assets/swipe_channel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/docs/Flutter/assets/user_list_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/docs/Flutter/assets/using_theme.jpg
4 changes: 4 additions & 0 deletions docusaurus/docs/Flutter/basics/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Introduction",
"position": 1
}
55 changes: 55 additions & 0 deletions docusaurus/docs/Flutter/basics/choose_package.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
id: choose_package
sidebar_position: 2
title: Choosing The Right Flutter Package
---

### Why the SDK is split into different packages

Different applications need different levels of customization and integration with the Stream Chat SDK.
To do this, the Flutter SDK is split into three different packages which build upon the last and give
varying levels of control to the developer. The higher level packages offer better compatibility out of the
box while the lower level SDKs offer fine grained control. There is also a separate package for persistence
which allows you persist data locally which works with all packages.

### How do I choose?

#### The case for stream_chat_flutter

For the quickest way to integrate Stream Chat with your app, the UI SDK (`stream_chat_flutter`) is the
way to go. `stream_chat_flutter` contains prebuilt components that manage most operations like data
fetching, pagination, sending a message, and more. This ensures you have a nearly out-of-the-box
experience adding chat to your applications. It is also possible to use this in conjunction with
lower level operations of the SDK to get the best of both worlds.

:::note
The package allows customization of components to a large extent making it easy to tweak the theme
to match your app colors and such. If you require any additional feature or customization, feel free
to request this through our support channels.
:::

<b>Summary:</b>

For the quickest and easiest way to add Chat to your app with prebuilt UI components, use stream_chat_flutter


#### The case for stream_chat_flutter_core

If your application involves UI that does not fit in with the stream_chat_flutter components, stream_chat_flutter_core
strips away the UI associated with the components and provides the data fetching and manipulation
capabilities while supplying builders for UI. This allows you to implement your own UI and themes
completely independently while not worrying about writing functions for data and pagination.

<b>Summary:</b>

For implementing your own custom UI while not having to worry about lower level API calls, use stream_chat_flutter_core.

#### The case for stream_chat

The stream_chat package is the Low-level Client (LLC) of Stream Chat in Flutter. This package wraps
the underlying functionality of Stream Chat and allows the most customization in terms of UI, data,
and architecture.

<b>Summary:</b>

For the most control over the SDK and dealing with low level calls to the API, use stream_chat.
Loading

0 comments on commit a292492

Please sign in to comment.