flutter_view 1.0.1 flutter_view: ^1.0.1 copied to clipboard
A new way to develop your app with awesome components and stylesheet
import 'package:flutter/material.dart';
import 'package:flutter_view/flutter_view.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: View(
style: styles['container'],
children: [
View(style: styles['blue']),
View(style: styles['red']),
View(style: styles['blue']),
],
),
),
);
}
}
const styles = StyleSheet.create({
'container': const Style(
backgroundColor: Colors.yellow,
height: 200,
alignItems: AlignItems.stretch,
flexDirection: FlexDirection.column,
border: BorderSide(color: Colors.red, width: 2),
padding: EdgeInsets.all(24),
margin: EdgeInsets.all(24),
borderRadius: BorderRadius.all(Radius.zero),
elevation: 6,
),
'blue': const Style(
backgroundColor: Colors.blue,
flex: 1,
),
'red': const Style(
backgroundColor: Colors.red,
flex: 2,
),
});