Sonnat Project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
6.9 KiB

1 year ago
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_svg/flutter_svg.dart';
  4. import 'package:sonnat/core/extensions/context_extension.dart';
  5. import 'package:sonnat/core/extensions/string_extension.dart';
  6. import 'package:sonnat/core/language/translator.dart';
  7. import 'package:sonnat/core/utils/app_constants.dart';
  8. import 'package:url_launcher/url_launcher.dart';
  9. class AboutUsScreen extends StatefulWidget {
  10. const AboutUsScreen({super.key});
  11. @override
  12. State<AboutUsScreen> createState() => _AboutUsScreenState();
  13. }
  14. class _AboutUsScreenState extends State<AboutUsScreen> {
  15. final TextEditingController _controller = TextEditingController();
  16. @override
  17. Widget build(BuildContext context) {
  18. return Scaffold(
  19. body: Padding(
  20. padding: EdgeInsets.symmetric(horizontal: context.width * 25 / AppConstants.instance.appWidth),
  21. child: Column(
  22. crossAxisAlignment: CrossAxisAlignment.start,
  23. children: [
  24. SizedBox(height: context.height * 33 / AppConstants.instance.appHeight),
  25. Row(
  26. children: [
  27. const Spacer(),
  28. Text(
  29. Translator.translate('more_about_us'),
  30. style: const TextStyle(
  31. color: Color(0xff222D4E),
  32. fontSize: 16,
  33. fontWeight: FontWeight.bold,
  34. ),
  35. ),
  36. const Spacer(),
  37. GestureDetector(
  38. onTap: () {
  39. Navigator.pop(context);
  40. },
  41. child: SvgPicture.asset(
  42. 'ic_back'.svgPath,
  43. ),
  44. ),
  45. ],
  46. ),
  47. SizedBox(height: context.height * 54 / AppConstants.instance.appHeight),
  48. Text(
  49. Translator.translate('main_target'),
  50. style: const TextStyle(color: Color(0xff178756), fontSize: 16),
  51. ),
  52. SizedBox(height: context.height * 11 / AppConstants.instance.appHeight),
  53. SingleChildScrollView(
  54. child: FutureBuilder(
  55. builder: (context, snapshot) {
  56. if (snapshot.connectionState == ConnectionState.done) {
  57. return Text(
  58. snapshot.data as String,
  59. textDirection: TextDirection.rtl,
  60. style: const TextStyle(
  61. color: Color(0xff636E88),
  62. fontSize: 13,
  63. ),
  64. textAlign: TextAlign.justify,
  65. );
  66. }
  67. return const CircularProgressIndicator();
  68. },
  69. future: rootBundle.loadString('assets/meta/about_us.txt'),
  70. ),
  71. ),
  72. SizedBox(height: context.height * 20 / AppConstants.instance.appHeight),
  73. Text(
  74. Translator.translate('contact_to_us'),
  75. style: const TextStyle(color: Color(0xff178756), fontSize: 16),
  76. ),
  77. SizedBox(height: context.height * 24 / AppConstants.instance.appHeight),
  78. Row(
  79. children: [
  80. GestureDetector(
  81. onTap: _openInstagram,
  82. child: Row(
  83. children: [
  84. const Text(
  85. 'Sonnat_islam',
  86. style: TextStyle(color: Color(0xff404966), fontSize: 13),
  87. ),
  88. SizedBox(width: context.width * 15 / AppConstants.instance.appWidth),
  89. SvgPicture.asset('ic_instagram'.svgPath),
  90. ],
  91. ),
  92. ),
  93. const Spacer(),
  94. GestureDetector(
  95. onTap: _openPhone,
  96. child: Row(
  97. children: [
  98. const Text(
  99. '+98 92300264',
  100. textDirection: TextDirection.ltr,
  101. style: TextStyle(color: Color(0xff404966), fontSize: 13),
  102. ),
  103. SizedBox(width: context.width * 15 / AppConstants.instance.appWidth),
  104. SvgPicture.asset('ic_phone'.svgPath),
  105. ],
  106. ),
  107. ),
  108. ],
  109. ),
  110. SizedBox(height: context.height * 29 / AppConstants.instance.appHeight),
  111. Text(
  112. Translator.translate('send_message_to_us'),
  113. style: const TextStyle(color: Color(0xff404966), fontSize: 12),
  114. ),
  115. SizedBox(height: context.height * 12 / AppConstants.instance.appHeight),
  116. TextFormField(
  117. autofocus: true,
  118. maxLength: 300,
  119. controller: _controller,
  120. maxLines: 10,
  121. minLines: 4,
  122. style: const TextStyle(
  123. color: Color(0xff8D95AB),
  124. fontSize: 10,
  125. ),
  126. decoration: InputDecoration(
  127. fillColor: Colors.transparent,
  128. hintText: Translator.translate('send_message'),
  129. filled: true,
  130. counterText: '',
  131. hintStyle: const TextStyle(
  132. color: Color(0xff8D95AB),
  133. fontSize: 10,
  134. ),
  135. enabledBorder: OutlineInputBorder(
  136. borderRadius: BorderRadius.circular(12),
  137. borderSide: const BorderSide(color: Color(0xff636E88)),
  138. ),
  139. focusedBorder: OutlineInputBorder(
  140. borderRadius: BorderRadius.circular(12),
  141. borderSide: const BorderSide(
  142. color: Color(0xff636E88),
  143. ),
  144. ),
  145. ),
  146. ),
  147. SizedBox(height: context.height * 9 / AppConstants.instance.appHeight),
  148. Container(
  149. decoration: BoxDecoration(
  150. color: const Color(0xff178756),
  151. borderRadius: BorderRadius.circular(12),
  152. ),
  153. padding: EdgeInsets.symmetric(
  154. horizontal: context.width * 20 / AppConstants.instance.appWidth,
  155. vertical: context.height * 10 / AppConstants.instance.appHeight,
  156. ),
  157. child: Text(
  158. Translator.translate('send'),
  159. style: const TextStyle(color: Color(0xffffffff), fontSize: 12),
  160. ),
  161. ),
  162. ],
  163. ),
  164. ),
  165. );
  166. }
  167. Future<void> _openInstagram() async {
  168. var url = 'https://www.instagram.com/<Sonnat_islam>/';
  169. if (await canLaunchUrl(Uri.parse(url))) {
  170. await launchUrl(Uri.parse(url));
  171. } else {
  172. throw 'There was a problem to open the url: $url';
  173. }
  174. }
  175. // ignore: avoid_void_async
  176. void _openPhone() async {
  177. await launchUrl(Uri.parse('tel://+98 92300264'));
  178. }
  179. }