Skip to content

Instantly share code, notes, and snippets.

@angelhdzmultimedia
Last active April 25, 2020 00:45
Show Gist options
  • Save angelhdzmultimedia/cc1b53bc459a6126bf903edc9b6bb3fc to your computer and use it in GitHub Desktop.
Save angelhdzmultimedia/cc1b53bc459a6126bf903edc9b6bb3fc to your computer and use it in GitHub Desktop.
Bienvenida con un SnackBar
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Builder(
builder: (context) => RaisedButton(
child: Text('Ver Mensaje'),
onPressed: () {
Scaffold.of(context).showSnackBar(
SnackBar(
content:Text('¡Bienvenido!')
)
);
}
)
)
],
),
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment