3

Here is my issue, i am trying to achieve video background player instead og my image background i tried with gif but render is just in 256 colours. thanks very much I 'have been pulling my hair to integrate with no success


class Login extends StatelessWidget {
static const your_client_id = '0000000000000000';
final FirebaseAuth _auth = FirebaseAuth.instance;
static const your_redirect_url =
'https://xxxxxxx.firebaseapp.com/__/auth/handler';

final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();

@override
Widget build(BuildContext context) {
  return WillPopScope(
    child: Scaffold(

  backgroundColor: Colors.white,
  body: Container(
  constraints: BoxConstraints.expand(),
  decoration: BoxDecoration(
  image: DecorationImage(
  image: AssetImage("asset/images/bg.jpg"),
  fit: BoxFit.cover,
  )
  ),

Trying to replace my container content with this code i dont know if its the right thing to do

Container(
 width: *screen width*,
 height: *screen height*,
 child: Stack(
   children: <Widget>[
     Center(
       child: Transform.scale(
         scale: 3.9, //change this number as needed
         AspectRatio(
           aspectRatio: _controller.value.aspectRatio,
           child: VideoPlayer(_controller),
         ),
       ),
     ),
Julien leburn
  • 77
  • 1
  • 11

1 Answers1

1

You can use stack to have your video play in the background while in loop, while your other widget is at the top of the stack.

This person solved it please refer to his answer https://stackoverflow.com/a/57763089/8572736

Musa Jahun
  • 66
  • 1
  • 6