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.

198 lines
7.8 KiB

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