How to make this corousel slider clickable in flutter - flutter

Here is my code for corousel slider in Flutter, I want to make this slides clickable how can I do that?
When an image in corousel slider is clicked I want to open screen particular to the image category.
class _CarouselExampleState extends State<CarouselExample> {
List imgNews = [
"images/groceries.jpg",
"images/image_1.png",
"images/photographer.jpg",
"images/electrician.jpg",
];
#override
void initState() {
super.initState();
}
List<T> map<T>(List list, Function handler) {
List<T> result = [];
for (var i = 0; i < list.length; i++) {
result.add(handler(i, list[i]));
}
return result;
}
int _current = 0;
#override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Stack(
children: [
CarouselSlider(
options: CarouselOptions(
autoPlay: true,
height: 150,
viewportFraction: 1.0,
onPageChanged: (index, reason) {
setState(() {
_current = index;
});
},
),
items: imgNews.map(
(url) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ClipRRect(
child: Image.asset(
url,
fit: BoxFit.fill,
height: 150,
width: 300,
),
),
],
)
);
},
).toList(),
),
Padding(
padding: EdgeInsets.only(top:150),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: map<Widget>(imgNews, (index, url) {
return Container(
width: 6.0,
height: 8.0,
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 5.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _current == index ? Colors.red : Colors.blueGrey,
),
);
}),
),
),
],
)
]
);
}
}
I tried many ways but I was not able to make this corousel_slider clickable, anyone please help, when an image is clicked i want to open screen particular to the image category.

You can use InkWell widget wrapped in Material -
child: Material(
color: Colors.yellow,
child: InkWell(
onTap: () {
// Do something.
},
),
),
In your specific case -
...
items: imgNews.map(
(url) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ClipRRect(
child: Material(
color: Colors.yellow,
child: InkWell(
onTap: () {
// Do something.
},
child: Image.asset(
URL,
fit: BoxFit.fill,
height: 150,
width: 300,
),
),
),
),
],
),
);
},
).toList(),
...

Here is How you can do that
First Make Carousel Image clickable
in your Case: Wrap it With GestureDetector
ClipRRect(
child: Image.asset(
url,
fit: BoxFit.fill,
height: 150,
width: 300,
),
),
Second Then on Tap of Image Get the Image Index and Pass it to A Function
onTap: () {
imgList.indexOf(url);
indexMethod(imgList.indexOf(url).toString());
},
Last Create a Method
indexMethod(String index) {
switch (index) {
case '0':
{
Navigator.push(
context,
MaterialPageRoute(builder: (context) => HelpPage()),
);
}
break;
case '1':
{
Navigator.push(
context,
MaterialPageRoute(builder: (context) => UpdatesPage()),
);
}
break;
case '2':
{
Navigator.push(
context,
MaterialPageRoute(builder: (context) => UserProfile()),
);
}
break;
}
}
I Just Added This Functionality to My CarouselSlider :D

Related

How to use CupertinoTimerPicker in AlertDialog

When I use CupertinoTimerPicker in AlertDialog I'm Getting LayoutBuilder Error.
How can I use CupertinoTimerPicker in AlertDialog?
This is my code:
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 300,
child: CupertinoTimerPicker(
onTimerDurationChanged: (value) {}
),
)
],
));
},
);
Error Message
throw FlutterError(
'LayoutBuilder does not support returning intrinsic dimensions.\n'
'Calculating the intrinsic dimensions would require running the layout '
'callback speculatively, which might mutate the live render object tree.',
);
You can use like this and also the output in image below
Duration selectedValue;
Container(
margin: EdgeInsets.all(40),
width: double.infinity,
height: MediaQuery.of(context).size.height*0.1,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
CupertinoButton(
child: Text("Show Picker"),
onPressed: (){
showTimerPicker();
},
),
Material(
child: Text(
"$selectedValue",
style: TextStyle(
fontSize: 18
),
),
),
]
),
),
void showTimerPicker() {
showCupertinoModalPopup(
context: context,
builder: (BuildContext builder) {
return Container(
height: MediaQuery.of(context).copyWith().size.height * 0.25,
width: double.infinity,
color: Colors.white,
child: CupertinoTimerPicker(
initialTimerDuration: Duration(hours:0, minutes: 0, seconds: 0),
onTimerDurationChanged: (value) {
selectedValue = value;
setState(() {});
},
)
);
}
);
}
Output:
Use this method where you have a button and click on it
void showTimerPicker() {
showCupertinoModalPopup(
context: context,
builder: (BuildContext builder) {
return Container(
height: MediaQuery
.of(context)
.copyWith()
.size
.height * 0.25,
width: double.infinity,
color: Colors.white,
child: CupertinoTimerPicker(
initialTimerDuration: Duration(hours:0, minutes: 0, seconds: 0);
onTimerDurationChanged: (value) {
selectedValue = value;
setState(() {
});
},
)
);
}
);
}

How to switch images in the list?

I am getting a list with images. I receive several images, when I click on the image, the _showImageDialog method works for me and an image with buttons for scrolling is displayed (I attached a screenshot below). station.photos![index]. How can I switch to the next image when I click on the button? I tried to change the index but it didn't work for me why?
void _showImageDialog(
BuildContext context, PublicChargingStationModel station) {
int index = 0;
showGeneralDialog(
context: context,
pageBuilder: (context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return SafeArea(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 15),
color: Colors.black.withOpacity(0.6),
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: () => Navigator.pop(context),
child: SvgPicture.asset(
constants.Assets.closeBold,
color: constants.Colors.greyLight,
height: 26,
),
),
),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {},
child: SvgPicture.asset(
constants.Assets.arrowLeft,
color: constants.Colors.greyLight,
height: 48,
),
),
const SizedBox(width: 20),
SizedBox(
width: MediaQuery.of(context).size.width / 1.6,
height: MediaQuery.of(context).size.width / 1.1,
child: station.photos!.isNotEmpty
? CachedNetworkImage(
imageUrl: station.photos![index].url,
imageBuilder: (context, imageProvider) =>
Container(
// width: MediaQuery.of(context).size.width / 1.6,
height: 116,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
placeholder: (context, url) => Center(
child: Container(
// width: MediaQuery.of(context).size.width / 1.6,
height: 116,
alignment: Alignment.center,
child: const CircularProgressIndicator(
color: constants.Colors.purpleMain,
),
),
),
errorWidget: (context, url, error) => const Icon(
Icons.error,
color: constants.Colors.purpleMain,
),
)
: Image.asset(
constants.Assets.publicStation,
fit: BoxFit.cover,
),
),
const SizedBox(width: 20),
GestureDetector(
onTap: () {
if (index < station.photos!.length) {
setState(() {
index++;
});
station.photos![index].url;
}
},
child: SvgPicture.asset(
constants.Assets.arrowRight,
color: constants.Colors.greyLight,
height: 48,
),
),
],
),
],
),
),
);
},
);
}
i am also facing same issue in mobile development then i know we have to rebuild the whole dialog and then it will work well
Reference for solve this same
int selectedRadio = 0; // Declare your variable outside the builder
return AlertDialog(
content: StatefulBuilder( // You need this, notice the parameters below:
builder: (BuildContext context, StateSetter setState) {
return Column( // Then, the content of your dialog.
mainAxisSize: MainAxisSize.min,
children: List<Widget>.generate(4, (int index) {
return Radio<int>(
value: index,
groupValue: selectedRadio,
onChanged: (int value) {
// Whenever you need, call setState on your variable
setState(() => selectedRadio = value);
},
);
}),
);
},
),
);
When you call setState then it call the build method and a dialog is not a part of this context.so the simple solution is **wrap your dialog with statefulbuilder widget and then you will get a setstate method for dialog. **
You can checkout this video for solution
https://www.google.com/search?q=setstate+in+dialog+johannes+milki&oq=setstate+in+dialog+johannes+milki&aqs=chrome..69i57j33i160l5.11920j0j7&client=ms-android-samsung&sourceid=chrome-mobile&ie=UTF-8#

How do you set which widget is on top and which widget is on the bottom on 'Stack Widget' in flutter

hi guy so in my understanding of the stack widget is....
Stack {
children[ child1,child2]
}//child 2 will be on top of child 1 if they widget overlap.
But in my code that is not the case instead child1 is on top of child2. I suspected it might be because the second child is a listview.builder.here is my code
#override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight]
);
var container_width = MediaQuery.of(context).size.width;
var container_height = (MediaQuery.of(context).size.height);
return GestureDetector(
onDoubleTap: (){
log("the gesture dectector went off");
if(this.widget.changeview == true){
setState(() {
this.widget.changeview = false;
});
}
else{
setState(() {
this.widget.changeview = true;
});
}
},
child: Scaffold(
body: Stack(
children: [
DragTarget(
builder: (
BuildContext context,
List<dynamic> accepted,
List<dynamic> rejected,){
return Center(child: Padding(
padding: EdgeInsets.only(bottom: 50),
child: Container(
child: FittedBox(
child: this.widget.onaccept_draggable,
fit: BoxFit.contain,
),
decoration: BoxDecoration(border: Border.all(),color: Colors.green),
width: container_width/100*90,
height: container_height/100 *30,
),
));
},
onAccept: (AssetImage img){
setState(() {
this.widget.onaccept_draggable = Image(image: img);
});
},),
new Positioned(
bottom: 0,
child: Container(
width: container_width,
height: (this.widget.changeview) ? container_height/2: container_height/100*30,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: 7,
itemBuilder: (BuildContext context, int index) {
if(index == 6 ){
//there needs to be 1 flush in the player hands
return Ink.image(
image: AssetImage("assets/flushgame_cards/flush.png"),
fit: BoxFit.fill,
width: (this.widget.changeview) ? container_width/100*13: container_width/100*10,
height: (this.widget.changeview) ? container_height/2: container_height/100*20,
child: InkWell(
onTap: () {},
splashColor: Colors.blueAccent,
),
);
}
else{
int cards = this.widget.cards_at_my_hand[index];
return Draggable(
data: AssetImage(flush_cards_array[cards]["card_picture"]),
feedback: Material(
child: Ink.image(
image: AssetImage(flush_cards_array[cards]["card_picture"]),
fit: BoxFit.fill,
width: (this.widget.changeview) ? container_width/100*13: container_width/100*10,
height: (this.widget.changeview) ? container_height/2 : container_height/100*20,
child: InkWell(
onTap: () {},
splashColor: Colors.blueAccent,
),
),
),
child: Ink.image(
image: AssetImage(flush_cards_array[cards]["card_picture"]),
fit: BoxFit.fill,
width: (this.widget.changeview) ? container_width/100*13: container_width/100*10,
height: (this.widget.changeview) ? container_height/2 : container_height/100*20,
child: InkWell(
onTap: () {},
splashColor: Colors.blueAccent,
),
),
);
}
}),
),
),
],
)
),
);
}
}
So I tried initialising both of the widget in the initstate(){} like this solution
initState() {
// TODO: implement initState
super.initState();
//I initialise the widgets here
}
I also tried rearranging the widgets in different ways but still no luck. please help...

how update video while taping on flip button and rotate button in flutter?

//#dart=2.9
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:photomanager/Pages/Preview.dart';
import 'package:video_player/video_player.dart';
class CropScreen extends StatefulWidget {
const CropScreen({Key key, this.File}) : super(key: key);
final String File;
#override
_CropScreenState createState() => _CropScreenState();
}
class _CropScreenState extends State<CropScreen> {
VideoPlayerController controller;
Future<void> futureController;
#override
void initState() {
// TODO: implement initState
controller = VideoPlayerController.file(File(widget.File));
controller.setLooping(true);
futureController = controller.initialize();
controller.value.duration;
super.initState();
}
#override
void dispose() {
controller.dispose();
// TODO: implement dispose
super.dispose();
}
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
bottomNavigationBar: BottomAppBar(
color: Colors.black,
child: Row(children: <Widget>[
Padding(
padding: EdgeInsets.all(10),
),
Container(
height: 80,
width: 56,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Preview()),
);
},
//buttons for croping in different size
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
'assets/Crop/ic_default.png',
height: 56,
width: 56,
),
]),
)),
SizedBox(width: 20),
Container(
height: 77,
width: 56,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CropScreen()),
);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
'assets/Crop/ic_squre.png',
height: 56,
width: 56,
),
]),
)),
SizedBox(width: 20),
Container(
height: 77,
width: 56,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CropScreen()),
);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
'assets/Crop/ic_4_5.png',
height: 77,
width: 56,
),
]),
)),
SizedBox(width: 20),
Container(
height: 77,
width: 56,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CropScreen()),
);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
'assets/Crop/ic_2_3.png',
height: 77,
width: 56,
),
]),
)),
]),
),
body: Column(
children: [
Container(
height: 404,
width: 251,
child:
FutureBuilder(
future: futureController,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Center(
child: AspectRatio(
aspectRatio: controller.value.aspectRatio,
child: VideoPlayer(controller),
),
);
} else {
return Center(
child: CircularProgressIndicator(),
);
}
},
),
),
SizedBox(height: 22.47),
Container(
height: 50,
color: Colors.black,
child :Center(
child:Row(children:[
Padding(padding: EdgeInsetsDirectional.fromSTEB(100, 0, 0, 0)),
// flip the video right to left
InkWell(
onTap: () {},
child: ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.asset('assets/Crop/flip.png',
// width: 110.0, height: 110.0
),
),
),Padding(padding: EdgeInsetsDirectional.fromSTEB(100, 0, 0, 0)),
//I want to rotate 90degree while on tap on this
InkWell(
onTap: () {},
child: ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.asset("assets/Crop/ic_undo.png",
// width: 110.0, height: 110.0
),
),
),
])),
),
Container(
// color: Colors.white,
padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
alignment: Alignment.centerRight,
child: Column(children: [
FloatingActionButton(
mini: true,
backgroundColor: Colors.yellow,
onPressed: () {
if (controller.value.isPlaying) {
setState(() {
controller.pause();
});
} else {
setState(() {
controller.play();
});
}
},
// child:Text(controller.value.size);
child: Icon(
controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
color: Colors.black),
),
]),
),
]));
}
}
In above code i wnat to do rotation of the video and fliping of video where i have written above, and also in cropping section i get some difficulty so please help me out,or i want update every time with single code but i can't know how to do that
controller = call the video which is selected in previous page

Flutter : how to hide and show button on last and first index in listView

i set two buttons(left and right Button) on top of ListView. buttons work for scrolling on click. now i want to hide the left button when index is 0 and the right button when index is last. more explain to clear, the left button will be hidden in first index and the right button will be hidden in last index. please help me.
class ScrollingLeftAndRightButtonHide extends StatefulWidget {
#override
_ScrolllingOnClickButtonState createState() =>
_ScrolllingOnClickButtonState();}
class _ScrolllingOnClickButtonState
extends State<ScrollingLeftAndRightButtonHide> {
final _controller = ScrollController();
var _width = 100.0;
#override
Widget build(BuildContext context) {
var sizeDevice = MediaQuery.of(context).size;
this._width = sizeDevice.width;
var recentIndexIncrease = 0;
var recentIndexDecrease = 0;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Column(
children: <Widget>[
Expanded(
flex: 1,
child: Container(
color: Colors.green,
)),
Expanded(
flex: 2,
child: Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: ClipOval(
child: Material(
color: Colors.blue, // button color
child: InkWell(
splashColor: Colors.red, // inkwell color
child: SizedBox(
width: 56,
height: 56,
child: Icon(Icons.arrow_back)),
onTap: () {
var recentIndexDecreaseMinus =
recentIndexDecrease--;
_animateToIndex(recentIndexDecrease);
},
),
),
),
),
Expanded(
flex: 2,
child: Container(
color: Colors.transparent,
)),
Padding(
padding: const EdgeInsets.only(right: 8),
child: ClipOval(
child: Material(
color: Colors.blue, // button color
child: InkWell(
splashColor: Colors.red, // inkwell color
child: SizedBox(
width: 56,
height: 56,
child: Icon(Icons.arrow_forward)),
onTap: () {
_animateToIndex(recentIndexIncrease);
},
),
),
),
),
],
)),
Expanded(
flex: 16,
child: Container(
// height: 400,
child: ListView.builder(
controller: _controller,
scrollDirection: Axis.horizontal,
physics: PageScrollPhysics(),
itemCount: word_data.drink.length,
itemBuilder: (BuildContext context, int index) {
recentIndexIncrease = index;
recentIndexDecrease = index;
var wordDataReplace = word_data.drink[index]
.replaceAll(" ", "_")
.toLowerCase();
return Container(
child: Column(
children: <Widget>[
Expanded(
flex: 6,
child: GestureDetector(
child: Container(
color: Colors.purple,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Image.asset(
"asset/drink_images/" +
wordDataReplace +
".png",
fit: BoxFit.contain,
),
),
),
)),
],
),
width: sizeDevice.width,
);
}),
color: Colors.yellow,
),
),
],
),
),
);
}
_animateToIndex(i) => _controller.animateTo(_width * i,
duration: Duration(seconds: 1), curve: Curves.fastOutSlowIn);
}
this image of (ListView with top two Button)
I think it might be easier for you to replace ListView.builder by a Flutter_Swiper it will make your life a lot easier. Or maybe you can add a listner to your ScrollController in the initState where it handles the value of two Boolean variables leftButtonEnabled and rightButtonEnabled and set them to true or false depending on the position of the Controller
EDIT :
here's an example of using Flutter swiper in your code, I tried to make it simple and in the same time adding multiple features that can help you ( like SwiperControl ) I hope it helps you a little bit.
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: ScrollingLeftAndRightButtonHide(),
),
);
}
class ScrollingLeftAndRightButtonHide extends StatefulWidget {
#override
_ScrolllingOnClickButtonState createState() =>
_ScrolllingOnClickButtonState();
}
class _ScrolllingOnClickButtonState
extends State<ScrollingLeftAndRightButtonHide> {
SwiperController _controller = SwiperController();
SwiperControl _control = SwiperControl(color: Colors.white);
double get _width => MediaQuery.of(context).size.width;
double get _height => MediaQuery.of(context).size.height;
bool inFirstPage = true;
bool inLastPage = false;
List<String> word_data = [
"First",
"Second",
"Third",
"Fourth",
"Fifth",
"Sixth",
"Last",
];
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Column(
children: <Widget>[
Container(
color: Colors.white,
child: Row(
children: <Widget>[
if (!inFirstPage)
IconButton(
color: Colors.indigoAccent,
onPressed: () {
_controller.previous();
},
icon: Icon(Icons.arrow_back),
),
Spacer(),
if (!inLastPage)
IconButton(
color: Colors.indigoAccent,
onPressed: () {
_controller.next();
},
icon: Icon(Icons.arrow_forward),
),
],
),
),
Expanded(
child: Container(
color: Colors.white,
child: Swiper(
controller: _controller,
control: _control,
loop: false,
scrollDirection: Axis.horizontal,
itemCount: word_data.length,
onIndexChanged: (value) {
if (value == word_data.length - 1)
setState(() {
inLastPage = true;
});
else if (value == 0)
setState(() {
inFirstPage = true;
});
else {
setState(() {
inFirstPage = false;
inLastPage = false;
});
}
},
itemBuilder: (BuildContext context, int index) {
return Container(
child: Column(
children: <Widget>[
Expanded(
child: GestureDetector(
child: Container(
width: _width,
alignment: Alignment.center,
color: Colors.indigoAccent,
child: Text(word_data[index]),
),
),
),
],
),
);
},
),
),
),
],
),
),
);
}
}
Add two variables in your state as
class _ScrolllingOnClickButtonState
extends State<ScrollingLeftAndRightButtonHide> {
bool leftEnabled = false; //this is initial visibility of left button
bool rightEnabled = true; //this is initial visibility of right button
........
Then in your build function where you are displaying left and right button add if statement
#override
Widget build(BuildContext context) {
var sizeDevice = MediaQuery.of(context).size;
this._width = sizeDevice.width;
var recentIndexIncrease = 0;
var recentIndexDecrease = 0;
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Column(
.............
if(leftEnabled)
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: ClipOval(
child: Material(
color: Colors.blue, // button color
child: InkWell(
splashColor: Colors.red, // inkwell color
child: SizedBox(
width: 56,
height: 56,
child: Icon(Icons.arrow_back)),
onTap: () {
var recentIndexDecreaseMinus =
recentIndexDecrease--;
_animateToIndex(recentIndexDecrease);
if (index == 0) { //Your logic to detect start of the list.
leftEnabled = false; //if it is the start make left invisible
}
if(list.size > 1)
rightEnabled = true; //whenever left button is pressed and your data has more than 1 element make right visible
setState(() {});
},
),
),
),
),
...............
Same code for the right button.
You cannot do it through your current structure of code. To achieve it you will have to move those arrow button Icons inside of the listView like this:
return ListView.builder(
scrollDirection: Axis.horizontal,
physics: PageScrollPhysics(),
itemCount: 5,
itemBuilder: (BuildContext context, int index) {
recentIndexIncrease = index;
recentIndexDecrease = index;
var wordDataReplace = word_data.drink[index].replaceAll(" ", "_").toLowerCase();
return Column(
children: <Widget>[
Row(
children: [
//Left arrow is the button indicating left arrow
if (index != 0) LeftArrow,
//Rightarrow is the button indicating right arrow
if (index != 4) RightArrow
],
),
Expanded(
child: GestureDetector(
child: Container(
color: Colors.purple,
padding: const EdgeInsets.all(10.0),
child: Image.asset("asset/drink_images/" +
wordDataReplace +
".png",
fit: BoxFit.contain,
),
),
)),
],
);
});