Skip to content

Commit e6cbbba

Browse files
authored
Maintenance (#41)
* Update lints * Fix lint errors * Apply dart format -l 120
1 parent 6e0ca6d commit e6cbbba

File tree

77 files changed

+499
-689
lines changed

Some content is hidden

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

77 files changed

+499
-689
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ name: Build
1616

1717
on:
1818
push:
19-
branches: [ main ]
19+
branches: [main]
2020
pull_request:
21-
branches: [ main ]
21+
branches: [main]
2222

2323
jobs:
2424
dart-format-and-analyze-check:
@@ -29,15 +29,15 @@ jobs:
2929
- uses: actions/checkout@v2
3030
- uses: actions/setup-java@v1
3131
with:
32-
java-version: '17.x'
32+
java-version: "17.x"
3333
- uses: actions/checkout@v2
3434
- uses: subosito/flutter-action@v2
3535
with:
36-
channel: 'stable'
36+
channel: "stable"
3737
- name: Install project dependencies
3838
run: flutter pub get
3939
- name: Dart Format Check
40-
run: dart format lib/ test/ --set-exit-if-changed
40+
run: dart format lib/ test/ --set-exit-if-changed -l 120
4141
- name: Import Sorter Check
4242
run: dart run import_sorter:main --no-comments --exit-if-changed
4343
- name: Dart Analyze Check
@@ -51,11 +51,11 @@ jobs:
5151
- uses: actions/checkout@v2
5252
- uses: actions/setup-java@v1
5353
with:
54-
java-version: '17.x'
54+
java-version: "17.x"
5555
- uses: actions/checkout@v2
5656
- uses: subosito/flutter-action@v2
5757
with:
58-
channel: 'stable'
58+
channel: "stable"
5959
- name: Install project dependencies
6060
run: flutter pub get
6161
- name: Build for Android
@@ -70,7 +70,7 @@ jobs:
7070
- uses: actions/checkout@v2
7171
- uses: subosito/flutter-action@v2
7272
with:
73-
channel: 'stable'
73+
channel: "stable"
7474
- name: Install project dependencies
7575
run: flutter pub get
7676
- name: Build for iOS
@@ -85,7 +85,7 @@ jobs:
8585
- uses: actions/checkout@v2
8686
- uses: subosito/flutter-action@v1
8787
with:
88-
channel: 'stable'
88+
channel: "stable"
8989
- name: Install project dependencies
9090
run: flutter pub get
9191
- name: Build for Windows
@@ -100,7 +100,7 @@ jobs:
100100
- uses: actions/checkout@v2
101101
- uses: subosito/flutter-action@v1
102102
with:
103-
channel: 'stable'
103+
channel: "stable"
104104
- name: Install project dependencies
105105
run: flutter pub get
106106
- name: Build for macOS
@@ -115,11 +115,11 @@ jobs:
115115
- uses: actions/checkout@v2
116116
- uses: actions/setup-java@v1
117117
with:
118-
java-version: '12.x'
118+
java-version: "12.x"
119119
- uses: actions/checkout@v2
120120
- uses: subosito/flutter-action@v2
121121
with:
122-
channel: 'stable'
122+
channel: "stable"
123123
- name: Install project dependencies
124124
run: flutter pub get
125125
- name: Run apt update
@@ -138,11 +138,11 @@ jobs:
138138
- uses: actions/checkout@v2
139139
- uses: actions/setup-java@v1
140140
with:
141-
java-version: '12.x'
141+
java-version: "12.x"
142142
- uses: actions/checkout@v2
143143
- uses: subosito/flutter-action@v2
144144
with:
145-
channel: 'stable'
145+
channel: "stable"
146146
- name: Install project dependencies
147147
run: flutter pub get
148148
- name: Build for Web

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: Publish to pub.dev
1717
on:
1818
push:
1919
tags:
20-
- 'v[0-9]+.[0-9]+.[0-9]+*'
20+
- "v[0-9]+.[0-9]+.[0-9]+*"
2121

2222
jobs:
2323
publish:

analysis_options.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
include: package:lints/recommended.yaml
1+
include: package:flutter_lints/flutter.yaml
22

33
analyzer:
44
errors:
55
constant_identifier_names: ignore
6-
must_be_immutable: ignore
76
no_wildcard_variable_uses: ignore
87
use_super_parameters: ignore
8+
avoid_print: ignore
99

1010
linter:
1111
rules:
12-
#
13-
# Additional recommended rules
14-
#
12+
# Preference of the SDK
1513
prefer_single_quotes: true
14+
prefer_final_locals: true
1615
unnecessary_brace_in_string_interps: false
16+
avoid_print: true
17+
18+
# Enforce this for correct async logic
1719
unawaited_futures: true
18-
depend_on_referenced_packages: false
20+
discarded_futures: true
21+
22+
formatter:
23+
page_width: 120
24+
trailing_commas: preserve

dart_dependency_validator.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# dart_dependency_validator.yaml
2+
3+
# Set true if you allow pinned packages in your project.
4+
allow_pins: true
5+
6+
# Exclude one or more paths from being scanned. Supports glob syntax.
7+
exclude:
8+
- "./example/**"

example/analysis_options.yaml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
1+
include: package:flutter_lints/flutter.yaml
72

8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
103
analyzer:
114
errors:
12-
must_be_immutable: ignore
13-
include: package:flutter_lints/flutter.yaml
5+
constant_identifier_names: ignore
6+
no_wildcard_variable_uses: ignore
7+
use_super_parameters: ignore
8+
avoid_print: ignore
149

1510
linter:
16-
# The lint rules applied to this project can be customized in the
17-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
18-
# included above or to enable additional rules. A list of all available lints
19-
# and their documentation is published at https://dart.dev/lints.
20-
#
21-
# Instead of disabling a lint rule for the entire project in the
22-
# section below, it can also be suppressed for a single line of code
23-
# or a specific dart file by using the `// ignore: name_of_lint` and
24-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
25-
# producing the lint.
2611
rules:
27-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
28-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
12+
# Preference of the SDK
13+
prefer_single_quotes: true
14+
prefer_final_locals: true
15+
unnecessary_brace_in_string_interps: false
16+
avoid_print: true
17+
18+
# Enforce this for correct async logic
19+
unawaited_futures: true
20+
discarded_futures: true
2921

30-
# Additional information about this file can be found at
31-
# https://dart.dev/guides/language/analysis-options
22+
formatter:
23+
page_width: 120
24+
trailing_commas: preserve

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.1.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
21+
id "com.android.application" version "8.7.2" apply false
22+
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
2323
}
2424

2525
include ":app"

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
456456
GCC_WARN_UNUSED_FUNCTION = YES;
457457
GCC_WARN_UNUSED_VARIABLE = YES;
458-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
458+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
459459
MTL_ENABLE_DEBUG_INFO = NO;
460460
SDKROOT = iphoneos;
461461
SUPPORTED_PLATFORMS = iphoneos;
@@ -584,7 +584,7 @@
584584
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
585585
GCC_WARN_UNUSED_FUNCTION = YES;
586586
GCC_WARN_UNUSED_VARIABLE = YES;
587-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
587+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
588588
MTL_ENABLE_DEBUG_INFO = YES;
589589
ONLY_ACTIVE_ARCH = YES;
590590
SDKROOT = iphoneos;
@@ -635,7 +635,7 @@
635635
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
636636
GCC_WARN_UNUSED_FUNCTION = YES;
637637
GCC_WARN_UNUSED_VARIABLE = YES;
638-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
638+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
639639
MTL_ENABLE_DEBUG_INFO = NO;
640640
SDKROOT = iphoneos;
641641
SUPPORTED_PLATFORMS = iphoneos;

example/lib/main.dart

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ class _MyHomePageState extends State<MyHomePage> {
115115
},
116116
),
117117
builder: (context, roomCtx) {
118-
var deviceScreenType = getDeviceType(MediaQuery.of(context).size);
118+
final deviceScreenType = getDeviceType(MediaQuery.of(context).size);
119119
return Scaffold(
120120
appBar: AppBar(
121-
title: const Text('LiveKit Components',
122-
style: TextStyle(color: Colors.white)),
121+
title: const Text('LiveKit Components', style: TextStyle(color: Colors.white)),
123122
actions: [
124123
/// show clear pin button
125124
if (roomCtx.connected) const ClearPinButton(),
@@ -141,16 +140,13 @@ class _MyHomePageState extends State<MyHomePage> {
141140
Row(
142141
children: [
143142
/// show chat widget on mobile
144-
(deviceScreenType == DeviceScreenType.mobile &&
145-
roomCtx.isChatEnabled)
143+
(deviceScreenType == DeviceScreenType.mobile && roomCtx.isChatEnabled)
146144
? Expanded(
147145
child: ChatBuilder(
148-
builder:
149-
(context, enabled, chatCtx, messages) {
146+
builder: (context, enabled, chatCtx, messages) {
150147
return ChatWidget(
151148
messages: messages,
152-
onSend: (message) =>
153-
chatCtx.sendMessage(message),
149+
onSend: (message) => chatCtx.sendMessage(message),
154150
onClose: () {
155151
chatCtx.toggleChat(false);
156152
},
@@ -179,37 +175,28 @@ class _MyHomePageState extends State<MyHomePage> {
179175
showParticipantPlaceholder: true,
180176

181177
/// layout builder
182-
layoutBuilder:
183-
roomCtx.pinnedTracks.isNotEmpty
184-
? const CarouselLayoutBuilder()
185-
: const GridLayoutBuilder(),
178+
layoutBuilder: roomCtx.pinnedTracks.isNotEmpty
179+
? const CarouselLayoutBuilder()
180+
: const GridLayoutBuilder(),
186181

187182
/// participant builder
188-
participantTrackBuilder:
189-
(context, identifier) {
183+
participantTrackBuilder: (context, identifier) {
190184
// build participant widget for each Track
191185
return Padding(
192186
padding: const EdgeInsets.all(2.0),
193187
child: Stack(
194188
children: [
195189
/// video track widget in the background
196-
identifier.isAudio &&
197-
roomCtx
198-
.enableAudioVisulizer
190+
identifier.isAudio && roomCtx.enableAudioVisulizer
199191
? const AudioVisualizerWidget(
200-
backgroundColor:
201-
LKColors.lkDarkBlue,
192+
backgroundColor: LKColors.lkDarkBlue,
202193
)
203194
: IsSpeakingIndicator(
204-
builder: (context,
205-
isSpeaking) {
206-
return isSpeaking !=
207-
null
195+
builder: (context, isSpeaking) {
196+
return isSpeaking != null
208197
? IsSpeakingIndicatorWidget(
209-
isSpeaking:
210-
isSpeaking,
211-
child:
212-
const VideoTrackWidget(),
198+
isSpeaking: isSpeaking,
199+
child: const VideoTrackWidget(),
213200
)
214201
: const VideoTrackWidget();
215202
},
@@ -254,19 +241,16 @@ class _MyHomePageState extends State<MyHomePage> {
254241
),
255242

256243
/// show chat widget on desktop
257-
(deviceScreenType != DeviceScreenType.mobile &&
258-
roomCtx.isChatEnabled)
244+
(deviceScreenType != DeviceScreenType.mobile && roomCtx.isChatEnabled)
259245
? Expanded(
260246
flex: 2,
261247
child: SizedBox(
262248
width: 400,
263249
child: ChatBuilder(
264-
builder:
265-
(context, enabled, chatCtx, messages) {
250+
builder: (context, enabled, chatCtx, messages) {
266251
return ChatWidget(
267252
messages: messages,
268-
onSend: (message) =>
269-
chatCtx.sendMessage(message),
253+
onSend: (message) => chatCtx.sendMessage(message),
270254
onClose: () {
271255
chatCtx.toggleChat(false);
272256
},

0 commit comments

Comments
 (0)