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

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:sonnat/core/extensions/context_extension.dart';
import 'package:sonnat/core/extensions/string_extension.dart';
import 'package:sonnat/core/language/translator.dart';
import 'package:sonnat/core/utils/app_constants.dart';
import 'package:sonnat/core/utils/initializer.dart';
import 'package:url_launcher/url_launcher.dart';
class AboutUsScreen extends StatefulWidget {
const AboutUsScreen({super.key});
@override
State<AboutUsScreen> createState() => _AboutUsScreenState();
}
class _AboutUsScreenState extends State<AboutUsScreen> {
final TextEditingController _controller = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: EdgeInsets.symmetric(horizontal: context.width * 25 / AppConstants.instance.appWidth),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: context.height * 33 / AppConstants.instance.appHeight),
Stack(
children: [
Align(
alignment: AlignmentDirectional.center,
child: Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
Translator.translate('more_about_us'),
style: const TextStyle(
color: Color(0xff222D4E),
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
),
Align(
alignment: AlignmentDirectional.centerEnd,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: RotatedBox(
quarterTurns: Initializer.instance.getTextDirection() == TextDirection.ltr ? 90 : 0,
child: SvgPicture.asset('ic_back'.svgPath),
),
),
),
],
),
SizedBox(height: context.height * 54 / AppConstants.instance.appHeight),
Text(
Translator.translate('main_target'),
style: const TextStyle(color: Color(0xff178756), fontSize: 16),
),
SizedBox(height: context.height * 11 / AppConstants.instance.appHeight),
SingleChildScrollView(
child: FutureBuilder(
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Text(
snapshot.data as String,
textDirection: TextDirection.rtl,
style: const TextStyle(
color: Color(0xff636E88),
fontSize: 13,
),
textAlign: TextAlign.justify,
);
}
return const CircularProgressIndicator();
},
future: rootBundle.loadString('assets/meta/about_us.txt'),
),
),
SizedBox(height: context.height * 20 / AppConstants.instance.appHeight),
Text(
Translator.translate('contact_to_us'),
style: const TextStyle(color: Color(0xff178756), fontSize: 16),
),
SizedBox(height: context.height * 24 / AppConstants.instance.appHeight),
Row(
children: [
GestureDetector(
onTap: _openInstagram,
child: Row(
children: [
const Text(
'Sonnat_islam',
style: TextStyle(color: Color(0xff404966), fontSize: 13),
),
SizedBox(width: context.width * 15 / AppConstants.instance.appWidth),
SvgPicture.asset('ic_instagram'.svgPath),
],
),
),
const Spacer(),
GestureDetector(
onTap: _openPhone,
child: Row(
children: [
const Text(
'+98 92300264',
textDirection: TextDirection.ltr,
style: TextStyle(color: Color(0xff404966), fontSize: 13),
),
SizedBox(width: context.width * 15 / AppConstants.instance.appWidth),
SvgPicture.asset('ic_phone'.svgPath),
],
),
),
],
),
SizedBox(height: context.height * 29 / AppConstants.instance.appHeight),
Text(
Translator.translate('send_message_to_us'),
style: const TextStyle(color: Color(0xff404966), fontSize: 12),
),
SizedBox(height: context.height * 12 / AppConstants.instance.appHeight),
TextFormField(
autofocus: false,
maxLength: 300,
controller: _controller,
maxLines: 10,
minLines: 4,
style: const TextStyle(
color: Color(0xff8D95AB),
fontSize: 10,
),
decoration: InputDecoration(
fillColor: Colors.transparent,
hintText: Translator.translate('send_message'),
filled: true,
counterText: '',
hintStyle: const TextStyle(
color: Color(0xff8D95AB),
fontSize: 10,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Color(0xff636E88)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Color(0xff636E88),
),
),
),
),
SizedBox(height: context.height * 9 / AppConstants.instance.appHeight),
Container(
decoration: BoxDecoration(
color: const Color(0xff178756),
borderRadius: BorderRadius.circular(12),
),
padding: EdgeInsets.symmetric(
horizontal: context.width * 20 / AppConstants.instance.appWidth,
vertical: context.height * 10 / AppConstants.instance.appHeight,
),
child: Text(
Translator.translate('send'),
style: const TextStyle(color: Color(0xffffffff), fontSize: 12),
),
),
SizedBox(height: context.height * 9 / AppConstants.instance.appHeight),
],
),
),
),
);
}
Future<void> _openInstagram() async {
var url = 'https://www.instagram.com/<Sonnat_islam>/';
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else {
throw 'There was a problem to open the url: $url';
}
}
// ignore: avoid_void_async
void _openPhone() async {
await launchUrl(Uri.parse('tel://+98 92300264'));
}
}