Skip to content

Instantly share code, notes, and snippets.

@raushankrjha
Last active May 2, 2019 12:11
Show Gist options
  • Save raushankrjha/cf143d39dc496ee0e7aff1a2ff143f71 to your computer and use it in GitHub Desktop.
Save raushankrjha/cf143d39dc496ee0e7aff1a2ff143f71 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Profile',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Profile'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: new Stack(
children: <Widget>[
ClipPath(child:
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds.
colors: [const Color(0xFFeb3349), const Color(0xFFf45c43)], // whitish to gray
tileMode: TileMode.repeated, // repeats the gradient over the canvas
),
),
),
clipper: getclipper(),
),
Positioned(
width: 350.0,
top: MediaQuery.of(context).size.height/4,
child: Column(
children: <Widget>[
Container(
width: 150.0,
height: 150.0,
decoration: BoxDecoration(
color: Colors.red,
image: DecorationImage(
image: NetworkImage("https://image address"),
fit: BoxFit.cover
),
borderRadius: BorderRadius.all(Radius.circular(75.0)),
boxShadow: [
BoxShadow(blurRadius: 7.0,color: Colors.black)
]
),
),
SizedBox(height: 50.0,),
Text(
"Raushan",
style: TextStyle(fontSize: 30.0,fontWeight: FontWeight.bold),
),
SizedBox(height: 10.0,),
Text(
"Programmer",
style: TextStyle(fontSize: 20.0,fontStyle: FontStyle.italic),
),
SizedBox(height: 30.0,),
Container(
constraints: BoxConstraints.expand(
height: Theme.of(context).textTheme.display1.fontSize * 1.1 + 100.0,
),
alignment: Alignment.center,
padding: const EdgeInsets.all(5.0),
margin: const EdgeInsets.only(left: 20.0,right: 20.0,top: 10.0),
child: new Row(
children: <Widget>[
new Column(
children: <Widget>[
Text("12.5K",style: new TextStyle(fontSize: 25.0,fontWeight: FontWeight.bold)),
Text("Followers",style: new TextStyle(fontSize: 21.0,fontWeight: FontWeight.normal)),
],
),
SizedBox(width: 13),
new Column(
children: <Widget>[
Text("360K",style: new TextStyle(fontSize: 25.0,fontWeight: FontWeight.bold)),
Text("Subscriber",style: new TextStyle(fontSize: 21.0,fontWeight: FontWeight.normal)),
],
),
SizedBox(width: 13),
new Column(
children: <Widget>[
Text("650",style: new TextStyle(fontSize: 25.0,fontWeight: FontWeight.bold)),
Text("Videos",style: new TextStyle(fontSize: 21.0,fontWeight: FontWeight.normal)),
],
)
],
),
),
RaisedButton(
textColor: Colors.white,
color: Colors.green,
child: Text("SUBSCRIBE NOW",style: new TextStyle(fontSize: 21.0,fontWeight: FontWeight.normal)),
onPressed: () {},
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(20.0))),
],
),
)
],
),
);
}
}
class getclipper extends CustomClipper<Path>
{
@override
Path getClip(Size size) {
var path=new Path();
path.lineTo(0.0, size.height/1.6);
path.lineTo(size.width+125, 0.0);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
// TODO: implement shouldReclip
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment