Advertisement
Guest User

Flutter: Container

a guest
Aug 23rd, 2018
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.00 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() {
  4.   runApp(new MaterialApp(
  5.     title: "Coba container",
  6.     home: new Home(),
  7.   ));
  8. }
  9.  
  10. class Home extends StatelessWidget {
  11.   @override
  12.   Widget build(BuildContext context) {
  13.     return new Scaffold(
  14.         body: new Container(
  15.           child: new Text("Saya anaknya container", style: new TextStyle( color: Colors.white, fontSize: 20.0),),
  16.       // color: Colors.yellowAccent,
  17.       width: 300.0,
  18.       height: 300.0,
  19.       padding: const EdgeInsets.all(50.0),
  20.       margin: const EdgeInsets.all(20.0),
  21.       alignment: Alignment.center,
  22.       decoration: new BoxDecoration(
  23.           color: Colors.purpleAccent,
  24.           boxShadow: [
  25.             const BoxShadow(
  26.                 color: const Color(0xFF000000),
  27.                 offset: Offset.zero,
  28.                 blurRadius: 5.0),
  29.           ],
  30.           gradient: new LinearGradient(
  31.             colors: [Colors.purpleAccent, Colors.deepPurpleAccent],
  32.           )),
  33.     ));
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement