support_config.dart 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:empty/components/background.dart';
  4. class SupportScreen extends StatefulWidget {
  5. @override
  6. _SupportScreenState createState() => _SupportScreenState();
  7. }
  8. class _SupportScreenState extends State<SupportScreen> {
  9. String termsText = '';
  10. String privacyText = '';
  11. readTextFile(String filename) async {
  12. if( filename == 'terms' ){
  13. String _termsText = await rootBundle.loadString('assets/files/terms.txt');
  14. setState(() {
  15. termsText = _termsText;
  16. });
  17. }
  18. if( filename == 'privacy' ){
  19. String _privacyText = await rootBundle.loadString('assets/files/privacy.txt');
  20. setState(() {
  21. privacyText = _privacyText;
  22. });
  23. }
  24. }
  25. @override
  26. void initState() {
  27. // TODO: implement initState
  28. super.initState();
  29. readTextFile('terms');
  30. readTextFile('privacy');
  31. }
  32. @override
  33. Widget build(BuildContext context) {
  34. return Background(
  35. image: Container(
  36. height: double.infinity,
  37. width: double.infinity,
  38. decoration: BoxDecoration(
  39. image: DecorationImage(
  40. image: AssetImage('assets/images/background_config.png'),
  41. fit: BoxFit.cover
  42. )
  43. ),
  44. ),
  45. child: Scaffold(
  46. backgroundColor: Colors.transparent,
  47. appBar: AppBar(
  48. title: Text('고객센터',style: TextStyle(fontSize: 18),),
  49. //centerTitle: true,
  50. backgroundColor: Colors.transparent,
  51. elevation: 0.0,
  52. ),
  53. body: SingleChildScrollView(
  54. child: Column(
  55. crossAxisAlignment: CrossAxisAlignment.center,
  56. children: [
  57. Row(),
  58. Padding(
  59. padding: const EdgeInsets.all(20.0),
  60. child: Text('앱 사용에 관한 문의 사항은 아래 이메일로 보내주세요',style: Theme.of(context).textTheme.bodyText1),
  61. ),
  62. Divider(),
  63. Text('dabutconsulting@gmail.com',style: Theme.of(context).textTheme.subtitle1),
  64. Divider(),
  65. ExpansionTile(
  66. title: Text('서비스이용약관'),
  67. children: [
  68. Divider(),
  69. ListTile(
  70. title: Text(termsText),
  71. )
  72. ],
  73. ),
  74. ExpansionTile(
  75. title: Text('개인정보취급방침'),
  76. children: [
  77. Divider(),
  78. ListTile(
  79. title: Text(privacyText),
  80. )
  81. ],
  82. ),
  83. ],
  84. ),
  85. )
  86. ),
  87. );
  88. }
  89. }