'How can i detect the contact of the finger with a specific widget (after being swiping from another point )
lets say the user put his finger on the screen , then swipe his finger to the specific widget How can i detect when the finger access to that widget
this is simple code
import 'package:flutter/material.dart';
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
children: [
const SizedBox(height: 20,),
Container(
alignment: Alignment.center,
color: Colors.green,
height: 200,
width: 200,
child: Text('let me know when you arrive me',style: TextStyle(color: Colors.white),)
),
const Spacer(),
Container(
alignment: Alignment.center,
color: Colors.red,
height: 200,
width: 200,
child: Text('start pont here',style: TextStyle(color: Colors.white))
),
const SizedBox(height: 20,)
],
),
),
);
}
}
Note: i have read in flutter doc that there Draggable class which handle this case
and to be honest it is doing very well but opportunity this is not fit my code
any other way is most welcome guys . thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

