Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ name: Build

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
dart-format-and-analyze-check:
Expand All @@ -29,15 +29,15 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '17.x'
java-version: "17.x"
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Dart Format Check
run: dart format lib/ test/ --set-exit-if-changed
run: dart format lib/ test/ --set-exit-if-changed -l 120
- name: Import Sorter Check
run: dart run import_sorter:main --no-comments --exit-if-changed
- name: Dart Analyze Check
Expand All @@ -51,11 +51,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '17.x'
java-version: "17.x"
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Build for Android
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Build for iOS
Expand All @@ -85,7 +85,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Build for Windows
Expand All @@ -100,7 +100,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Build for macOS
Expand All @@ -115,11 +115,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
java-version: "12.x"
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Run apt update
Expand All @@ -138,11 +138,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
java-version: "12.x"
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- name: Install project dependencies
run: flutter pub get
- name: Build for Web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Publish to pub.dev
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
publish:
Expand Down
18 changes: 12 additions & 6 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
include: package:lints/recommended.yaml
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
constant_identifier_names: ignore
must_be_immutable: ignore
no_wildcard_variable_uses: ignore
use_super_parameters: ignore
avoid_print: ignore

linter:
rules:
#
# Additional recommended rules
#
# Preference of the SDK
prefer_single_quotes: true
prefer_final_locals: true
unnecessary_brace_in_string_interps: false
avoid_print: true

# Enforce this for correct async logic
unawaited_futures: true
depend_on_referenced_packages: false
discarded_futures: true

formatter:
page_width: 120
trailing_commas: preserve
8 changes: 8 additions & 0 deletions dart_dependency_validator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# dart_dependency_validator.yaml

# Set true if you allow pinned packages in your project.
allow_pins: true

# Exclude one or more paths from being scanned. Supports glob syntax.
exclude:
- "./example/**"
41 changes: 17 additions & 24 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
include: package:flutter_lints/flutter.yaml

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
errors:
must_be_immutable: ignore
include: package:flutter_lints/flutter.yaml
constant_identifier_names: ignore
no_wildcard_variable_uses: ignore
use_super_parameters: ignore
avoid_print: ignore

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Preference of the SDK
prefer_single_quotes: true
prefer_final_locals: true
unnecessary_brace_in_string_interps: false
avoid_print: true

# Enforce this for correct async logic
unawaited_futures: true
discarded_futures: true

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
formatter:
page_width: 120
trailing_commas: preserve
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 @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.android.application" version "8.7.2" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<string>13.0</string>
</dict>
</plist>
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -584,7 +584,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -635,7 +635,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
52 changes: 18 additions & 34 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ class _MyHomePageState extends State<MyHomePage> {
},
),
builder: (context, roomCtx) {
var deviceScreenType = getDeviceType(MediaQuery.of(context).size);
final deviceScreenType = getDeviceType(MediaQuery.of(context).size);
return Scaffold(
appBar: AppBar(
title: const Text('LiveKit Components',
style: TextStyle(color: Colors.white)),
title: const Text('LiveKit Components', style: TextStyle(color: Colors.white)),
actions: [
/// show clear pin button
if (roomCtx.connected) const ClearPinButton(),
Expand All @@ -141,16 +140,13 @@ class _MyHomePageState extends State<MyHomePage> {
Row(
children: [
/// show chat widget on mobile
(deviceScreenType == DeviceScreenType.mobile &&
roomCtx.isChatEnabled)
(deviceScreenType == DeviceScreenType.mobile && roomCtx.isChatEnabled)
? Expanded(
child: ChatBuilder(
builder:
(context, enabled, chatCtx, messages) {
builder: (context, enabled, chatCtx, messages) {
return ChatWidget(
messages: messages,
onSend: (message) =>
chatCtx.sendMessage(message),
onSend: (message) => chatCtx.sendMessage(message),
onClose: () {
chatCtx.toggleChat(false);
},
Expand Down Expand Up @@ -179,37 +175,28 @@ class _MyHomePageState extends State<MyHomePage> {
showParticipantPlaceholder: true,

/// layout builder
layoutBuilder:
roomCtx.pinnedTracks.isNotEmpty
? const CarouselLayoutBuilder()
: const GridLayoutBuilder(),
layoutBuilder: roomCtx.pinnedTracks.isNotEmpty
? const CarouselLayoutBuilder()
: const GridLayoutBuilder(),

/// participant builder
participantTrackBuilder:
(context, identifier) {
participantTrackBuilder: (context, identifier) {
// build participant widget for each Track
return Padding(
padding: const EdgeInsets.all(2.0),
child: Stack(
children: [
/// video track widget in the background
identifier.isAudio &&
roomCtx
.enableAudioVisulizer
identifier.isAudio && roomCtx.enableAudioVisulizer
? const AudioVisualizerWidget(
backgroundColor:
LKColors.lkDarkBlue,
backgroundColor: LKColors.lkDarkBlue,
)
: IsSpeakingIndicator(
builder: (context,
isSpeaking) {
return isSpeaking !=
null
builder: (context, isSpeaking) {
return isSpeaking != null
? IsSpeakingIndicatorWidget(
isSpeaking:
isSpeaking,
child:
const VideoTrackWidget(),
isSpeaking: isSpeaking,
child: const VideoTrackWidget(),
)
: const VideoTrackWidget();
},
Expand Down Expand Up @@ -254,19 +241,16 @@ class _MyHomePageState extends State<MyHomePage> {
),

/// show chat widget on desktop
(deviceScreenType != DeviceScreenType.mobile &&
roomCtx.isChatEnabled)
(deviceScreenType != DeviceScreenType.mobile && roomCtx.isChatEnabled)
? Expanded(
flex: 2,
child: SizedBox(
width: 400,
child: ChatBuilder(
builder:
(context, enabled, chatCtx, messages) {
builder: (context, enabled, chatCtx, messages) {
return ChatWidget(
messages: messages,
onSend: (message) =>
chatCtx.sendMessage(message),
onSend: (message) => chatCtx.sendMessage(message),
onClose: () {
chatCtx.toggleChat(false);
},
Expand Down
Loading
Loading