edit_builder 0.1.0 edit_builder: ^0.1.0 copied to clipboard
Simple package to help on creation of edit pages.
import 'package:edit_builder/edit_builder.dart';
import 'package:flutter/material.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'example',
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('EditBuilder'),
),
body: EditBuilder<String>(
initialValue: 'C++',
builder: (context, value, setValue) => Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(value),
FlatButton(
child: Text('INCREASE'),
onPressed: () => setValue(value += '+'),
)
],
),
),
),
);
}
}