Search
 
SCRIPT & CODE EXAMPLE
 

DART

background container image flutter

class BaseLayout extends StatelessWidget{
  @override
  Widget build(BuildContext context){
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage("assets/images/bulb.jpg"),
            fit: BoxFit.cover,
          ),
        ),
        child: null /* add child content here */,
      ),
    );
  }
}
Comment

Add background image to container in Flutter

Container(
    decoration: BoxDecoration(
        image: DecorationImage(
            image: NetworkImage('https://placeimg.com/500/500/any'),
            fit: BoxFit.cover,
        ),
    ),
)
Comment

flutter container background image from asset

@override
Widget build(BuildContext context) {
  return DecoratedBox(
    decoration: BoxDecoration(
      image: DecorationImage(image: AssetImage("your_asset"), fit: BoxFit.cover),
    ),
    child: Center(child: FlutterLogo(size: 300)),
  );
}
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter snackbar 
Dart :: if then else inside child in flutter 
Dart :: flutter pub upgrade and save pubspec 
Dart :: flutter textbutton 
Dart :: could not find dart in your flutter sdk. please run 
Dart :: flutter tooltip 
Dart :: textbutton flutter 
Dart :: flutter localstorage clear 
Dart :: flutter auto size text 
Dart :: routes in flutter 
Dart :: flutter icon size 
Dart :: regex dart 
Dart :: how to get image file size in flutter 
Dart :: flutter flatbutton width 
Dart :: flutter counter app with block library 
Dart :: binary tree in dart 
Dart :: flutter pageview show next page 
Dart :: flutter flip card 
Dart :: Avoid `print` calls in production code 
Dart :: dart define value null 
Dart :: widget capture in flutter 
Dart :: search functionality dart 
Dart :: JsonDecoder dart 
Dart :: how to create camera icon in flutter dev 
Dart :: how to change primary color in flutter 
Dart :: flutter elif 
Dart :: flutter download file 
Swift :: swift ui int to binary 
Swift :: swift view float on keyboard show 
Swift :: Change BackgroundColor of Picker ios swift 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =