Sunteți pe pagina 1din 2

import 'package:flutter/material.

dart';
import 'package:english_words/english_words.dart';
void main(){
runApp(App());
}
class App extends StatelessWidget{
@override
Widget build(BuildContext context) {

return MaterialApp(
title: 'Titulo Chingon',
home: new Construira(),
);
}
}
class Construira extends StatelessWidget {
@override
String s='asd';
Widget build(BuildContext context) {
// TODO: implement build
void _showAlertDialog() {
showDialog(
context: context,
builder: (buildcontext) {
return AlertDialog(
title: Text("Titulo del alert"),
content: Text("contenido del alert"),
actions: <Widget>[
RaisedButton(
child: Text("CERRAR", style: TextStyle(color: Colors.white),),
onPressed: (){ Navigator.of(context).pop(); },
)
],
);
}
);
}
return new Stack(children: <Widget>[
new RandomWords(),
new Positioned(bottom: 0.0, child: new Container(width:
MediaQuery.of(context).size.width, height: 150.0, color: Colors.green,child: new
RaisedButton(
disabledColor: Colors.amber,
child: Text("Raised Button"),
splashColor: Colors.amber,
color: Colors.blueAccent,
onPressed: _showAlertDialog
),
)
)
]);

}
class Boton extends StatefulWidget{
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return null;
}
}

class RandomWords extends StatefulWidget{


@override
State<StatefulWidget> createState() {
return RWS();
}

class RWS extends State<RandomWords> {


final _suggestions = <WordPair>[];
final _BF = const TextStyle(fontSize: 18);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Generador de palabras'),
),
body: _buildSuggestions(),
);
}

Widget _buildSuggestions() {
return ListView.builder(
padding: const EdgeInsets.all(16),
itemBuilder: (context, i) {
if(i >= _suggestions.length){
_suggestions.addAll(generateWordPairs().take(10));
}
return _buildRow(_suggestions[i]);
}
);
}

Widget _buildRow(WordPair pair) {


return ListTile(

title: Text(pair.asPascalCase,style: _BF,

),
);
}

S-ar putea să vă placă și