Hibok
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

112 wiersze
3.1 KiB

  1. import 'package:chat/home/realtimehelper/translation_butler_page.dart';
  2. import 'package:chat/home/realtimehelper/travel_butler_page.dart';
  3. import 'package:chat/models/group_info_model.dart';
  4. import 'package:flutter/cupertino.dart';
  5. import 'package:flutter/material.dart';
  6. import '../../data/constants.dart';
  7. import '../../generated/i18n.dart';
  8. import '../../r.dart';
  9. class RealTimeHelperPage extends StatefulWidget {
  10. final GroupInfoModel groupInfoModel;
  11. RealTimeHelperPage({Key key, this.groupInfoModel}) : super(key: key);
  12. @override
  13. State<StatefulWidget> createState() {
  14. return RealTimeHelperPageState();
  15. }
  16. }
  17. class RealTimeHelperPageState extends State<RealTimeHelperPage> {
  18. @override
  19. void initState() {
  20. super.initState();
  21. }
  22. @override
  23. void dispose() {
  24. // MessageMgr().off('Update Group Info', updateGroupInfo);
  25. super.dispose();
  26. }
  27. @override
  28. Widget build(BuildContext context) {
  29. Widget appBar = AppBar(
  30. backgroundColor: AppColors.NewAppbarBgColor,
  31. title: Text(
  32. I18n.of(context).real_time_helper,
  33. textScaleFactor: 1.0,
  34. style: TextStyle(color: AppColors.NewAppbarTextColor),
  35. ),
  36. // leading: CustomUI.buildCustomLeading(context),
  37. centerTitle: false,
  38. );
  39. return Scaffold(
  40. appBar: appBar,
  41. body: SafeArea(
  42. child: Container(
  43. color: Color(0xffE8EAF0),
  44. child: ListView(
  45. children: <Widget>[
  46. helperCard(I18n.of(context).translation_butler,
  47. R.assetsImagesImgTranslationButler, () {
  48. Navigator.of(context).push(
  49. MaterialPageRoute(
  50. builder: (_) => TranslationButlerPage(),
  51. ),
  52. );
  53. },textColor: Color(0xff2685FA)),
  54. helperCard(
  55. I18n.of(context).travel_butler, R.assetsImagesImgTravelButler,
  56. () {
  57. Navigator.of(context).push(
  58. MaterialPageRoute(
  59. builder: (_) => TravelButlerPage(),
  60. ),
  61. );
  62. },textColor: Color(0xffff682d)),
  63. SizedBox(
  64. height: 15,
  65. ),
  66. ],
  67. ),
  68. ),
  69. ),
  70. );
  71. }
  72. Widget helperCard(String title, String assets, Function callBack,{Color textColor }) {
  73. return InkWell(
  74. child: Container(
  75. margin: EdgeInsets.all(10),
  76. child: Card(
  77. elevation: 2, // 阴影
  78. shape: RoundedRectangleBorder(
  79. borderRadius: BorderRadius.circular(10),
  80. // side: BorderSide(color: Colors.green,width: 25),
  81. ),
  82. child: Container(padding: EdgeInsets.all(10),child: Column(
  83. children: <Widget>[
  84. Image.asset(
  85. assets,
  86. ),
  87. Padding(
  88. padding: EdgeInsets.only(top: 15, bottom: 15),
  89. child: Text(
  90. title + ' >>',
  91. textScaleFactor: 1.0,
  92. style: TextStyle(color: textColor, fontSize: 20),
  93. ),
  94. )
  95. ],
  96. ),),
  97. ),
  98. ),
  99. onTap: callBack,
  100. );
  101. }
  102. }