P
Подскажите плиз как сделать при скроллинге, чтобы автоматический скроллиося назад к предыдущему элементу, если недоскоролили полностью следующий элемент?
Size: a a a
P
Ю
MA
DV
DV
P
☕
☕
Ю
w
Exception has occurred.
SocketException (SocketException: Connection failed (OS Error: Too many open files, errno = 24), address = 192.168.1.13, port = 8080)
AG
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
// bool isLoggedIn = false;
MainAppState stateEnum = MainAppState.Loading;
Sockets socket;
// ignore: missing_return
Future<Widget> setLogin() async {
FlutterSecureStorage storage = FlutterSecureStorage();
String token = await storage.read(key: "token");
String id = await storage.read(key: "id");
// final serviceEnabled = await Geolocator.isLocationServiceEnabled();
final permission = await Geolocator.checkPermission();
if (permission == LocationPermission.always ||
permission == LocationPermission.whileInUse) {
Position res = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);
Redux.store.dispatch(
SetPositionStateAction(
PositionState(
position: CameraPosition(
target: LatLng(res.latitude, res.longitude), zoom: 18),
),
),
);
Redux.store.dispatch(SetUserStateAction(UserState(token: token, id: id)));
socket = Sockets(token);
setState(() {
stateEnum =
(token != null) ? MainAppState.Success : MainAppState.Initial;
});
} else {
setState(() {
stateEnum = MainAppState.UnableAccess;
});
}
}
AG
AG
AG
AG
w
w
AG
@override
Widget build(BuildContext context) {
setLogin();
return StoreProvider(
store: Redux.store,
child: MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: kPrimaryColor),
home: initial(),
),
);
}
}
w
w