Skip to content

Instantly share code, notes, and snippets.

@hsSam
Last active June 25, 2019 03:32
Show Gist options
  • Save hsSam/aa47c4b9338082a16bf7025970d2dbac to your computer and use it in GitHub Desktop.
Save hsSam/aa47c4b9338082a16bf7025970d2dbac to your computer and use it in GitHub Desktop.
[flutter css style] flutter css sytle use #flutter
//container
Container(
width: 200.0,
height: 200.0,
color: Colors.green,
margin: EdgeInsets.symmetric(vertical: 20.0),
);
// Color
Color _color = Colors.green;
_color = Color.fromRGBO(random.nextInt(256), random.nextInt(256), random.nextInt(256), 1,);
//border Radius
BorderRadiusGeometry _borderRadius = BorderRadius.circular(8);
decoration: BoxDecoration(
color: _color,
borderRadius: _borderRadius,
),
//Icon
Icon(Icons.play_arrow)
//font size
final _biggerFont = const TextStyle(fontSize: 18.0);
final _smallFont = const TextStyle(fontSize: 12.0);
//padding
const EdgeInsets.all(16.0)
//animation param
// Define how long the animation should take.
duration: Duration(seconds: 1),
Duration(milliseconds: 500)
// Provide an optional curve to make the animation feel smoother.
curve: Curves.fastOutSlowIn,
//text style
Text('example',
style: TextStyle(
color: Colors.red,
fontSize: 18.0,
decorationStyle: TextDecorationStyle.dashed,
bakcgroudColor: Colors.yellow,
height: 1.0,
fontWeight: FontWeight.bold
),
)
// customer button
class MyButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
print("MyButton was tapped!");
},
child: Container(
height: 36.0,
padding: const EdgeInsets.all(8.0),
margin: const EdgeInsets.symmetric(horizontal: 8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.lightGreen[500],
),
child: Center(
child: Text('Engage'),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment