Skip to content

Commit

Permalink
- Removed leading underscores for local identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
luis901101 committed Sep 9, 2022
1 parent d0658bc commit 0042096
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/src/cupertino/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ class _CupertinoControlsState extends State<CupertinoControls>

@override
void didChangeDependencies() {
final _oldController = _chewieController;
final oldController = _chewieController;
_chewieController = ChewieController.of(context);
controller = chewieController.videoPlayerController;

if (_oldController != chewieController) {
if (oldController != chewieController) {
_dispose();
_initialize();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class _MaterialControlsState extends State<MaterialControls>

@override
void didChangeDependencies() {
final _oldController = _chewieController;
final oldController = _chewieController;
_chewieController = ChewieController.of(context);
controller = chewieController.videoPlayerController;

if (_oldController != chewieController) {
if (oldController != chewieController) {
_dispose();
_initialize();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/material/material_desktop_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>

@override
void didChangeDependencies() {
final _oldController = _chewieController;
final oldController = _chewieController;
_chewieController = ChewieController.of(context);
controller = chewieController.videoPlayerController;

if (_oldController != chewieController) {
if (oldController != chewieController) {
_dispose();
_initialize();
}
Expand Down
10 changes: 5 additions & 5 deletions lib/src/material/widgets/playback_speed_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class PlaybackSpeedDialog extends StatelessWidget {
shrinkWrap: true,
physics: const ScrollPhysics(),
itemBuilder: (context, index) {
final _speed = _speeds[index];
final speed = _speeds[index];
return ListTile(
dense: true,
title: Row(
children: [
if (_speed == _selected)
if (speed == _selected)
Icon(
Icons.check,
size: 20.0,
Expand All @@ -34,12 +34,12 @@ class PlaybackSpeedDialog extends StatelessWidget {
else
Container(width: 20.0),
const SizedBox(width: 16.0),
Text(_speed.toString()),
Text(speed.toString()),
],
),
selected: _speed == _selected,
selected: speed == _selected,
onTap: () {
Navigator.of(context).pop(_speed);
Navigator.of(context).pop(speed);
},
);
},
Expand Down
14 changes: 7 additions & 7 deletions lib/src/player_with_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class PlayerWithControls extends StatelessWidget {
Widget build(BuildContext context) {
final ChewieController chewieController = ChewieController.of(context);

double _calculateAspectRatio(BuildContext context) {
double calculateAspectRatio(BuildContext context) {
final size = MediaQuery.of(context).size;
final width = size.width;
final height = size.height;

return width > height ? width / height : height / width;
}

Widget _buildControls(
Widget buildControls(
BuildContext context,
ChewieController chewieController,
) {
Expand All @@ -29,7 +29,7 @@ class PlayerWithControls extends StatelessWidget {
: const SizedBox();
}

Widget _buildPlayerWithControls(
Widget buildPlayerWithControls(
ChewieController chewieController,
BuildContext context,
) {
Expand Down Expand Up @@ -73,11 +73,11 @@ class PlayerWithControls extends StatelessWidget {
),
),
if (!chewieController.isFullScreen)
_buildControls(context, chewieController)
buildControls(context, chewieController)
else
SafeArea(
bottom: false,
child: _buildControls(context, chewieController),
child: buildControls(context, chewieController),
),
],
);
Expand All @@ -88,8 +88,8 @@ class PlayerWithControls extends StatelessWidget {
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: AspectRatio(
aspectRatio: _calculateAspectRatio(context),
child: _buildPlayerWithControls(chewieController, context),
aspectRatio: calculateAspectRatio(context),
child: buildPlayerWithControls(chewieController, context),
),
),
);
Expand Down

0 comments on commit 0042096

Please sign in to comment.