Related
What I have done till now is make widget draggable and a drag target according to my requirements. What i want is when the user drops the draggable container into the drag target i want to show that dragged widget inside that big drag target container and able to score if that is the right option or not.
second problem i am having is that i am using Text to speech for the sound and it is not working i tried many things but still it isn't working. i have a play button and give it a letter like A,B,D,G etc. whenever user presses the button i want to play the sound of that button and drag the right container into the drag target. Thankyou for your help.
// ignore_for_file: prefer_const_constructors, file_names, non_constant_identifier_names
import 'package:dyslexia/pages/round_2/Q8sound.dart';
import 'package:dyslexia/utilities/nextButton.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import '../../utilities/QuestionWidget.dart';
class Q1DAD extends StatefulWidget {
const Q1DAD({Key? key}) : super(key: key);
#override
State<Q1DAD> createState() => _Q1DADState();
}
class _Q1DADState extends State<Q1DAD> {
String question =
"Listen to this letter sound and then choose the letter whose sound you hear";
var changeButton = false;
var score = 0;
final FlutterTts flutterTts = FlutterTts();
speak(word) async {
await flutterTts.setLanguage("en-US");
await flutterTts.setPitch(1);
await flutterTts.setVolume(10.0);
await flutterTts.speak(word);
}
var word = "M";
bool isPlayingMsg = false;
bool draged = false;
bool showDRag = false;
#override
Widget build(BuildContext context) {
bool isPlayingMsg = false;
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: true,
backgroundColor: Colors.cyan,
title: Text("AD&DY"),
),
body: Padding(
padding: const EdgeInsets.all(14.0),
child: Column(children: [
QuestionWidget(question: question),
SizedBox(height: MediaQuery.of(context).size.height * 0.05),
Material(
elevation: 5,
color: Colors.cyan[50],
child: ListTile(
onTap: () async {
speak(word);
isPlayingMsg = true;
},
leading: Icon(isPlayingMsg ? Icons.stop : Icons.play_arrow),
title: Text(isPlayingMsg ? "Stop" : "Play",
textScaleFactor: 1.2,
style: TextStyle(
color: Colors.black,
)),
),
),
Divider(
thickness: 1.0,
),
SizedBox(height: MediaQuery.of(context).size.height * 0.05),
Column(
children: [
DragTarget1(),
SizedBox(height: MediaQuery.of(context).size.height * 0.07),
Wrap(
spacing: 10,
runSpacing: 5,
children: [
draggableWord("M", false, score),
draggableWord("N", false, score),
draggableWord("O", false, score),
draggableWord("R", false, score),
],
),
],
),
SizedBox(height: MediaQuery.of(context).size.height * 0.1),
nextButton(changeButton: changeButton, Location: Q8sound()),
]),
),
);
}
int acceptedData = 0;
Widget DragTarget1() {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
DragTarget<int>(
builder: (
BuildContext context,
List<dynamic> accepted,
List<dynamic> rejected,
) {
return Material(
elevation: 10,
borderRadius: BorderRadius.circular(80),
child: Container(
height: 100.0,
width: 250.0,
color: Color.fromARGB(255, 78, 166, 178),
child: draged
? Container(
height: 50,
width: 70,
color: Colors.lightGreenAccent,
child: Align(
child: Text(word),
),
)
: Center(
child: Text('Drag target here'),
),
),
);
},
onAccept: (int data) {
setState(() {
draged = true;
showDRag = true;
});
},
),
],
);
}
Widget draggableWord(word, option, score) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
showDRag
? SizedBox()
: Draggable<int>(
// Data is the value this Draggable stores.
data: 10,
feedback: Container(
color: Colors.yellow[100],
height: 50,
width: 70,
child: Center(child: Text(word)),
),
childWhenDragging: Material(
elevation: 5,
borderRadius: BorderRadius.circular(10),
child: Container(
height: 50.0,
width: 70.0,
color: Colors.grey,
child: Center(
child: Text(""),
),
),
),
child: Material(
elevation: 5,
borderRadius: BorderRadius.circular(10),
child: Container(
height: 50,
width: 70,
color: Colors.lightGreenAccent,
child: Center(
child: Text(word),
),
),
),
)
],
);
}
}
here is my question widget
import 'package:flutter/material.dart';
class QuestionWidget extends StatelessWidget {
const QuestionWidget({
Key? key,
required this.question,
}) : super(key: key);
final String question;
#override
Widget build(BuildContext context) {
return Material(
elevation: 12,
color: Color.fromARGB(255, 125, 200, 210),
shadowColor: Colors.grey,
borderRadius: BorderRadius.circular(8),
child: Container(
height: 80,
width: 280,
alignment: Alignment.center,
child: Text(question,
textScaleFactor: 1.2,
style: TextStyle(
color: Colors.black,
))),
);
}
}
I have this menu on the floating button , but I could not align it correctly,
I want it to show directly above the floating button, this is how it looks in red box:
I want the pop up menu to be like this in red box , I tried to change offset number but did not work it just moves left and right
please help me find a solution I'm really struggling, I provided the code below please check it out
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: myPopMenu(context),
backgroundColor: Colors.white,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomNav(
onChange: (a) {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (c) => AppPage(initialPage: a,)),
(route) => false);
},
),
);
}
Widget myPopMenu(BuildContext context) {
return Theme(
data: Theme.of(context).copyWith(
cardColor: Colors.white60,
),
child: PopupMenuButton(
offset: const Offset(-90, 100),
icon: Image.asset('assets/logo.png', fit: BoxFit.cover, height: 40),
onCanceled: () {
setState(() {
isClicked = false;
});
},
onSelected: (value) {
setState(() {
isClicked = false;
});
print('pop up clicked');
if (value == 0) {
alertRate();
} else if (value == 1){
alertServices();
}else if (value == 2) {
alertAdditonalInfo();
}else if (value == 3){
alertReport();
}
},
itemBuilder: (context) {
setState(() {
isClicked = true;
});
return [
PopupMenuItem(
child: Center(
child: Text(
'Rate & Review',
style: TextStyle(color: Colors.black),
),
),
value: 0,
),
PopupMenuItem(
height: 4,
child: Container(
height: 2,
color: Colors.black,
),
),
PopupMenuItem(
child: Center(
child: Text(
'Edit Available Services',
style: TextStyle(color: Colors.black),
),
),
value: 1,
),
PopupMenuItem(
height: 4,
child: Container(
height: 2,
color: Colors.black,
),
),
PopupMenuItem(
child: Center(
child: Text(
'Edit Social Accounts',
style: TextStyle(color: Colors.black),
),
),
value: 2,
),
PopupMenuItem(
height: 4,
child: Container(
height: 2,
color: Colors.black,
),
),
PopupMenuItem(
child: Center(
child: Text(
'Report an Issue',
style: TextStyle(color: Colors.black),
),
),
value: 3,
),
];
}),
);
}
You can use stack and positioned widget to place it at specific height above bottom nav bar like this
class Sample extends StatelessWidget {
const Sample({Key? key}) : super(key: key);
#override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
alignment: Alignment.center,
children: [
Positioned(
bottom: 30,
child: Container(
color: Colors.grey,
width: 50,
height: 30,
child: Text('Hello'),
),
)
],
,
);
}
}
I need some help please. On startup, everything loads except the listview. When I do anything on the page the listview appears. Feels like a refresh/rebuild issue. How do I tell it to refresh the listview? I don't know where to maybe use setState (doesn't work in Scaffold)
Widget build(BuildContext context) {
return Scaffold(
appBar: _buildBar(context),
body: HouseLayout(),
);}
class HouseLayout extends StatefulWidget {
#override
HouseLayoutState createState() {
return HouseLayoutState();
}
}
class HouseLayoutState extends State<HouseLayout> with TickerProviderStateMixin {
#override
Widget build(BuildContext context) {
int y = 0;
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(taal.HuisTitle,
style: TextStyle(
fontWeight: FontWeight.normal,
color: Colors.white,
fontSize: 28,
)),
backgroundColor: Color.fromRGBO(61, 147, 243, 1.0)),
body: Stack(alignment: Alignment.bottomLeft, children: [
Column(children: [
Expanded(
flex: 10,
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, indexA) {
var kasNaam = kaste[indexA];
return Padding(
padding: EdgeInsets.all(0.0),
child: Column(children: <Widget>[
Card(
color: Color.fromRGBO(96, 166, 243, 1.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'$kasNaam',
style: TextStyle(
fontWeight: FontWeight.normal,
color: Colors.white,
fontSize: 20,
),
),
),
Container(
child: Row(
children: [
IconButton(
icon: Icon(Icons.edit,
color: Colors.white),
onPressed: () {
setState(() {
_editKasDialog(indexA);
});
}),
IconButton(
icon: Icon(Icons.delete,
color: Colors.white),
onPressed: () {
setState(() {
for (int i = 0;
i < kruideniers.length;
i++) {
if (kruideniers[i].kas ==
kaste[indexA]) {
y++;
}
}
if (y != 0) {
_deleteNotPossibleDialog(y);
}
if (y == 0) {
_deleteKasConfirmDialog(indexA);
}
});
}),
],
),
),
]),
),
_isSearching
? _buildSearchList(context, kasNaam)
: _bouKruideniersLys(context, kasNaam),
]),
);
},
itemCount: kaste.length,
)),
Container(height: 40),
]),
Container(color: Color.fromRGBO(61, 147, 243, 1.0), height: 40),
Positioned(
bottom: 0,
right: 0,
child: Stack(children: [
Container(width: 300, height: 350),
Positioned(...),
Positioned(...),
Positioned(...),
Positioned(...),
Positioned(...),
Container(width: 5, height: 5),
Padding(
padding: const EdgeInsets.all(8.0),
child: FloatingActionButton(
elevation: 5,
shape: CircleBorder(),
backgroundColor: Color.fromRGBO(16, 124, 243, 1.0),
child: SizedBox(
width: 56,
height: 56,
child: Icon(Icons.shopping_cart,
size: 35, color: Colors.white)),
splashColor: Colors.yellow,
onPressed: () {
setState(() {
Navigator.pushNamed(context, '/shop');
});
},
heroTag: null)),
],
),
),
]),
)
]));
}
Any help will be great! Thanks
I read kaste list from a txt file:
List<String> kaste = [];
void readFileH() async {
final fileH = await findFileH();
List<String> contents = await fileH.readAsLines();
String kas;
for (int i = 0; i < contents.length; i++) {
kas = contents[i].substring(0, contents[i].indexOf("#"));
contents[i] = contents[i].replaceRange(0, contents[i].indexOf("#") + 1, "");
kaste.add(kas);
}
kaste.sort();
}
Hi the problem is that the data is null when flutter render the ListView because the data isn't loaded, you need to use a wrap your ListView into a future builder, while the data is loading you can put a image or a circular progress indicator, when the data is loaded you render the elements into a ListView
Hey i am new in flutter please help me in my problem.My issue is that when i select a gridview item using inkWell() then image and text both no changed. I dont know why setState() method not work.
Widget getAdaptor( var index) {
bool isSelected = false;
return InkWell(
onTap: () {
setState(() {
isSelected = !isSelected;
print('' + isSelected.toString());
});
},
child: Container(
child: Column(
children: <Widget>[
Container(height: 80, width: 80, child: Image.network(imageBaseUrl)),
Row(
children: <Widget>[
Expanded(
child: Text(
'$title',
style: TextStyle(
color: isSelected ? Colors.red : Colors.black),
),
),
Container(
child: isSelected == true
? Image.asset(
'images/bike.png',
height: 20,
width: 20,
)
: Image.asset(
'images/tick.png',
width: 20,
height: 20,
),
)
],
),
],
)),
); }
You just remind me of how I was doing when I was new to this language.
Remember if you want to use setState(() {}); you need to put that variable outside a build widget
So, you can just put bool isSelected = false; outside a method and everything will be just fine.
Like this:
bool isSelected = false;
Widget getAdaptor(var index) {
return InkWell(
onTap: () {
setState(() {
isSelected = !isSelected;
print('' + isSelected.toString());
});
},
child: Container(
child: Column(
children: <Widget>[
Container(height: 80, width: 80, child: Image.network(imageBaseUrl)),
Row(
children: <Widget>[
Expanded(
child: Text(
'$title',
style:
TextStyle(color: isSelected ? Colors.red : Colors.black),
),
),
Container(
child: isSelected == true
? Image.asset(
'images/bike.png',
height: 20,
width: 20,
)
: Image.asset(
'images/tick.png',
width: 20,
height: 20,
),
)
],
),
],
)),
);
}
Your widget needs to be a stateful widget, as you are keeping track of isSelected and are updating the UI. With the current setup, the entire widget is rebuilt every time the state is changed, which also resets isSelected to false.
This should do what you want:
class Adapter extends StatefulWidget{
#override
State<StatefulWidget> createState() {
return _AdapterState();
}
}
class _AdapterState extends State<Adapter>{
bool isSelected = false;
#override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
setState(() {
isSelected = !isSelected;
print('' + isSelected.toString());
});
},
child: Container(
child: Column(
children: <Widget>[
Container(height: 80, width: 80, decoration: BoxDecoration(color: Colors.red)),
Row(
children: <Widget>[
Expanded(
child: Text(
'test',
style: TextStyle(
color: isSelected ? Colors.red : Colors.black),
),
),
Container(
child: isSelected == true
? Image.asset(
'images/bike.png',
height: 20,
width: 20,
)
: Image.asset(
'images/tick.png',
width: 20,
height: 20,
),
)
],
),
],
)),
);
}
ADDED PICTURE:
Edited: June23, 2020
for clarification... I. need these two buttons to not move at all and stay at the same position, when I scroll these buttons are stationary but as the page scrolls the movement of the page moves the buttons so meaning it won't be on line 1 any more if I scroll to line 4 first button is on line 4 and second button is on line 5. I don't want them to move at all... I
Basically, since I need to make the image do a command I need to add a button and code in order for it to do it or its just a png image.
need to add many buttons over the text within the picture ...How can I achieve this ..? I tried different tactics but as the scroll moves the buttons move too ..
I am creating an APP which has a lot of emphasis on the image in the background as such, their is text in arabic on that image per line and I want to add "material buttons" on top of this text. I was able to do this ... but then I used single child scroll which I only want the image to scroll but not the buttons. I want the buttons to stay in one specific position and not scroll , since the logic is on swiping right -- user will see the invisible material button become active and show English text for that specific position on swiping left user will see the arabic text that is on the image ....
please help
EDITED THE CODE TO ONLY SHOW THE ISSUE AND GOT RID OF COMMENTED CODE to show just one stack. -
LAYOUT USED:
Stack and laid out Image with single scroll and closed it off
and after that added the Raised button,
Layout needed:
Just want the single child scroll to scroll the image not the raised buttons that are on top of the image. I want those buttons to be stationary .... Maybe its a positional problem, I need to add the a different type of scroll ?
import 'dart:io';
import 'package:Quran_highlighter/main.dart';
import 'package:flutter/rendering.dart';
import 'package:system_shortcuts/system_shortcuts.dart';
import 'package:Quran_highlighter/Widgets/NavDrawer.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:zoom_widget/zoom_widget.dart';
import 'package:flutter/gestures.dart';
class Aliflaammeem extends StatefulWidget {
#override
_AliflaammeemState createState() => _AliflaammeemState();
}
class _AliflaammeemState extends State<Aliflaammeem> {
changeTextEnglish() {
setState(() {
bool _visible = true;
_visible = _visible;
textHolder = "All Praise and Thanks is to Allah the lord of the worlds";
});
}
changeTextArabic() {
bool _visible = true;
setState(() {
_visible = _visible;
});
}
#override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
return Scaffold(
body: Stack(
children: <Widget>[
Center(child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: SafeArea(
top: true,
bottom: true,
right: true,
left: true,
child: Image(
image: AssetImage('test/assets/quranpg0.png'),
fit: BoxFit.cover
// ),
// ),
// ),
// ),
// ),
// Container(
// child:Align(
// alignment: Alignment(.00,-.7
// ),
// // color: Colors.red,
// child: FloatingActionButton(
// // color: Colors.red,
// elevation: 9,
// onPressed: () => 0,
// child: Text("Static "))
// ),
// ),
Container(
child: Align(
alignment: Alignment(.00, -.8
),
child: _visible
? MaterialButton(
height: 70.0,
// minWidth: 36.5,
// minWidth: 85.0,
minWidth: 100.0,
onPressed: () => changeTextArabic1(),
onLongPress: () => changeTextEnglish1(),
// child: Text(labels[i]),
child: Text(surah0),
// color: Colors.cyan[400],
color: Colors.purple[300],
highlightColor: Colors.blue,
shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)
),
textColor: Colors.white,
padding: EdgeInsets.only(left: 80, top: 2, right: 78, bottom: 5),
)
:Container(),
),
),
Container(
child: Align(
alignment: Alignment(.00, -.35
),
child: _visible
? MaterialButton(
height: 70.0,
// minWidth: 36.5,
// minWidth: 85.0,
minWidth: 100.0,
onPressed: () => changeTextArabic1(),
onLongPress: () => changeTextEnglish1(),
// child: Text(labels[i]),
child: Text(label0),
color: Colors.cyan[400],
// color: Colors.purple[300],
highlightColor: Colors.blue,
// shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)
// ),
textColor: Colors.white,
padding: EdgeInsets.only(left: -4, top: 2, right: -4, bottom: 5),
)
:Container(),
),
),
Container(
child: Align(
alignment: Alignment(.00, 0.1
),
child: _visible
? MaterialButton(
height: 70.0,
// minWidth: 36.5,
// minWidth: 85.0,
minWidth: 100.0,
onPressed: () => changeTextArabic1(),
onLongPress: () => changeTextEnglish1(),
// child: Text(labels[i]),
child: Text(label1),
color: Colors.cyan[400],
// color: Colors.purple[300],
highlightColor: Colors.blue,
// shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)
// ),
textColor: Colors.white,
padding: EdgeInsets.only(left: 20, top: 2, right: 33, bottom: 5),
)
:Container(),
),
),
// for(int i = 0; i< labels.length; i++)
Container(
child: Align(
alignment: Alignment(.00, 0.54
),
child: _visible
?
MaterialButton(
height: 70.0,
minWidth: 100,
onPressed: () => changeTextArabic1(),
onLongPress: () => changeTextEnglish1(),
// Positioned(
// top: 21,
child: Text(label2),
disabledTextColor: Colors.transparent,
color: Colors.cyan[300],
// color: Colors.purple[300],
highlightColor: Colors.blue,
// shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)
// ),
textColor: Colors.white,
padding: EdgeInsets.only(left: 90, top: 0, right: 100, bottom: 5),
)
:Container()
),
),
Container(
child: Align(
alignment: Alignment(.00, .99
),
child: _visible
?
MaterialButton(
height: 70.0,
minWidth: 100,
onPressed: () => changeTextArabic1(),
onLongPress: () => changeTextEnglish1(),
// Positioned(
// top: 21,
child: Text(label3),
disabledTextColor: Colors.transparent,
color: Colors.cyan[300],
// color: Colors.purple[300],
highlightColor: Colors.blue,
// shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(60.0)
// ),
textColor: Colors.white,
padding: EdgeInsets.only(left: 120, top: 2, right: 118, bottom: 5),
)
:Container()
),
),
GestureDetector(onPanUpdate: (DragUpdateDetails details) {
if (details.delta.dx > 0) {
print("right swipe english");
changeTextEnglish1();
setState(() {
});
} else if (details.delta.dx < 0) {
print("left swipe arabic");
changeTextArabic1();
setState(() {
});
}
}
)))))]));}}
UPDATE:
After some research I've concluded that you can use floatingActionButton and floatingActionButtonLocation to position a floatingActionButton that will not be affected by scrolling. You could also use Center of Align to position it where you want.
I hope this works for you!
Original post:
I think the easiest and most efficient way would be to use a raisedButton passed in buttomNavigationBar. I've seen people using a CustomScrollView but the button kind of stutters when doing that. buttonNavigationBar seems to be the best way to go. You can use color and elevation to blend in with your background.
Don't forget to flag this as an answer if it was any help!
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
final text = "echo\n" * 1000;
#override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Static button"),
),
body: SingleChildScrollView(child: Text(text)),
bottomNavigationBar: Container(
color: Colors.white,
child: RaisedButton(
color: Colors.white,
elevation: 0,
onPressed: () => 0,
child: Text("Static Button"))),
),
);
}
}
I think you had to many Stack.
I just removed a few and made this working example.
Hope it's what you wanted.
class Aliflaammeem extends StatefulWidget {
#override
_AliflaammeemState createState() => _AliflaammeemState();
}
class _AliflaammeemState extends State<Aliflaammeem> {
var nameList = new List<String>();
final items = List<String>.generate(20, (i) => "Item ${i + 1}");
List<MaterialButton> buttonsList = new List<MaterialButton>();
#override
void initState() {
super.initState();
nameList.add("I love");
nameList.add("my ALLAH");
nameList.add("SWT Very Much");
}
List<String> labels = ['apple', 'banana', 'pineapple', 'kiwi'];
bool _visible = true;
int _counter = 0;
double _initial = 0.0;
var textHolder = "";
changeTextEnglish() {
setState(() {
_visible = true;
textHolder = "All Praise and Thanks is to Allah the lord of the worlds";
});
}
changeTextArabic() {
setState(() {
_visible = false;
});
}
#override
Widget build(BuildContext context) {
final title = 'Dismissing Items';
return Scaffold(
body: Center(
child: Stack(fit: StackFit.expand, children: <Widget>[
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: <Widget>[
Container(
color: Colors.red,
height: 300,
),
Container(
color: Colors.blue,
height: 300,
),
Container(
color: Colors.green,
height: 300,
),
Container(
color: Colors.yellow,
height: 300,
),
],
),
),
Container(
child: Align(
alignment: Alignment(.27, 0.1),
child: _visible
? MaterialButton(
height: 70.0,
minWidth: 85.0,
onPressed: () => changeTextArabic(),
onLongPress: () => changeTextEnglish(),
child: Text('$textHolder'),
color: Colors.cyan[400],
highlightColor: Colors.blue,
textColor: Colors.white,
padding: EdgeInsets.only(left: 10, top: 2, right: -1, bottom: 5),
)
: Container(),
),
),
for (int i = 0; i < labels.length; i++)
Container(
child: Align(
alignment: Alignment(-.5, 0.1),
child: MaterialButton(
height: 70.0,
minWidth: 36.5,
onPressed: () => changeTextArabic(),
onLongPress: () => changeTextEnglish(),
child: Text(labels[i]),
disabledTextColor: Colors.transparent,
color: Colors.cyan[300],
highlightColor: Colors.blue,
textColor: Colors.white,
padding: EdgeInsets.only(left: 46, top: 2, right: -20, bottom: 5),
),
// ),
),
),
GestureDetector(onPanUpdate: (DragUpdateDetails details) {
if (details.delta.dx > 0) {
print("right swipe english");
changeTextEnglish();
setState(() {});
} else if (details.delta.dx < 0) {
print("left swipe arabic");
changeTextArabic();
setState(() {});
}
})
])));
}
}