Skip to content

Instantly share code, notes, and snippets.

View JonathanMonga's full-sized avatar
😎
Focus on Dart and Flutter.

Jonathan Monga JonathanMonga

😎
Focus on Dart and Flutter.
View GitHub Profile
@JonathanMonga
JonathanMonga / randomNumbersWithFixedSum.js
Created March 9, 2023 14:11
Random integer numbers with fixed sum
function arraySum(a) {
return a.reduce((a, b) => a + b, 0)
}
function getRandomIntInclusive(min, max) {
const minCeil = Math.ceil(min)
const maxFloor = Math.floor(max)
return Math.floor(Math.random() * (maxFloor - minCeil + 1)) + minCeil
}
@JonathanMonga
JonathanMonga / README.md
Created February 3, 2020 10:11 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
class PaddingWidget extends StatelessWidget {
const PaddingWidget({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Row(
final rowConstant = Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"Period",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.caption.color,
),
),
Widget _buildRow(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"Period",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.caption.color,
),
Column _buildLeadingColumn(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
FlutterShine(
builder: (BuildContext context, ShineShadow shineShadow) {
return Center(
child: Container(
width: 300,
height: 300,
decoration: BoxDecoration(
color: Colors.white, boxShadow: shineShadow.boxShadows,
),
),
FlutterShine(
builder: (BuildContext context, ShineShadow shineShadow) {
return Center(
child:
Text(
"Flutter Shine",
style: TextStyle(
fontSize: 100,
color: Colors.white,
shadows: shineShadow.shadows,
new Container(
width: 100,
height: 100,
decoration: new BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(.5),
blurRadius: 20.0, // soften the shadow
spreadRadius: 0.0, //extend the shadow
offset: Offset(