Instantly share code, notes, and snippets.
🥦
make flutter tutotial
Android & Flutter Developer in ShangHai.
-
FlutterOpen
- ShangHai
- https://nb312.github.io/
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
/ 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RaisedButton( | |
onPressed: () { | |
print("pressed"); | |
}, | |
child: Text( | |
"Click Me~~~", | |
style: TextStyle(color: RED, fontSize: 40), | |
), | |
), |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RaisedButton({ | |
Key key, | |
@required VoidCallback onPressed, | |
ValueChanged<bool> onHighlightChanged, | |
ButtonTextTheme textTheme, | |
Color textColor, | |
Color disabledTextColor, | |
Color color, | |
Color disabledColor, | |
Color highlightColor, |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef ValueChanged<T> = void Function(T value); |
nb312
/ 06-raise-button-04-hightlight-example.dart
Created
January 20, 2019 18:02
06-raise-button-04-hightlight-example.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SizedBox(height: 10), | |
RaisedButton( | |
onPressed: () { | |
print("click"); | |
}, | |
onHighlightChanged: (isHigh) { | |
print("onHighlightChanged.isHigh = $isHigh"); | |
}, | |
child: Text( | |
"Click Hightlight~~~", |
nb312
/ 06-raise-button-05-colors-parametes.dart
Created
January 20, 2019 18:03
06-raise-button-05-colors-parametes.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
nb312
/ 06-raise-button-07-theme-data.dart
Created
January 20, 2019 18:06
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theme: ThemeData( | |
primaryColor: BLUE_DEEP, | |
accentColor: RED, | |
brightness: Brightness.light), |
nb312
/ 06-raise-button-08-theme-button.dart
Created
January 20, 2019 18:07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
} |
nb312
/ 06-raise-button-08-theme-example.dart
Created
January 20, 2019 18:09
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _themeButton() => Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
SizedBox(height: 10), | |
RaisedButton( | |
onPressed: () { | |
print("click"); | |
}, | |
child: Text( | |
"textTheme:normal", |
OlderNewer