Created
September 15, 2019 12:05
-
-
Save jeroenouw/a35e208c3d6e4977f6b12ce02964f7c3 to your computer and use it in GitHub Desktop.
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'; | |
class ReusableScreen extends StatelessWidget { | |
final String screenTitle; | |
final IconData tileIcon; | |
final String tileTitle; | |
final String tileSubtitle; | |
final Function cancelButtonAction; | |
final Function proceedButtonAction; | |
ReusableScreen({ | |
@required this.screenTitle, | |
@required this.tileIcon, | |
@required this.tileTitle, | |
@required this.tileSubtitle, | |
@required this.cancelButtonAction, | |
@required this.proceedButtonAction | |
}); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text(screenTitle)), | |
body: Card( | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
ListTile( | |
leading: Icon(tileIcon), | |
title: Text(tileTitle), | |
subtitle: Text(tileSubtitle), | |
), | |
ButtonTheme.bar( | |
child: ButtonBar( | |
children: <Widget>[ | |
FlatButton( | |
child: Text('Cancel'), | |
onPressed: cancelButtonAction, | |
), | |
FlatButton( | |
child: Text('Proceed'), | |
onPressed: proceedButtonAction, | |
), | |
], | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
@comptech-developer depends on where you want it, in this case it was a menu with menu items which routes to a page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where have to placed onTap();