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.

194 lines
7.5 KiB

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