Skip to content

Instantly share code, notes, and snippets.

View nb312's full-sized avatar
🥦
make flutter tutotial

niebin nb312

🥦
make flutter tutotial
View GitHub Profile
SnackBar({
Key key,
@required this.content,
this.backgroundColor,
this.action,
this.duration = _kSnackBarDisplayDuration,
this.animation,
})
final bar = _snackSample();
_key.currentState.showSnackBar(bar);
Widget _snackSample() => SnackBar(
content: Text(
"You have a message!",
style: TextStyle(
color: TEXT_BLACK,
fontSize: 20,
),
textAlign: TextAlign.center,
),
backgroundColor: BLUE_LIGHT,
import "package:flutter/material.dart";
import 'package:flutter_widgets/const/_const.dart';
class SnackPage extends StatefulWidget {
@override
_SnackState createState() => _SnackState();
}
class _SnackState extends State<SnackPage> {
GlobalKey<ScaffoldState> _key = GlobalKey();
Widget _alertDialog() => AlertDialog(
title: Text(
"How to follow us?",
textAlign: TextAlign.center,
),
titleTextStyle: TextStyle(
color: TEXT_BLACK, fontSize: 30, fontWeight: FontWeight.w700),
titlePadding: EdgeInsets.symmetric(horizontal: 30, vertical: 20),
content: Text("1. You should login in the facebook.\n"
"2. You should search the Flutter Open.\n"
AlertDialog({
Key key,
this.title,
this.titlePadding,
this.titleTextStyle,
this.content,
this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
this.contentTextStyle,
this.actions,
this.backgroundColor,
Widget _shapeDialog() => SimpleDialog(
title: Text(
"Be careful!",
textAlign: TextAlign.center,
),
children: <Widget>[
Text(
"If you write a message, you should care about the message.",
textAlign: TextAlign.center,
),
Widget _colorDialog() => SimpleDialog(
title: Text(
"Message",
textAlign: TextAlign.center,
),
children: <Widget>[
Text(
"You must learn it carefully.",
textAlign: TextAlign.center,
),
Widget _padDialog() => SimpleDialog(
title: Text(
"Do you know why?",
textAlign: TextAlign.center,
),
titlePadding: EdgeInsets.symmetric(
horizontal: 30,
vertical: 20,
),
children: <Widget>[
SimpleDialog({
Key key,
this.title,
this.titlePadding = const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0),
this.children,
this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
this.backgroundColor,
this.elevation,
this.semanticLabel,
this.shape,