order.dart 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import 'package:flutter/material.dart';
  2. ///Order START
  3. class OrderPage extends StatefulWidget {
  4. static const routeName = '/order';
  5. final int index;
  6. //构造函数 同时传入桌号
  7. OrderPage({Key key, @required this.index}) : super(key: key);
  8. @override
  9. State<StatefulWidget> createState() {
  10. print("[桌点餐详情]" + index.toString());
  11. return _OrderPageState();
  12. }
  13. }
  14. class _OrderPageState extends State<OrderPage> {
  15. @override
  16. Widget build(BuildContext context) {
  17. return Scaffold(
  18. appBar: AppBar(title: Text("点单页面")),
  19. drawer: Drawer(
  20. // Add a ListView to the drawer. This ensures the user can scroll
  21. // through the options in the drawer if there isn't enough vertical
  22. // space to fit everything.
  23. child: ListView(
  24. // Important: Remove any padding from the ListView.
  25. padding: EdgeInsets.zero,
  26. children: <Widget>[
  27. DrawerHeader(
  28. child: Column(
  29. children: <Widget>[
  30. Padding(
  31. padding: const EdgeInsets.fromLTRB(0,60,0,0),
  32. child: Text(
  33. "口之福火锅店",
  34. style: TextStyle(
  35. fontSize: 30,
  36. color: Colors.white,
  37. fontStyle: FontStyle.italic,
  38. fontWeight: FontWeight.bold),
  39. ),
  40. )
  41. ],
  42. ),
  43. decoration: BoxDecoration(
  44. color: Colors.red,
  45. image: new DecorationImage(
  46. // image: new ExactAssetImage('images/drawer.jpg'),
  47. image: new NetworkImage(
  48. "http://test.ricemarch.com:9000/images/timg.jpg"),
  49. fit: BoxFit.cover,
  50. ),
  51. ),
  52. ),
  53. ListTile(
  54. title: Text('Item 1'),
  55. onTap: () {
  56. // Update the state of the app
  57. // ...
  58. // Then close the drawer
  59. Navigator.pop(context);
  60. },
  61. ),
  62. ListTile(
  63. title: Text('Item 2'),
  64. onTap: () {
  65. // Update the state of the app
  66. // ...
  67. // Then close the drawer
  68. Navigator.pop(context);
  69. },
  70. ),
  71. ],
  72. ),
  73. ),
  74. body: Center(
  75. child: Column(
  76. children: <Widget>[Text("order页面")],
  77. ),
  78. ),
  79. );
  80. }
  81. }
  82. /// order END