import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; import 'package:get/get.dart'; import 'package:translator_lux/util/svg_asset.dart'; import 'package:translator_lux/util/tts_util.dart'; class TranslateTextFullScreenPage extends StatefulWidget { const TranslateTextFullScreenPage({super.key}); @override State createState() => _TranslateTextFullScreenPageState(); } class _TranslateTextFullScreenPageState extends State { String showData = ""; @override void initState() { super.initState(); SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeRight, DeviceOrientation.landscapeLeft, ]); showData = Get.arguments["data"]; } @override void dispose() { super.dispose(); SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); } @override Widget build(BuildContext context) { return Scaffold( body: Container( width: double.infinity, height: double.infinity, color: const Color.fromARGB(202, 78, 202, 140), child: SafeArea( child: Padding( padding: const EdgeInsets.all(8.0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: ListView(children: [ Text( showData, style: const TextStyle( fontSize: 64, color: Colors.white, fontWeight: FontWeight.w400, ), ), ])), GestureDetector( onTap: () { TtsUtil.translatorTtsPlay(showData); }, child: Container( width: 32, height: 32, padding: const EdgeInsets.all(5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(16), color: Colors.white, ), child: SvgPicture.asset( SvgAsset.speaker, ), ), ) ], ), ), ), ), ); } }