ExpandedControl: stub ad info box
This commit is contained in:
parent
0cbf1d911e
commit
6a1ec6c906
4 changed files with 110 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../cast.dart';
|
import '../../../../cast.dart';
|
||||||
|
import 'ExpandedControlsBasicButton.dart';
|
||||||
import 'ExpandedControlsConnectedDeviceLabel.dart';
|
import 'ExpandedControlsConnectedDeviceLabel.dart';
|
||||||
|
import 'ExpandedControlsHighlightedText.dart';
|
||||||
|
import 'ExpandedControlsInfoTextBox.dart';
|
||||||
import 'ExpandedControlsPlayer.dart';
|
import 'ExpandedControlsPlayer.dart';
|
||||||
import 'ExpandedControlsProgress.dart';
|
import 'ExpandedControlsProgress.dart';
|
||||||
import 'ExpandedControlsToolbar.dart';
|
import 'ExpandedControlsToolbar.dart';
|
||||||
|
|
@ -185,6 +188,27 @@ class _ExpandedControlsState extends State<ExpandedControls> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Widget> _getAdInfoBox() {
|
||||||
|
return [
|
||||||
|
const Spacer(flex: 2),
|
||||||
|
const ExpandedControlsHighlightedText(
|
||||||
|
text: "Ad Title", // TODO: retrieve ad title from API
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
const Expanded(
|
||||||
|
flex: 8,
|
||||||
|
child: ExpandedControlsInfoTextBox(
|
||||||
|
text: "Ad in progress...", // TODO: localize label
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(flex: 1),
|
||||||
|
ExpandedControlsBasicButton(
|
||||||
|
text: "Skip Ad", // TODO: localize label
|
||||||
|
onPressed: () {/* TODO: skip ad */},
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
Widget _getFullControls(BuildContext context, MediaInfo? mediaInfo) {
|
Widget _getFullControls(BuildContext context, MediaInfo? mediaInfo) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|
@ -194,7 +218,7 @@ class _ExpandedControlsState extends State<ExpandedControls> {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_getDecoratedToolbar(mediaInfo),
|
_getDecoratedToolbar(mediaInfo),
|
||||||
Spacer(),
|
..._getAdInfoBox(), // TODO: check if is playing ad, otherwise -> Spacer(),
|
||||||
_getDecoratedControls(context, mediaInfo),
|
_getDecoratedControls(context, mediaInfo),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ExpandedControlsBasicButton extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
final VoidCallback? onPressed;
|
||||||
|
|
||||||
|
const ExpandedControlsBasicButton({
|
||||||
|
Key? key,
|
||||||
|
this.text = "",
|
||||||
|
this.onPressed,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return OutlinedButton(
|
||||||
|
onPressed: this.onPressed,
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
primary: Colors.white,
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
shape: const RoundedRectangleBorder(),
|
||||||
|
side: BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(text),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
class ExpandedControlsHighlightedText extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
const ExpandedControlsHighlightedText({
|
||||||
|
Key? key,
|
||||||
|
this.text = "",
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.amber,
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: Text(
|
||||||
|
this.text,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ExpandedControlsInfoTextBox extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
const ExpandedControlsInfoTextBox({
|
||||||
|
Key? key,
|
||||||
|
this.text = "",
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
this.text,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue