Simply configure your i18next to specify the separator
i18next.init({
keySeparator: '.',
pluralSeparator: '.',
compatibilityJSON: 'v4'
});
Then you can just use t('reports', {count: 1})
with the following structure
"reports": {
"one": "report",
"other": "reports",
}
The answer is wrong. It is 3n+4. You have to consider the iteration of the loop as well.
Read this blog https://www.dynamicssmartz.com/au/blog/its-official-microsoft-dynamics-business-central-is-named-as-the-best-erp-by-forbes-heres-why/for better understanding.
try this
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts['Roboto-Regular.ttf'];
This issue seems to be a feature which is about to be implemented in keycloak-angular: https://github.com/mauriciovigolo/keycloak-angular/issues/604
php printer.dll is not support for php version 8.2
The error Multiple entry sections typically occurs when there are multiple entry points defined in the project, such as duplicate references to a Bundle.wxs file in the .wixproj. To resolve the issue, I removed the line: Compile Include=Bundle.wxs from the .wixproj file, ensuring that only one entry section is included in the project. After this change, the build succeeded without any errors.(wix5)
"I confirm that the problem was windows 11."
Can you elaborate on the fix? Having same issue.
In Vuetify 3.7
@use "sass:map";
@use 'vuetify/lib/styles/settings/variables' as *;
@media #{map.get($display-breakpoints, 'xs')} {
}
Kindly replace
"start": "react-scripts start" by "start": "react-scripts --openssl-legacy-provider start"
"build": "react-scripts build" by "build": "react-scripts --openssl-legacy-provider build"
This issue occurs because multiple versions of @types/react
are installed. Run yarn why @types/react
to check the installed versions. You can resolve this by using the resolutions
field or specifying a fixed version in your package.json.
When I change the Margin to 0.5 in options it is working fine as expected
const options = {
margin: 0.5,
filename: 'document.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' },
pagebreak: { mode: ['avoid-all', 'css', 'legacy'] }
};
This same issue i have facing in react with mui material dialog.
i found solution for that add this keyword in dialog disableEnforceFocus, disableRestoreFocus
Example solution :
<Dialog
fullScreen
open={open}
TransitionComponent={Transition}
disableEnforceFocus
disableRestoreFocus
>
Use the following command to determine which process is using the port (replace PORT with the actual port number your application is trying to use, e.g., 8000):
sudo lsof -i :PORT
Once you have the PID, terminate it using the kill command:
sudo kill -9 PID
2025 solution update
Macbook:
watchman watch-project 'your_file_path'
Windows:
Delete node_modules
folder and run npm install
Ensure that S3 bucket and Snowflake stage are in compatible regions
simple solution: put a label on top of the button..
The library you are using only supports Xamarin.Forms and does not appear to be maintained anymore. Additionally, it does not support .NET MAUI.
I suggest using another library that supports .NET MAUI. Plugin.Maui.Calendar seems to be a good choice.
Please note that since these are different libraries, the implementation of the control will be different. You will need to make the necessary customizations accordingly.
<html> <head> <style> body { background-color: rgb(0, 128, 0); } </style> </head> <body> <!-- Facebook ki content yahan aayegi --> </body> </html>
I haven't studied the inside enough. You just need to have an abortion, and then the warning will disappear.
Are you confused by the black color of the face on the right cube? Your light source is a directional projector (lamp). You illuminated one straight face on the red cube, but the light does not reach the green cube and the cube is black. Check:
from ursina import *
app = Ursina()
light = AmbientLight()
light.rotation = Vec3(0, 0, 0) # Setup light
e = Entity(model=Cube(), x=-2, color=color.green)
e = Entity(model='cube', x=2, color=color.red)
app.run()
you don't need to flip the normals, you need to set the light
I'm a bit late, but I came across the same issue. Your APK is missing hwasan symbols. The hwasan shared library must be available in the lib directory of your apk. If you extract your apk you want to see:
If you are using using a custom APK build config in your CMakeLists.txt, you may need to add something to copy this in. An easy way to test the theory is to extract using apktool, copy in the missing library, rebuild, sign, and test.
I am facing the same issue This my code-
import pdfMake from 'pdfmake/build/pdfmake';
import pdfFonts from 'pdfmake/build/vfs_fonts';
pdfMake.vfs = pdfFonts.pdfMake.vfs;
const handleDownload = async (option) => {
if (option === 'dashboard') {
const input = document.getElementById('dashboard');
if (!input) {
console.error('Element with ID dashboard not found.');
return;
}
html2canvas(input, { scale: 2 }).then((canvas) => {
const imgData = canvas.toDataURL('image/png');
const pdfContent = [
{
image: imgData,
width: 500, // Adjust the width based on your requirement
}
];
pdfMake.createPdf({ content: pdfContent }).download('dashboard.pdf');
}).catch((error) => {
console.error('Error generating PDF:', error);
});
} else if (option === 'everything') {
setIsDownloading(true);
const tabs = ['Dashboard', 'Overview', 'Milestone', 'Finance', 'Offtake', 'Interconnect', 'Land', 'Equipments', 'Construction', 'Operation'];
const pdfContent = [];
for (const tab of tabs) {
await captureTabContent(tab, pdfContent);
}
pdfMake.createPdf({ content: pdfContent }).download('everything.pdf');
setIsDownloading(false);
setActiveTab('Dashboard');
}
};
can somebody help
Waleed to get it done hvdzk McKim a gift card ♦️ my house and District you and I can get you a gift card ♦️♦️♦️♦️ my way r right now but ur a gift card for my house daughters and adjust add additional information to the house and District you too baby yet e and District you and I w Smith and the rye and
According to the package documentation, it requires a Node.js server to function.
I recommend setting up an Express API to handle the required functionality. You can then make calls to this API from your PHP application using curl or a similar HTTP client.
I'll put this here as I think it will help many people.
I just find out that "Quick access" links in the "Navigation Pane" of the "File Explorer" is locking all the folders it has links to.
So, if you can't make changes on a network folder even after all the people closing the apps directly using the files/folders, you all might also need to close all "File Explorer" windows.
Correct syntax is : pd.concat([df1, df2]) Don't forget "[" and "]".
Did you manage to fix this issue? I'm running into the same errors while extracting the email body. However, it works fine for email subjects. Please advise. Thanks!
If you want to use tools with your model, you need to use ChatOpenAI
instead of OpenAI
. Update your code as follows:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(temperature=0, api_key=openai_api_key, model="gpt-4o-mini")
Considering maven usage, you could use maven profiles with properties and reference those in the application.yml
pom.xml
<project ...>
<profiles>
<profile>
(...)
<properties>
<kafka.key>${SOME_KEY_STOREPWD}</kafka.key>
</properties>
</profile>
</profiles>
</project>
application.yml
kafka:
ssl:
key-password: '@kafka.key@'
See also:
Yes, you can definitely approach this in a way that minimizes string allocations, but you’ll have to be strategic about how you handle string data.
make sure you have ample threads allowance in docker settings, also make sure you properly close your threads after usage because if not closed properly, the threads will stay and cause blockage and eventually it will stop in docker due to resource utlitization
Answer for Bootstrap 5 without jQuery:
if (bootstrap.Modal.getOrCreateInstance(document.getElementById('myModal'))._isShown) {
// ...
}
You can use the editable prop on your component:
<DatePicker editable={false} />
There is a single starting point for each thread where all dynamically set parameters are initialized. However some of the parameters are the same across the entire process for all threads and other parameters are thread specific. Ideally it would be best if in the process later there is no need to know which parameters were set by which part and that they could all be accessed in the same way. Example: general settings: groupname = abc, base_lookback = 5 thread specific settings: final_lookback = 8 Ideally access to groupname, base_lookback, final_lookback should be the same ctx.base_lookback or ctx.final_lookback should both work without the thread having to know if the parameters are thread specific. Having a new dictionary for each thread would mean that the two parts of the data are separate or we would have to copy the general data into each thread specific dictionary.
From what I understood of extracontext it essentially does what we were trying to do - set up a contextvars which allows multiple variables. If we instantiate extracontext one time so that it acts as a singleton.
context.py
ctx = ContextLocal()
file1.py
from context import ctx
file2.py
from context import ctx
We would then have the same contextlocal used throughout the process. It can be initialized at the beginning with all general parameters and then per thread with thread specific parameters and it would be thread and async safe. Am I understanding correctly?
We could then add a decorator around it to lock it also.
You can do dataframe processing to collect all the val1, val2 into a list of tuple in a column e.g "vals".
The tree can be created with dataframe_to_tree_by_relation
and pass in the column "vals" as attribute_cols.
pd.core.frame.DataFrame
is a full reference to pd.DataFrame
. Therefore you can type hint pd.core.series.Series
as pd.Series
. You see why that is in the structure of the pandas package here
Can we remove specific attribute like 'font-size' in all styles?
click on left side three dot of Project
click on behavior after that follow screen flow and always select opened file
CarToast.makeText(carContext, "Location Permission is required", CarToast.LENGTH_LONG).show()
I did smth similar for a Cassandra running on K8s behind a load balancer. The solution was to write a custom LoadBalancingPolicy where you can build the query plan as you wish. Then, you can set speculative retry delay to 0 or some small value and get the effect you want.
Also, do you have an application in another DC as well? In that case, you can delegate retries to the client of your application, saying that DC A app is unavailable due to Cassandra in that DC is unavailable, so the client should retry the call to the app in the DC B.
They propose such setup in https://docs.datastax.com/en/developer/java-driver/4.17/manual/core/load_balancing/index.html#built-in-policies .
1.You can use React Context or Redux for in- memory state . 2.Also can use localStorage or sessionStorage for state persistence across refreshes. If you have more questions or problems, then please contact me.
Have anyone got solution to this problem?
follow these steps to get the uploaded file:
I'm having the same problems with automatically created excel reports, are the reports you are connecting to also auto created? I have used transformation via helper queries using Excel.Workbook, Folder.Files, Folder.Content. All return just the header row and the first row below the headers.
So I have found an answer (but not perfect)
The formula =IFERROR(SUMPRODUCT($O$4:$AH$4;N(OFFSET($AH$3;0;-COLUMN(O3:AH3)+COLUMNS(A3:O3))));0)
Returns the correct values, but in reverse. As a result I then need to use=SORTBY(O28:AH28;COLUMN(O28:AH28);-1)
to reverse the formula.
Can someone help me pack all in one formula ?
It's working for me in LangGraph version 0.2.67. The response_format
parameter was added recently. Try updating with: pip install -U langgraph
.
I suspect this has been disabled for all docs on ReadTheDocs though, as I read a comment about heavy loads on the servers.
Yes. This was the reason.
The error you receive indicates that there is an issue with the formatting of your .env file. In an nutshell (as @OlafdeL mentioned) for pydantic greater than 2.0.0:
from pydantic_settings import BaseSettings
class EnvSettings(BaseSettings):
allowed_hosts: list[str]
and then your .env should look like this:
ALLOWED_HOSTS='["host-1", "host-2"]'
For people looking for types for the latest JSON Schema 2020-12 version. I just created some since I could not find it anywhere: https://github.com/nfroidure/ya-json-schema-types
I have been experiencing the same issue for the past three days if you find the solution, please share it with us
In my case "Windows Kits" folder was located outside Program Files. Copy the file and place it inside Program Files and the error should be gone.
https://tigc.in Visit this website and scroll down the page. Then, search for any product and view its description. After spending 2-3 minutes, leave the website. After a while, you will receive a WhatsApp message with the same product link.
I know this is an old thread, but I'm sure people nowadays are still experiencing this issue. I have found one line of code that I entered in the Workbook.Open procedure that prevents formulas from autofilling through the entire table(s).
Just simply add this code in the workbook.open statement:
Private Sub Workbook_Open() Application.AutoCorrect.AutoFillFormulasInLists = False End Sub
I found a Solution for anyone encountering the Issue too:
Inside the SignInScreen add:
headerBuilder: (context, constraints, shrinkOffset) {return Sizedbox.shrink();},
Solved the issue for me! :)
Resolved. All I need was to add DOCKER_HOST variable in test
section of build.gradle
file.
test {
environment 'DOCKER_HOST', 'tcp://${my_remote_server_ip}:23760'
useJUnitPlatform()
}
New Chrome shows error
[Deprecation] Listener added for a 'DOMSubtreeModified' mutation event
In the code there was like this:
$(".t706__cartwin-prodamount").bind( 'DOMSubtreeModified',function() {
I changed it to:
$("[href*='#order']").on( "click", function() {
The issue occurs because Google Play uses a different App Signing Key in production mode. To resolve this:
Check the App Signing Key in Google Play Console:
Go to Google Play Console → Setup → App Integrity. Copy the SHA-1 key under the App Signing Certificate section. Update the App Signing Key in Firebase:
Go to Firebase Console → Project Settings → Your Apps. Add the SHA-1 key from the Google Play Console under the SHA certificate fingerprints section. Save your changes, and your Google Sign-In should work correctly in production.
No additional configuration is required. Let me know if you need further clarification! 🚀
You have to initialize model that you want to use with Ranker function in flashrank, you can define like:
from flashrank import Ranker
ranker = Ranker(model_name="ms-marco-MiniLM-L-12-v2")
then fill it like:
compressor = FlashrankRerank(model="ms-marco-MiniLM-L-12-v2", top_n=3)
compression_retriever = ContextualCompressionRetriever(
base_compressor=compressor, base_retriever=retriever)
Save the current headers as the first row of the dataframe using df.loc[-1] = df.columns
and adjust the index.
Rename the columns to the correct ones with df.columns = ['column 1', 'column 2']
.
Done!
I think I realised what the problem was and it was that echo
isn't a program on Windows so it can't be spawned as a process. I tried calling Odin through process_exec
and it displayed the usage message. This was after trying multiple commands like dir
, ls
, etc.
What you should try is to remove onClick and trigger postback manually with __doPostback. use this link as a guide:
__doPostBack function - CodeProject
function startTimer(e) {
e.preventDefault();
startMinutes = 1;
time = startMinutes * 60;
btnSubmit.prop('disabled', true);
btnSubmit.val('Resend');
timerElement.style.display = 'block';
if (!interval) {
interval = setInterval(updateTimerCountdown, 1000);
}
__doPostack('btnSubmit', '');
return true;
}
https://stackoverflow.com/questions/75135147/react-router-dom-v6-useblocker#:~:text=Data%20router.%20See-,Picking%20a%20Router.,-Example%3A is now a 404! RE this comment. Can someone please check what this should be now
Fixed the issue for me by changing "Use credential providers" in nuget settings to "Nuget/.NET ...r integrated". changes in settings
Lastly restart Rider.
I hope this helps.
Have now fixed this. Thanks to those who replied. I shall try my best to recount all the steps below.
Version issues
Firstly, I built my own Docker image for Doxygen. I suspect the existing images on Docker Hub (corentinaltepe/doxygen, hrektts/doxygen) would have worked too, but I wanted full visibility for debugging. Here is the Dockerfile that I used to build my Docker image. It runs Doxygen 1.9.8
because that's the latest version available in the Ubuntu default package repository at present.
FROM ubuntu:24.04
# Update
RUN apt-get update
# Install
RUN apt-get install -y vim doxygen graphviz
# Working directory
WORKDIR /doxygen/
I then generated a default Doxyfile from this version of Doxygen and changed the following settings. I think only the first two of these settings really matter, but I have included the remaining four for completeness and because they match the settings in the Doxyfile provided by Fabrice.
EXTENSION_MAPPING = .m=C++
FILTER_PATTERNS = *.m=/doxygen/m2cpp.pl
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
GENERATE_LATEX = NO
Having made these changes, I was sure that I was using a relatively recent version of Doxygen. Moreover, I knew that my Doxyfile matched the version of Doxygen. Ie: it didn't contain deprecated settings etc. In hindsite, I don't think any of these version issues were actually causing the problem, but it was good practise to resolve them.
EOL issues
Secondly, I ran the following Git commands suggested here.
git config core.autocrlf false
git rm --cached -r .
git reset --hard
Then I opened m2cpp.pl
in VSCode and changed the End of Line (EOL) Sequence in from CRLF to LF. I had tried doing this previously but suspected Git was somehow preventing the change. On this second attempt, having run those three Git commands, the change was successful. I tested this by opening m2cpp.pl
from Vim inside of an Ubuntu container and using :e ++ff=unix
to show ^M
carriage return characters, as suggested here. Sure enough, Vim showed that there were no ^M
characters.
Shebang issues
Thirdly, I changed the first line of m2cpp.pl
from #!/usr/bin/perl.exe
to #!/usr/bin/perl
. Apparently this is another Windows vs Unix thing. That first line tells the OS where to look for the Perl interpreter and Unix doesn't like the .exe
suffix.
Testing locally
Having made these changes, I built and ran my Doxygen container locally by mounting it onto the folder that contained my Dockerfile, Doxyfile, m2cpp.pl
and example MATLAB code in need of documentation.
docker build doxygen-image .
docker run -it --mount type=bind,src=$pwd,dst=/doxygen/ doxygen-image
Since I ran the container in interactive mode -it
, I was able to manually run commands in it. I ran the following commands inside of the /doxygen/
folder. The first one gives executable permission to m2cpp.pl
and the second one runs Doxygen.
chmod +x m2cpp.pl
doxygen Doxyfile
This produced HTML files containing the expected documentation. Very good.
Testing in pipeline
Finally, I needed to run all of this automatically inside of a BitBucket Pipeline. Here is the bitbucket-pipelines.yml
file that I wrote for that. There are no new 'discoveries' here - it just implements the same steps as when I was testing locally. The two export
commands are needed for building Docker images inside of a BitBucket Pipeline according to this thread. The command for running docker differs slightly from when I was testing locally. I don't entirely understand the difference, but the output seems to be the same. This automatically generates HTML documentation inside of the Pipeline. At present, I then manually download these files from BitBucket, but I shall configure this to instead send them to the server that will host the documentation.
image: docker:27.4.0
pipelines:
default:
- step:
name: Doxygen
script:
# Give executable permission to Doxygen MATLAB filter
- chmod +x m2cpp.pl
# Build Docker image
- export PATH=/usr/bin:$PATH
- export DOCKER_BUILDKIT=1
- docker build -f Dockerfile -t doxygen-image .
# Run Docker container, mount pwd, run Doxygen, remove container
- docker run --rm -v $(pwd):/doxygen/ doxygen-image /bin/bash -c "doxygen Doxyfile";
artifacts:
- html/**
services:
- docker
I feel stupid... It was not related to the Azure configuration per say. It was an additional parameter i didn't see in the initialisation of the Authentication on the server.
I was using passeport-microsoft strategy and changing prompt: 'consent'
solved the issue :
authenticate(req: any, options: any) {
options = {
...options,
accessType: 'offline',
prompt: 'select_account', // previsously was 'consent'
loginHint: req.params.loginHint,
state: JSON.stringify({
transientToken: req.params.transientToken,
redirectLocation: req.params.redirectLocation,
calendarVisibility: req.params.calendarVisibility,
messageVisibility: req.params.messageVisibility,
}),
};
return super.authenticate(req, options);
}
this thread helped me find out
Thanks for your help @Rukmini
I had the same issue. Remove references to the no.nils.wsdl2java plugin. Apply the io.mateo.cxf-codegen plugin and configure it to generate Java classes from WSDL files.
Here is a simple way to access CSS variables from the <script>
tag :
const rootStyles = getComputedStyle(document.documentElement);
const neutralColor = rootStyles.getPropertyValue('--color-neutral');
This might help:
Account.Order.Product[ProductName != "Hat"].ProductName[]
JSONata playground: https://jsonatastudio.com/playground/eca26832
I have this problem aswell with using wsl on Windows. i haven't really found a solution to this but instead of using 127.0.0.1:8000 you can use localhost:8000.
It still opens a new server for you on a new port but i dont know if this will give any problems later on.
You can use MATLAB save
function:
Using Turbo 8 via turbo-rails 2.0.11:
autofocus
did not work for me. It always moves the cursor to the start of the line in Firefox. Also, only one input field can have autofocus, but maybe I should have tried adding an ID for this.
The turbo_permanent
attribute works great. I am using #search to automatically submit after a certain timeout, triggering Turbo.visit(url, { action: "replace" })
to also update the GET params in the URL, no POST request needed.
<%= form.text_field :test_name,
placeholder: "Filter by test name...",
value: params[:test_name] || session[:test_name],
data: {
turbo_permanent: true,
action: "input->search-form#search keypress->search-form#submitOnEnter"
} %>
I encountered the same errors too and I still haven't found anything. Good luck finding a solution.
I have a little knowledge of Amazon S3, but i saw the issue of the boto official on the github. boto doesn't support for the python version 12 because boto3 only support for the python 3.11, 3.12, 3.13 and boto is no longer supported this year. my suggestion is to upgrade boto to boto3 if you want. I hope this answer can help you :)
Thanks
=TRANSPOSE(SUMPRODUCT(TRANSPOSE(B2:B6), TRANSPOSE(COUNTIF(ROW(C2:C6), ROW(C2:C6)))))
You will also notice your Gradle Daemon is also not started.
Happy Coding ;-|)
If your are selecting any text/Big length data's columns then your short option can takes time. No matter you are running short or conditions on this column or not. Try to remove this column from select list and check the response time, if response is fast then check some alternative solutions.
Instead of using plain width try using max-width and min-width
Finally I found the answer, only 2 lines :)
const flagsmith = useFlagsmith();
const allFlags = flagsmith?.flags;
These two commands saved me too.
sudo microk8s.refresh-certs --cert ca.crt and
sudo microk8s.refresh-certs --cert server.crt
Thanks a lot. 👍
ActiveDocument.Tables(1) .This refers to the first table in the document. Rows.Alignment. This centers the specified table horizontally.
ActiveDocument.Tables(1).Rows.Alignment = wdAlignRowCenter This works well and if you have any questions or problems , please contact me.
Just ran into this myself with another application, even when using unencrypted connections set by string.
Found a suggestion in the WINE bugs tracker to set an override for secur32.dll to native. This worked for my application.
I'm facing same issue right now. after my reserach i found that The problem is audio format. the ogg
format does not work IOS or Safari.
Also i checked it with various audio files like mp3
, amr
, wma
by using the sample audio resource : https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/en/latest/design-guide/audio-samples.html
Could you find a solution? I tried the "Double Head trick", but this didn't help.
Still not working. Anyone has idea about it.
The ways is coming but unfortunately the country map is missing.
You can use an ADO.NET connection with the ODBC Data Provider. This helped me solve the same issue with PostgreSQL.
The following article describes how to set nice value of thread: https://www.linkedin.com/pulse/how-modify-priority-linux-normal-non-real-time-threads-maxim-tseitlin-g67ge/
It contains code examples.
You can just use
horizontal-align { margin-inline-start: auto; margin-inline-end: auto; }
this will center the element exactally at center
I need this very much. My problem is that Students can edit their profiles at any Time, and they are using them to exchange or store cheat sheets during exams. Since outside the course everyone is Authenticated user...
I found this article by Zell Liew a nice approach.
I was unable to put WSL to work so I installed python and it worked enter image description here
The issue you're encountering seems related to the session timing out due to idle inactivity, which causes the session to expire. This results in the "Cannot read properties of undefined" error in your JavaScript when the user attempts to interact with the page after the session has expired. Since this works fine during development in Visual Studio but not when deployed, the problem likely stems from how the session timeout and cookies are managed in IIS or the ASP.NET application configuration.
Or Implement session expiration handling in JavaScript and/or server-side logic to gracefully handle expired sessions.
Or If necessary, investigate load balancing issues or use a centralized session store.
Styling the indicatorContainer
has no effect. You should apply the styles more specifically to dropdownIndicator
and clearIndicator
, even though the css naming convention refers it as indicatorContainer
.
The inconsistency in the names tricked other people too, as discussed here: https://github.com/JedWatson/react-select/issues/4173#issuecomment-680104943
Emacs 29 has a new command-line option, --init-directory [path]
.
This means you don't need any external packages like chemacs2
Additional Reference:
Use the Release version in Visual studio , and know that the working dir in $(ProjectDir) and you can change it in the solution explorer and it will work Insha'Allah!
I am faceing the same question, but there is nobody anwser this good quetion.
However I asked chatGPT to achieve this effect which is really similar to your desire behavior. I hope this can help for others to refer it. Here is code:
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: GestureControlledPage(),
);
}
}
class GestureControlledPage extends StatefulWidget {
const GestureControlledPage({super.key});
@override
_GestureControlledPageState createState() => _GestureControlledPageState();
}
class _GestureControlledPageState extends State<GestureControlledPage>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
);
}
void _handleDragUpdate(DragUpdateDetails details) {
// Update the controller's value based on the drag position
double delta = details.primaryDelta! / MediaQuery.of(context).size.width;
_controller.value -= delta;
}
void _handleDragEnd(DragEndDetails details) {
if (_controller.value > 0.5) {
// Complete the transition
Navigator.of(context).push(_createRoute()).then((_) {
_controller.animateBack(.0);
});
} else {
// Revert the transition
_controller.reverse();
}
}
Route _createRoute() {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => const NewPage(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0);
const end = Offset.zero;
const curve = Curves.ease;
var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
final offsetAnimation = !animation.isForwardOrCompleted
? animation.drive(tween)
: (_controller..forward()).drive(tween);
return SlideTransition(
position: offsetAnimation,
child: child,
);
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: GestureDetector(
onHorizontalDragUpdate: _handleDragUpdate,
onHorizontalDragEnd: _handleDragEnd,
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Stack(
children: [
// Current page
Transform.translate(
offset: Offset(
-_controller.value * MediaQuery.of(context).size.width,
0),
child: Container(
color: Colors.blue,
child: const Center(
child: Text(
'Swipe to the left to push a new page',
style: TextStyle(color: Colors.white, fontSize: 24),
textAlign: TextAlign.center,
),
),
),
),
// Next page (slides in)
Transform.translate(
offset: Offset(
(1 - _controller.value) *
MediaQuery.of(context).size.width,
0),
child: const NewPage(),
),
],
);
},
),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
class NewPage extends StatelessWidget {
const NewPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('New Page'),
),
backgroundColor: Colors.green,
body: const Center(
child: Text(
'This is the new page!',
style: TextStyle(color: Colors.white, fontSize: 24),
textAlign: TextAlign.center,
),
),
);
}
}
For node version 22.x and above you can use setDefaultHeaders: false in the http request options [default is true] DOCS.
You can follow this guide in order to fetch the stripe fees per transaction:
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_....');
const paymentIntent = await stripe.paymentIntents.retrieve(
'pi_...',
{
expand: ['latest_charge.balance_transaction'],
}
);
const feeDetails = paymentIntent.latest_charge.balance_transaction.fee_details;
For me this error occurred when changing Elastic beanstalk from single instance to load balanced, and it was caused because I had only one availability zone in Load balancer network settings