-
-
Notifications
You must be signed in to change notification settings - Fork 103
styled_widget logo
Rein Gundersen Bentdal edited this page Mar 22, 2020
·
10 revisions
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:google_fonts/google_fonts.dart';
void main() => runApp(app);
final Widget app = MaterialApp(home: Scaffold(body: Logo()));
class Logo extends StatelessWidget {
final TextStyle _textStyle = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 40,
color: Colors.white,
);
final _widgetStyle = ({@required Widget child}) => child
.padding(vertical: 15, horizontal: 25)
.decorated(
borderRadius: BorderRadius.circular(20),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.pink[200],
Colors.amber[200],
],
),
)
// .constrained(width: 400)
.alignment(Alignment.center);
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text('styled_widget', style: GoogleFonts.satisfy(textStyle: _textStyle))
// .rotate(angle: -0.1)
.padding(right: 15),
SvgPicture.asset('assets/ballet.svg')
.constrained(width: 40, height: 40),
],
).parent(_widgetStyle)
.scale(2)
;
}
}