Skip to content

Commit 79288a2

Browse files
authored
Update flutter_tizen_plugin_tools and code format (#860)
1 parent 061b2ec commit 79288a2

File tree

184 files changed

+2759
-2849
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

+2759
-2849
lines changed

.github/workflows/analyze.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ jobs:
2525
sudo apt-get update
2626
sudo apt-get install clang-format-11
2727
- name: Check format
28-
run: ./tools/tools_runner.sh format --fail-on-change --clang-format=clang-format-11
28+
run: |
29+
./tools/tools_runner.sh format --fail-on-change --no-kotlin --no-java --no-swift --clang-format-path=clang-format-11

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ build/
4949

5050
# Downloaded by the plugin tools.
5151
google-java-format-1.3-all-deps.jar
52+
ktfmt-0.46-jar-with-dependencies.jar

packages/audioplayers/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Update code format.
4+
15
## 3.1.1
26

37
* Update audioplayers to 6.4.0.

packages/audioplayers/example/lib/components/drop_down.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ class CustomDropDown<T> extends StatelessWidget {
4747
isExpanded: isExpanded,
4848
value: selected,
4949
onChanged: onChange,
50-
items:
51-
options.entries
52-
.map<DropdownMenuItem<T>>(
53-
(entry) => DropdownMenuItem<T>(
54-
value: entry.key,
55-
child: Text(entry.value),
56-
),
57-
)
58-
.toList(),
50+
items: options.entries
51+
.map<DropdownMenuItem<T>>(
52+
(entry) => DropdownMenuItem<T>(
53+
value: entry.key,
54+
child: Text(entry.value),
55+
),
56+
)
57+
.toList(),
5958
);
6059
}
6160
}

packages/audioplayers/example/lib/components/player_widget.dart

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class _PlayerWidgetState extends State<PlayerWidget> {
4141
// Use initial values from player
4242
_playerState = player.state;
4343
player.getDuration().then(
44-
(value) => setState(() {
45-
_duration = value;
46-
}),
47-
);
44+
(value) => setState(() {
45+
_duration = value;
46+
}),
47+
);
4848
player.getCurrentPosition().then(
49-
(value) => setState(() {
50-
_position = value;
51-
}),
52-
);
49+
(value) => setState(() {
50+
_position = value;
51+
}),
52+
);
5353
_initStreams();
5454
}
5555

@@ -112,20 +112,19 @@ class _PlayerWidgetState extends State<PlayerWidget> {
112112
final position = value * duration.inMilliseconds;
113113
player.seek(Duration(milliseconds: position.round()));
114114
},
115-
value:
116-
(_position != null &&
117-
_duration != null &&
118-
_position!.inMilliseconds > 0 &&
119-
_position!.inMilliseconds < _duration!.inMilliseconds)
120-
? _position!.inMilliseconds / _duration!.inMilliseconds
121-
: 0.0,
115+
value: (_position != null &&
116+
_duration != null &&
117+
_position!.inMilliseconds > 0 &&
118+
_position!.inMilliseconds < _duration!.inMilliseconds)
119+
? _position!.inMilliseconds / _duration!.inMilliseconds
120+
: 0.0,
122121
),
123122
Text(
124123
_position != null
125124
? '$_positionText / $_durationText'
126125
: _duration != null
127-
? _durationText
128-
: '',
126+
? _durationText
127+
: '',
129128
style: const TextStyle(fontSize: 16.0),
130129
),
131130
],

packages/audioplayers/example/lib/components/stream_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class _StreamWidgetState extends State<StreamWidget> {
2828
streamState = player.state;
2929
player.getDuration().then((it) => setState(() => streamDuration = it));
3030
player.getCurrentPosition().then(
31-
(it) => setState(() => streamPosition = it),
32-
);
31+
(it) => setState(() => streamPosition = it),
32+
);
3333

3434
streams = <StreamSubscription>[
3535
player.onDurationChanged.listen(

packages/audioplayers/example/lib/components/tabs.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ class Tabs extends StatelessWidget {
1515
children: [
1616
TabBar(
1717
labelColor: Colors.black,
18-
tabs:
19-
tabs
20-
.map(
21-
(tData) => Tab(
22-
key: tData.key != null ? Key(tData.key!) : null,
23-
text: tData.label,
24-
),
25-
)
26-
.toList(),
18+
tabs: tabs
19+
.map(
20+
(tData) => Tab(
21+
key: tData.key != null ? Key(tData.key!) : null,
22+
text: tData.label,
23+
),
24+
)
25+
.toList(),
2726
),
2827
Expanded(
2928
child: TabBarView(

packages/audioplayers/example/lib/components/tgl.dart

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ class Tgl extends StatelessWidget {
1616
@override
1717
Widget build(BuildContext context) {
1818
return ToggleButtons(
19-
isSelected:
20-
options.entries
21-
.mapIndexed((index, element) => index == selected)
22-
.toList(),
19+
isSelected: options.entries
20+
.mapIndexed((index, element) => index == selected)
21+
.toList(),
2322
onPressed: onChange,
2423
borderRadius: const BorderRadius.all(Radius.circular(8)),
2524
selectedBorderColor: Theme.of(context).primaryColor,
26-
children:
27-
options.entries
28-
.map(
29-
(entry) => Padding(
30-
padding: const EdgeInsets.all(8),
31-
child: Text(entry.value, key: Key(entry.key)),
32-
),
33-
)
34-
.toList(),
25+
children: options.entries
26+
.map(
27+
(entry) => Padding(
28+
padding: const EdgeInsets.all(8),
29+
child: Text(entry.value, key: Key(entry.key)),
30+
),
31+
)
32+
.toList(),
3533
);
3634
}
3735
}

packages/audioplayers/example/lib/main.dart

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -144,47 +144,45 @@ class _ExampleAppState extends State<_ExampleApp> {
144144
),
145145
),
146146
Expanded(
147-
child:
148-
audioPlayers.isEmpty
149-
? const Text('No AudioPlayer available!')
150-
: IndexedStack(
151-
index: selectedPlayerIdx,
152-
children:
153-
audioPlayers
154-
.map(
155-
(player) => Tabs(
156-
key: GlobalObjectKey(player),
157-
tabs: [
158-
TabData(
159-
key: 'sourcesTab',
160-
label: 'Src',
161-
content: SourcesTab(player: player),
162-
),
163-
TabData(
164-
key: 'controlsTab',
165-
label: 'Ctrl',
166-
content: ControlsTab(player: player),
167-
),
168-
TabData(
169-
key: 'streamsTab',
170-
label: 'Stream',
171-
content: StreamsTab(player: player),
172-
),
173-
TabData(
174-
key: 'audioContextTab',
175-
label: 'Ctx',
176-
content: AudioContextTab(player: player),
177-
),
178-
TabData(
179-
key: 'loggerTab',
180-
label: 'Log',
181-
content: LoggerTab(player: player),
182-
),
183-
],
184-
),
185-
)
186-
.toList(),
187-
),
147+
child: audioPlayers.isEmpty
148+
? const Text('No AudioPlayer available!')
149+
: IndexedStack(
150+
index: selectedPlayerIdx,
151+
children: audioPlayers
152+
.map(
153+
(player) => Tabs(
154+
key: GlobalObjectKey(player),
155+
tabs: [
156+
TabData(
157+
key: 'sourcesTab',
158+
label: 'Src',
159+
content: SourcesTab(player: player),
160+
),
161+
TabData(
162+
key: 'controlsTab',
163+
label: 'Ctrl',
164+
content: ControlsTab(player: player),
165+
),
166+
TabData(
167+
key: 'streamsTab',
168+
label: 'Stream',
169+
content: StreamsTab(player: player),
170+
),
171+
TabData(
172+
key: 'audioContextTab',
173+
label: 'Ctx',
174+
content: AudioContextTab(player: player),
175+
),
176+
TabData(
177+
key: 'loggerTab',
178+
label: 'Log',
179+
content: LoggerTab(player: player),
180+
),
181+
],
182+
),
183+
)
184+
.toList(),
185+
),
188186
),
189187
],
190188
),

packages/audioplayers/example/lib/tabs/audio_context.dart

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -190,72 +190,66 @@ class AudioContextTabState extends State<AudioContextTab>
190190
key: const Key('contentType'),
191191
options: {for (final e in AndroidContentType.values) e: e.name},
192192
selected: audioContext.android.contentType,
193-
onChange:
194-
(v) => updateAudioContextAndroid(
195-
audioContext.android.copy(contentType: v),
196-
),
193+
onChange: (v) => updateAudioContextAndroid(
194+
audioContext.android.copy(contentType: v),
195+
),
197196
),
198197
LabeledDropDown<AndroidUsageType>(
199198
label: 'usageType',
200199
key: const Key('usageType'),
201200
options: {for (final e in AndroidUsageType.values) e: e.name},
202201
selected: audioContext.android.usageType,
203-
onChange:
204-
(v) => updateAudioContextAndroid(
205-
audioContext.android.copy(usageType: v),
206-
),
202+
onChange: (v) => updateAudioContextAndroid(
203+
audioContext.android.copy(usageType: v),
204+
),
207205
),
208206
LabeledDropDown<AndroidAudioFocus?>(
209207
key: const Key('audioFocus'),
210208
label: 'audioFocus',
211209
options: {for (final e in AndroidAudioFocus.values) e: e.name},
212210
selected: audioContext.android.audioFocus,
213-
onChange:
214-
(v) => updateAudioContextAndroid(
215-
audioContext.android.copy(audioFocus: v),
216-
),
211+
onChange: (v) => updateAudioContextAndroid(
212+
audioContext.android.copy(audioFocus: v),
213+
),
217214
),
218215
LabeledDropDown<AndroidAudioMode>(
219216
key: const Key('audioMode'),
220217
label: 'audioMode',
221218
options: {for (final e in AndroidAudioMode.values) e: e.name},
222219
selected: audioContext.android.audioMode,
223-
onChange:
224-
(v) => updateAudioContextAndroid(
225-
audioContext.android.copy(audioMode: v),
226-
),
220+
onChange: (v) => updateAudioContextAndroid(
221+
audioContext.android.copy(audioMode: v),
222+
),
227223
),
228224
],
229225
);
230226
}
231227

232228
Widget _iosTab() {
233-
final iosOptions =
234-
AVAudioSessionOptions.values.map((option) {
235-
final options = {...audioContext.iOS.options};
236-
return Cbx(option.name, value: options.contains(option), ({value}) {
237-
updateAudioContextIOS(() {
238-
final iosContext = audioContext.iOS.copy(options: options);
239-
if (value ?? false) {
240-
options.add(option);
241-
} else {
242-
options.remove(option);
243-
}
244-
return iosContext;
245-
});
246-
});
247-
}).toList();
229+
final iosOptions = AVAudioSessionOptions.values.map((option) {
230+
final options = {...audioContext.iOS.options};
231+
return Cbx(option.name, value: options.contains(option), ({value}) {
232+
updateAudioContextIOS(() {
233+
final iosContext = audioContext.iOS.copy(options: options);
234+
if (value ?? false) {
235+
options.add(option);
236+
} else {
237+
options.remove(option);
238+
}
239+
return iosContext;
240+
});
241+
});
242+
}).toList();
248243
return TabContent(
249244
children: <Widget>[
250245
LabeledDropDown<AVAudioSessionCategory>(
251246
key: const Key('category'),
252247
label: 'category',
253248
options: {for (final e in AVAudioSessionCategory.values) e: e.name},
254249
selected: audioContext.iOS.category,
255-
onChange:
256-
(v) => updateAudioContextIOS(
257-
() => audioContext.iOS.copy(category: v),
258-
),
250+
onChange: (v) => updateAudioContextIOS(
251+
() => audioContext.iOS.copy(category: v),
252+
),
259253
),
260254
...iosOptions,
261255
],

0 commit comments

Comments
 (0)