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
@nb312
nb312 / flutter-open-flutter-widgets-06-raise-button-01.dart
Created January 20, 2019 17:23
flutter-open-flutter-widgets-06-raise-button-01-start
import "package:flutter/material.dart";
import 'package:flutter_widgets/const/_const.dart';
class RaiseButtonPage extends StatefulWidget {
@override
_RaiseButtonState createState() => _RaiseButtonState();
}
class _RaiseButtonState extends State<RaiseButtonPage> {
@override
@nb312
nb312 / flutter-open-flutter-widgets-06-raise-button-02-simple-use.dart
Created January 20, 2019 17:54
flutter-open-flutter-widgets-06-raise-button-02
RaisedButton(
onPressed: () {
print("pressed");
},
child: Text(
"Click Me~~~",
style: TextStyle(color: RED, fontSize: 40),
),
),
@nb312
nb312 / 06-raise-button-03-raise-button-constructor.dart
Created January 20, 2019 17:58
flutter-open-flutter-widgets-06-raise-button-02-simple-use.dart
RaisedButton({
Key key,
@required VoidCallback onPressed,
ValueChanged<bool> onHighlightChanged,
ButtonTextTheme textTheme,
Color textColor,
Color disabledTextColor,
Color color,
Color disabledColor,
Color highlightColor,
@nb312
nb312 / 06-raise-button-04-hightlight-define.dart
Created January 20, 2019 18:00
flutter-open-flutter-widgets-06-raise-button-04-hightlight-define.dart
typedef ValueChanged<T> = void Function(T value);
@nb312
nb312 / 06-raise-button-04-hightlight-example.dart
Created January 20, 2019 18:02
06-raise-button-04-hightlight-example.dart
SizedBox(height: 10),
RaisedButton(
onPressed: () {
print("click");
},
onHighlightChanged: (isHigh) {
print("onHighlightChanged.isHigh = $isHigh");
},
child: Text(
"Click Hightlight~~~",
@nb312
nb312 / 06-raise-button-05-colors-parametes.dart
Created January 20, 2019 18:03
06-raise-button-05-colors-parametes.dart
Color textColor,//When we put the child as a Text, this color will set to it.
Color disabledTextColor,
Color color,
Color disabledColor,
Color highlightColor,
Color splashColor,
Widget _colorsButton() => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 10),
RaisedButton(
onPressed: () {
print("click");
},
child: Text(
"color:PURPLE\ntextColor: Colors.white\nhighlightColor: RED\nsplashColor: BLUE_DEEP",
theme: ThemeData(
primaryColor: BLUE_DEEP,
accentColor: RED,
brightness: Brightness.light),
enum ButtonTextTheme {
/// Button text is black or white depending on [ThemeData.brightness].
normal,
/// Button text is [ThemeData.accentColor].
accent,
/// Button text is based on [ThemeData.primaryColor].
primary,
}
Widget _themeButton() => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 10),
RaisedButton(
onPressed: () {
print("click");
},
child: Text(
"textTheme:normal",