Sunday, July 2, 2023

Container-Decoration

 Decoration Property is used to set Container.

  1. Border
  2. Border Radius
  3. Border Shadow


Example

import 'package:flutter/material.dart';

void main(List<String> args) {
  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    home: Scaffold(
      // backgroundColor: Colors.amber,
      appBar: AppBar(
        backgroundColor: Colors.black,
        title: const Text("Container"),
        centerTitle: true,
      ),
      body: Center(
        child: Container(
          // margin: EdgeInsets.all(20),
          // padding: EdgeInsets.all(30),
          // color: Colors.red,
          height: 200,
          width: 250,
          decoration: BoxDecoration(
              color: Colors.amber,
              border: Border.all(
                  color: const Color.fromARGB(255, 212, 6, 6),
                  width: 5,
                  style: BorderStyle.solid),
              borderRadius: const BorderRadius.only(
                  topLeft: Radius.circular(40),
                  bottomRight: Radius.circular(40)),
              boxShadow: const [
                BoxShadow(color: Colors.black, offset: Offset(6, 6))
              ]),

          child: const Center(
            child: Text(
              "welcome",
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
          ),
        ),
      ),
    ),
  ));
}

No comments:

Post a Comment

Linked List Implementation using C++ Structure

3 Nodes Linked List Implementaion Single Linked list #include<iostream> using namespace std;   struct Node{ int data; Node* next; Node...