creating a backround image in flutter

 import 'package:flutter/material.dart';


class Camera extends StatelessWidget {
const Camera ({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: double.infinity,
width: double.infinity,
decoration: const BoxDecoration(
image: DecorationImage(
image:AssetImage('assets/images/bg.png'),fit: BoxFit.cover
),
),
child: const Center(child: Text('Camera Coming Soon!!',style: TextStyle(fontSize: 30,color: Colors.white ),),),

),
);
}
}

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

Learning stage | c++ programs

c++ basic question