Saturday, December 12, 2020

Banner | Chip | Expansion

 ...................................................................................................................................................................................................................................
Example :#1 [ Banner ]

import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MainScreen(),
     // getPages: Router.route,
      //initialRoute: '/login',
    );
  }
}


class MainScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.deepPurple,
        title: Text('AbodeXD to Flutter'),
      ),
      body: Container(
        padding: EdgeInsets.all(16),
        child: Align(
          alignment: Alignment.topCenter,
          child: Banner(
            message: 'Offer 20% off',
            location: BannerLocation.topEnd,
            color: Colors.red,
            child: Container(
              height: 200,
              width: 200,
              child: Image.network(
                'https://upload.wikimedia.org/wikipedia/commons/6/6d/Good_Food_Display_-_NCI_Visuals_Online.jpg',
                fit: BoxFit.fill,
              ),
            ),
          ),
        ),
      ),
    );
  }
}



Happy Coding :)
 ...................................................................................................................................................................................................................................
Example :#2 []


Happy Coding :)
 ...................................................................................................................................................................................................................................
Example :#3 []


Happy Coding :)
 ...................................................................................................................................................................................................................................
Example :#4 []
Happy Coding :)

No comments:

Post a Comment