config_screen.dart 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import 'package:flutter/material.dart';
  2. import 'package:empty/components/background.dart';
  3. import 'package:empty/constants.dart';
  4. class ConfigScreen extends StatefulWidget {
  5. @override
  6. _ConfigScreenState createState() => _ConfigScreenState();
  7. }
  8. class _ConfigScreenState extends State<ConfigScreen> {
  9. @override
  10. Widget build(BuildContext context) {
  11. final _list = [
  12. // {"title": "계정관리","subtitle": "Account info","icon": Icons.person,"page": "profile"},
  13. {"title": "공지사항","subtitle": "Notice","icon": Icons.campaign,"page": "notice"},
  14. {"title": "자주하는질문","subtitle": "Frequently asked questions","icon": Icons.forum,"page": "faq"},
  15. {"title": "고객센터","subtitle": "Service center","icon": Icons.support_agent,"page": "support"},
  16. {"title": "다붓컨설팅","subtitle": "About dabut","icon": Icons.business,"page": "about"},
  17. //{"title": "언어선택","subtitle": "Language selection","icon": Icons.translate,"page": "language"},
  18. //{"title": "콘텐츠알림","subtitle": "Content Notification","icon": Icons.notifications_active,"page": "alarm"},
  19. ];
  20. return Background(
  21. image: Container(
  22. height: double.infinity,
  23. width: double.infinity,
  24. decoration: BoxDecoration(
  25. image: DecorationImage(
  26. image: AssetImage('assets/images/background_config.png'),
  27. fit: BoxFit.cover
  28. )
  29. ),
  30. ),
  31. child: Scaffold(
  32. backgroundColor: Colors.transparent,
  33. appBar: AppBar(
  34. // title: Text(_title,style: TextStyle(fontSize: 18),),
  35. //centerTitle: true,
  36. backgroundColor: Colors.transparent,
  37. elevation: 0.0,
  38. ),
  39. body: ListView.separated(
  40. itemCount: _list.length,
  41. separatorBuilder: (BuildContext context, int index) => Divider(thickness: 0.2,color: Colors.grey,height: 0.2,),
  42. itemBuilder: (BuildContext context, int index) {
  43. return ListTile(
  44. title: Text(_list[index]['title'],style: Theme.of(context).textTheme.bodyText1),
  45. subtitle: Text(_list[index]['subtitle'],style: Theme.of(context).textTheme.subtitle1),
  46. leading: CircleAvatar(
  47. backgroundColor: Colors.green[200],
  48. radius: 20,
  49. child: Icon(_list[index]['icon'],color: Colors.white,),
  50. ),
  51. trailing: Icon(Icons.arrow_forward_ios,color: Colors.white),
  52. onTap: (){
  53. // kEmptySocial
  54. if( _list[index]['page'] == 'profile' && kEmptySocial == null ) {
  55. Navigator.pushNamed(context, '/login' );
  56. } else {
  57. Navigator.pushNamed(context, '/' + _list[index]['page'] );
  58. }
  59. },
  60. );
  61. },
  62. ),
  63. ),
  64. );
  65. }
  66. }