import 'package:flutter/material.dart';
import 'package:meal_app/pages/home.dart';
void main() => runApp(MealApp());
class MealApp extends StatelessWidget {
const MealApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Meal App',
theme: ThemeData(
accentColor: Colors.blueAccent,
backgroundColor: Colors.white
),
home: Home(),
);
}
}
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class Home extends StatelessWidget {
const Home({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final _dateNow = DateFormat('EEEE, d MMMM').format(DateTime.now());
return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 40.0),
child: ListView(
children: <Widget>[
Text(
_dateNow.toUpperCase(),
style: TextStyle(
color: Theme.of(context).accentColor,
fontSize: 14.0
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
"Today's Menu",
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold
),
),
CircleAvatar(
child: Container(
width: 40,
height: 40,
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Image.asset(
'assets/images/user.jpg',
fit: BoxFit.cover,
),
),
)
)
],
),
SizedBox(height: 50),
Container(
height: 400,
color: Colors.red,
child: Stack(
children: <Widget>[
Container(
height: 50.0,
color: Colors.blue
),
Text('123')
],
),
)
],
),
),
)
);
}
}
...
flutter:
uses-material-design: true
assets:
- assets/images/
...
PortfolioSchema.pre("save", function (next) {
......
Jimp.read(pathToPortfolioImages + imagename)
.then(image => {
if (image.bitmap.width > image.bitmap.height) {
image.resize(546, Jimp.AUTO);
} else {
image.resize(Jimp.AUTO, 546);
}
image.write(pathToPortfolioImages + thumbnailname);
this.thumbnail = thumbnailname;
new Jimp(image.bitmap.width / 2, image.bitmap.height / 2, 0x00000000, (err, thumbnail) => {
thumbnail.getBase64Async(Jimp.MIME_PNG)
.then(base64 => {
this.imageplaceholder = base64;
next()
})
.catch(err => { throw err; })
});
})
.catch(err => { throw err; });
});