verve 0.3.2 verve: ^0.3.2 copied to clipboard
An opinionated Flutter theming solution, building on modern Material and Scandinavian principles.
import 'package:flutter/material.dart';
import 'package:verve/verve.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
List titles = ['This is a list', 'It adds some hope'];
List subtitles = [
'made with Navy by Verve.',
'to boring old ListView.builder.'
];
return MaterialApp(
title: 'Verve Example',
//Navy verveSwatch
theme: verveSwatch(theme: VerveTheme.navy),
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Verve!'),
),
body: Center(
child: Column(
children: <Widget>[
//Generator for String based ListView
//Uses rounded verveCards.
ListView.builder(
shrinkWrap: true,
itemCount: titles.length,
itemBuilder: (BuildContext context, int i) {
return Card(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(5.0),
child: Text(
titles[i],
style: Theme.of(context).textTheme.title,
)),
Container(
padding: EdgeInsets.all(5.0),
child: Text(
subtitles[i],
style: Theme.of(context).textTheme.subtitle,
)),
],
));
},
),
//Rounded-flat button.
RaisedButton(
onPressed: () {
titles = ["x", "x"];
},
child: Text('CLICK')),
],
),
),
),
);
}
}