Skip to content

Commit 5d61bf8

Browse files
Merge pull request #403 from solid-oleksandrhordiienko/add-action-and-lint
Add actions & lint
2 parents fa216bf + 5ee76d2 commit 5d61bf8

35 files changed

+1558
-1191
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Library ON Push & PR DO Code check
2+
on: [push, pull_request]
3+
4+
jobs:
5+
code-check:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v1
10+
11+
- name: Setup flutter
12+
uses: subosito/flutter-action@v2
13+
with:
14+
channel: 'stable'
15+
16+
- name: Check flutter sdk version
17+
run: flutter --version
18+
19+
- name: Get dependencies
20+
working-directory: ./flutter_vlc_player
21+
run: flutter pub get
22+
23+
- name: Setup Dart Code Metrics
24+
working-directory: ./flutter_vlc_player
25+
run: dart pub get dart_code_metrics
26+
27+
- name: Dart Code Metrics
28+
working-directory: ./flutter_vlc_player
29+
run: |
30+
dirs_to_analyze=""
31+
if [ -d lib ]; then dirs_to_analyze+=" lib"; fi
32+
if [ -d test ]; then dirs_to_analyze+=" test"; fi
33+
if [ -d example ]; then dirs_to_analyze+=" example"; fi
34+
if [ dirs_to_analyze != "" ]
35+
then
36+
dart run dart_code_metrics:metrics \
37+
analyze \
38+
$dirs_to_analyze \
39+
--fatal-warnings \
40+
--fatal-performance \
41+
--fatal-style
42+
dart run dart_code_metrics:metrics \
43+
check-unused-files \
44+
$dirs_to_analyze \
45+
--fatal-unused
46+
fi
47+
- name: Check formatting
48+
run: dart format . --set-exit-if-changed
49+
50+
- name: Run tests
51+
run: |
52+
# run tests if `test` folder exists
53+
if [ -d test ]
54+
then
55+
flutter test -r expanded
56+
else
57+
echo "Tests not found."
58+
fi
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Interface ON Push & PR DO Code check
2+
on: [push, pull_request]
3+
4+
jobs:
5+
code-check:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v1
10+
11+
- name: Setup flutter
12+
uses: subosito/flutter-action@v2
13+
with:
14+
channel: 'stable'
15+
16+
- name: Check flutter sdk version
17+
working-directory: ./flutter_vlc_player_platform_interface
18+
run: flutter --version
19+
20+
- name: Get dependencies
21+
working-directory: ./flutter_vlc_player_platform_interface
22+
run: flutter pub get
23+
24+
- name: Setup Dart Code Metrics
25+
working-directory: ./flutter_vlc_player_platform_interface
26+
run: dart pub get dart_code_metrics
27+
28+
- name: Dart Code Metrics
29+
working-directory: ./flutter_vlc_player_platform_interface
30+
run: |
31+
dirs_to_analyze=""
32+
if [ -d lib ]; then dirs_to_analyze+=" lib"; fi
33+
if [ -d test ]; then dirs_to_analyze+=" test"; fi
34+
if [ -d example ]; then dirs_to_analyze+=" example"; fi
35+
if [ dirs_to_analyze != "" ]
36+
then
37+
dart run dart_code_metrics:metrics \
38+
analyze \
39+
$dirs_to_analyze \
40+
--fatal-warnings \
41+
--fatal-performance \
42+
--fatal-style
43+
dart run dart_code_metrics:metrics \
44+
check-unused-files \
45+
$dirs_to_analyze \
46+
--fatal-unused
47+
fi
48+
- name: Check formatting
49+
working-directory: ./flutter_vlc_player_platform_interface
50+
run: dart format . --set-exit-if-changed
51+
52+
- name: Run tests
53+
working-directory: ./flutter_vlc_player_platform_interface
54+
run: |
55+
# run tests if `test` folder exists
56+
if [ -d test ]
57+
then
58+
flutter test -r expanded
59+
else
60+
echo "Tests not found."
61+
fi
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
include: package:flutter_lints/flutter.yaml
1+
include: package:solid_lints/analysis_options.yaml
2+
3+
dart_code_metrics:
4+
metrics:
5+
cyclomatic-complexity: 30
6+
7+
linter:
8+
rules:
9+
lines_longer_than_80_chars: false
10+
comment_references: false
11+
public_member_api_docs: false
12+
avoid_positional_boolean_parameters: false

flutter_vlc_player/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -211,6 +211,7 @@
211211
/* Begin PBXShellScriptBuildPhase section */
212212
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
213213
isa = PBXShellScriptBuildPhase;
214+
alwaysOutOfDate = 1;
214215
buildActionMask = 2147483647;
215216
files = (
216217
);
@@ -264,6 +265,7 @@
264265
};
265266
9740EEB61CF901F6004384FC /* Run Script */ = {
266267
isa = PBXShellScriptBuildPhase;
268+
alwaysOutOfDate = 1;
267269
buildActionMask = 2147483647;
268270
files = (
269271
);

flutter_vlc_player/example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@
5454
</array>
5555
<key>UIViewControllerBasedStatusBarAppearance</key>
5656
<false/>
57+
<key>UIApplicationSupportsIndirectInputEvents</key>
58+
<true/>
5759
</dict>
5860
</plist>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_vlc_player_example/multiple_tab.dart';
3+
import 'package:flutter_vlc_player_example/single_tab.dart';
4+
5+
class App extends StatefulWidget {
6+
@override
7+
_AppState createState() => _AppState();
8+
}
9+
10+
class _AppState extends State<App> {
11+
static const _tabCount = 2;
12+
13+
@override
14+
Widget build(BuildContext context) {
15+
return DefaultTabController(
16+
length: _tabCount,
17+
child: Scaffold(
18+
appBar: AppBar(
19+
centerTitle: true,
20+
title: const Text('Vlc Player Example'),
21+
bottom: const TabBar(
22+
tabs: [
23+
Tab(text: 'Single'),
24+
Tab(text: 'Multiple'),
25+
],
26+
),
27+
),
28+
body: TabBarView(
29+
physics: const NeverScrollableScrollPhysics(),
30+
children: [
31+
SingleTab(),
32+
MultipleTab(),
33+
],
34+
),
35+
),
36+
);
37+
}
38+
}

flutter_vlc_player/example/lib/controls_overlay.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import 'package:flutter/material.dart';
2+
23
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
34

45
class ControlsOverlay extends StatelessWidget {
5-
const ControlsOverlay({Key key, this.controller}) : super(key: key);
6-
7-
final VlcPlayerController controller;
8-
96
static const double _playButtonIconSize = 80;
107
static const double _replayButtonIconSize = 100;
118
static const double _seekButtonIconSize = 48;
@@ -15,11 +12,15 @@ class ControlsOverlay extends StatelessWidget {
1512

1613
static const Color _iconColor = Colors.white;
1714

15+
final VlcPlayerController controller;
16+
17+
const ControlsOverlay({Key key, this.controller}) : super(key: key);
18+
1819
@override
1920
Widget build(BuildContext context) {
2021
return AnimatedSwitcher(
21-
duration: Duration(milliseconds: 50),
22-
reverseDuration: Duration(milliseconds: 200),
22+
duration: const Duration(milliseconds: 50),
23+
reverseDuration: const Duration(milliseconds: 200),
2324
child: Builder(
2425
builder: (ctx) {
2526
if (controller.value.isEnded || controller.value.hasError) {
@@ -29,7 +30,7 @@ class ControlsOverlay extends StatelessWidget {
2930
onPressed: _replay,
3031
color: _iconColor,
3132
iconSize: _replayButtonIconSize,
32-
icon: Icon(Icons.replay),
33+
icon: const Icon(Icons.replay),
3334
),
3435
),
3536
);
@@ -40,7 +41,7 @@ class ControlsOverlay extends StatelessWidget {
4041
case PlayingState.stopped:
4142
case PlayingState.paused:
4243
return SizedBox.expand(
43-
child: Container(
44+
child: ColoredBox(
4445
color: Colors.black45,
4546
child: FittedBox(
4647
child: Row(
@@ -51,19 +52,19 @@ class ControlsOverlay extends StatelessWidget {
5152
onPressed: () => _seekRelative(_seekStepBackward),
5253
color: _iconColor,
5354
iconSize: _seekButtonIconSize,
54-
icon: Icon(Icons.replay_10),
55+
icon: const Icon(Icons.replay_10),
5556
),
5657
IconButton(
5758
onPressed: _play,
5859
color: _iconColor,
5960
iconSize: _playButtonIconSize,
60-
icon: Icon(Icons.play_arrow),
61+
icon: const Icon(Icons.play_arrow),
6162
),
6263
IconButton(
6364
onPressed: () => _seekRelative(_seekStepForward),
6465
color: _iconColor,
6566
iconSize: _seekButtonIconSize,
66-
icon: Icon(Icons.forward_10),
67+
icon: const Icon(Icons.forward_10),
6768
),
6869
],
6970
),
@@ -88,13 +89,13 @@ class ControlsOverlay extends StatelessWidget {
8889
onPressed: _replay,
8990
color: _iconColor,
9091
iconSize: _replayButtonIconSize,
91-
icon: Icon(Icons.replay),
92+
icon: const Icon(Icons.replay),
9293
),
9394
),
9495
);
9596

9697
default:
97-
return SizedBox.shrink();
98+
return const SizedBox.shrink();
9899
}
99100
},
100101
),
Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'multiple_tab.dart';
3-
import 'single_tab.dart';
2+
import 'package:flutter_vlc_player_example/app.dart';
43

54
void main() {
65
runApp(
@@ -9,36 +8,3 @@ void main() {
98
),
109
);
1110
}
12-
13-
class App extends StatefulWidget {
14-
@override
15-
_AppState createState() => _AppState();
16-
}
17-
18-
class _AppState extends State<App> {
19-
@override
20-
Widget build(BuildContext context) {
21-
return DefaultTabController(
22-
length: 2,
23-
child: Scaffold(
24-
appBar: AppBar(
25-
centerTitle: true,
26-
title: Text('Vlc Player Example'),
27-
bottom: TabBar(
28-
tabs: [
29-
Tab(text: 'Single'),
30-
Tab(text: 'Multiple'),
31-
],
32-
),
33-
),
34-
body: TabBarView(
35-
physics: NeverScrollableScrollPhysics(),
36-
children: [
37-
SingleTab(),
38-
MultipleTab(),
39-
],
40-
),
41-
),
42-
);
43-
}
44-
}

0 commit comments

Comments
 (0)