MiniController initial stub implementation

This commit is contained in:
gianlucaparadise 2022-01-13 06:36:11 +01:00
parent 1a1b1b06c3
commit 54153126bd
4 changed files with 146 additions and 1 deletions

View file

@ -171,7 +171,12 @@ class _MyAppState extends State<MyApp> {
child: Text('Expanded Controls'),
onPressed: _openExpandedControls,
),
)
),
_buildTitle("Mini Controller"),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: MiniController(),
),
],
),
),

View file

@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:flutter_cast_framework/src/cast/widgets/mini_controller/TransparentImage.dart';
class MiniController extends StatelessWidget {
const MiniController({Key? key}) : super(key: key);
void _onPausePressed() {}
@override
Widget build(BuildContext context) {
final thumbnail = AspectRatio(
aspectRatio: 1,
child: FadeInImage.memoryNetwork(
fit: BoxFit.cover,
placeholder: kTransparentImage,
image:
"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/images/480x270/BigBuckBunny.jpg",
),
);
final title = Text(
"this.title",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontWeight: FontWeight.w500),
);
final subtitle = Text(
"this.subtitle",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.grey),
);
final playPauseButton = IconButton(
padding: EdgeInsets.zero,
onPressed: _onPausePressed,
icon: Icon(Icons.pause, color: Colors.black, size: 38),
);
return Stack(
children: [
SizedBox(
height: 60,
child: Row(
children: [
thumbnail,
Container(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
title,
subtitle,
],
),
),
playPauseButton,
],
),
),
LinearProgressIndicator(
color: Colors.red,
backgroundColor: Colors.transparent,
value: 0.1,
),
],
);
}
}

View file

@ -0,0 +1,68 @@
import 'dart:typed_data';
final Uint8List kTransparentImage = new Uint8List.fromList(<int>[
0x89,
0x50,
0x4E,
0x47,
0x0D,
0x0A,
0x1A,
0x0A,
0x00,
0x00,
0x00,
0x0D,
0x49,
0x48,
0x44,
0x52,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x01,
0x08,
0x06,
0x00,
0x00,
0x00,
0x1F,
0x15,
0xC4,
0x89,
0x00,
0x00,
0x00,
0x0A,
0x49,
0x44,
0x41,
0x54,
0x78,
0x9C,
0x63,
0x00,
0x01,
0x00,
0x00,
0x05,
0x00,
0x01,
0x0D,
0x0A,
0x2D,
0xB4,
0x00,
0x00,
0x00,
0x00,
0x49,
0x45,
0x4E,
0x44,
0xAE,
]);

View file

@ -7,3 +7,5 @@ export 'src/cast/widgets/expanded_controls/ExpandedControlsPlayer.dart';
export 'src/cast/widgets/expanded_controls/ExpandedControlsProgress.dart';
export 'src/cast/widgets/expanded_controls/ExpandedControlsToolbar.dart';
export 'src/cast/widgets/expanded_controls/ExpandedControlsConnectedDeviceLabel.dart';
export 'src/cast/widgets/mini_controller/MiniController.dart';