mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
OnBoarding buttons: Add keys
This way the flutter driver can easily find them even if the text changes, which it probably will when I start localizing this app.
This commit is contained in:
@ -49,7 +49,11 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
if (_currentPageIndex != pages.length - 1) {
|
if (_currentPageIndex != pages.length - 1) {
|
||||||
var row = Row(
|
var row = Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
OnBoardingBottomButton(text: "Skip", onPressed: _finish),
|
OnBoardingBottomButton(
|
||||||
|
key: ValueKey("Skip"),
|
||||||
|
text: "Skip",
|
||||||
|
onPressed: _finish,
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@ -62,7 +66,11 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
OnBoardingBottomButton(text: "Next", onPressed: _nextPage),
|
OnBoardingBottomButton(
|
||||||
|
key: ValueKey("Next"),
|
||||||
|
text: "Next",
|
||||||
|
onPressed: _nextPage,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -123,11 +131,16 @@ class OnBoardingBottomButton extends StatelessWidget {
|
|||||||
final Function onPressed;
|
final Function onPressed;
|
||||||
final String text;
|
final String text;
|
||||||
|
|
||||||
OnBoardingBottomButton({@required this.text, @required this.onPressed});
|
OnBoardingBottomButton({
|
||||||
|
Key key,
|
||||||
|
@required this.text,
|
||||||
|
@required this.onPressed,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FlatButton(
|
return FlatButton(
|
||||||
|
key: key,
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
Reference in New Issue
Block a user