Advertisement
malkasun

custom shape

May 8th, 2020
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.45 KB | None | 0 0
  1. import 'dart:math';
  2. import 'package:flutter/services.dart';
  3.  
  4. import 'package:flutter/cupertino.dart';
  5. import 'package:flutter/material.dart';
  6.  
  7. class HomePage extends StatefulWidget {
  8.   @override
  9.   _HomePageState createState() => _HomePageState();
  10. }
  11.  
  12. class _HomePageState extends State<HomePage> {
  13.   @override
  14.   Widget build(BuildContext context) {
  15.     return MaterialApp(
  16.       title: 'සැණින්',
  17.       theme: ThemeData(
  18. //        backgroundColor: Colors.red,
  19.         hoverColor: Colors.red[400],
  20.         primaryColor: Colors.red,
  21.       ),
  22.       home: SafeArea(
  23.         child: Scaffold(
  24.           backgroundColor: Colors.grey[300],
  25.           appBar: AppBar(
  26.             elevation: 0.0,
  27.             title: Text('සැණින්'),
  28.             centerTitle: true,
  29.             backgroundColor: Colors.red,
  30.             actions: <Widget>[
  31.               Transform.rotate(
  32.                 angle: pi / 4,
  33.                 child: IconButton(
  34.                     icon: Icon(
  35.                       Icons.notifications_active,
  36.                       size: 30.0,
  37.                     ),
  38.                     onPressed: () {}),
  39.               ),
  40.               IconButton(icon: Icon(Icons.more_vert), onPressed: () {}),
  41.             ],
  42. //            bottom: PreferredSize(
  43. //                child: Container(
  44. //                  color: Colors.green[200],
  45. //                ),
  46. //                preferredSize: Size.fromHeight(75.0)),
  47.           ),
  48.             body: Container(
  49.               height: 200.0,
  50.               color: Colors.green,
  51.               child: Stack(
  52.                 alignment: Alignment.topCenter,
  53.                 children: <Widget>[
  54.                   Container(
  55.                     height: 80.0,
  56.                     color: Colors.red[400],
  57.                   ),
  58.                   Padding(
  59.                     padding: const EdgeInsets.all(15.0),
  60.                     child: Container(
  61.                       height: 170.0,
  62.                       decoration: BoxDecoration(
  63.                         borderRadius: BorderRadius.circular(12.0),
  64.                         color: Colors.white,
  65.                       ),
  66.  
  67.                     ),
  68.  
  69.                   ),
  70.                   Positioned(
  71.                       top: 30.0,
  72.                       left: 15.0,
  73. //                      width: 50.0,
  74. //                      height: 20.0,
  75. //                      child: Container(
  76. //                    decoration: BoxDecoration(
  77. //                      color: Colors.pink,
  78. //                      shape: BoxShape.rectangle
  79. //                    ),
  80. //                        child: Padding(
  81. //                          padding: const EdgeInsets.symmetric(vertical: 4.0,horizontal: 8.0),
  82. //                          child: Text('අලුත්ම පුවත',style: TextStyle(color: Colors.white, fontSize: 10.0,fontWeight: FontWeight.bold)),
  83. //                        ),
  84. //                  ),
  85.                   child: Card(
  86.                     color: Colors.blue,
  87.                     shape:  ,
  88.                     child:Padding(
  89.                           padding: const EdgeInsets.symmetric(vertical: 4.0,horizontal: 8.0),
  90.                           child: Text('අලුත්ම පුවත',style: TextStyle(color: Colors.white, fontSize: 10.0,fontWeight: FontWeight.bold)),
  91.                         ) ,
  92.  
  93.                   ),
  94.                   ),
  95.                 ],
  96.               ),
  97.             ),
  98.       ),
  99.       ),
  100.     );
  101.   }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement