platform exception in stripe_flutter - flutter-layout

Describe the bug
im facing the issue after the server to getting the clientsecret successfully after that i'm setup the stripe code then i click to hit the request of stripe payment getting I'm showing the platform exception i'm already update mainactivity.kt file fluttteractvity to fragment
below im paste the my issue which one showing into log please check and help me how to fix
PlatformException(flutter_stripe initialization failed, The plugin failed to initialize: Your theme isn't set to use Theme.AppCompat or Theme.MaterialComponents. Please check the README: https://github.com/flutter-stripe/flutter_stripe#android, null, null)

I think You are using
<style name="LaunchTheme" parent="#android:style/Theme.AppCompat.Light.NoTitleBar">
And it should be:
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
or just, copy and paste all the file in style.xml
https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml

Please add this to your both style file.
/android/app/src/main/res/values/styles.xml
2./android/app/src/main/res/values-night/styles.xml
#drawable/launch_background
true
?android:colorBackground

Related

JS code to move link location in custom policy doesn't work in azure b2c

I have to move my forgot password link, I used all steps for enabling javascript in my signin&signup custom policy like explained in this documentation.
My JS code is (it works in local html page not in azure) :
<script type="text/javascript" data-preload="true">
window.onload = function moveLinks() {
alert("Test!!");
/* Password Link*/
v_div = document.createElement("div");
v_div.setAttribute("id","divPass");
var passLink = document.getElementById("forgotPassword");
v_div.appendChild(passLink);
next.parentNode.insertBefore(v_div, next.nextSibling);
}
</script>
when I inspect the page I see my js code in the head, no error is detected, the alert does not appear and I do not understand where the error comes from!!
Can someone help please?
• The error is coming because your syntax is invalid because it seems you are trying to use an inline tag as a javascript element since it is throwing an unexpected token error but tags don’t work the same way they work in HTML as they still must follow javascript syntax, so they can’t contain arbitrary javascript code since you are modifying B2C page layout in custom policy code.
Thus, I would suggest you omit the tag and do the following. Below is just a sample reference: -
‘ import {javascript} from ‘<name of the referencing HTML file>’;
window.onload = function moveLinks() {
alert("Test!!");
/* Password Link*/
v_div = document.createElement("div");
v_div.setAttribute("id","divPass");
var passLink = document.getElementById("forgotPassword");
v_div.appendChild(passLink);
next.parentNode.insertBefore(v_div, next.nextSibling);
}
export passLink;
Hence, by using the ‘import’ parameter, the javascript code can be rectified successfully. Also, please refer to the links below for more clarity on the code modification and compilation: -
https://github.com/eslint/eslint/issues/10628
https://developer.salesforce.com/forums/?id=9062I000000IKXYQA4
Also, please refer to the link below for more details on customizing the B2C UI: -
https://moviesdiag132.blob.core.windows.net/b2c/global.css

How can I make Plone portal registries find and cook new-style static resources?

All JS I register with an id such as ++theme++mythemename/js/myscript.js gives me the following error on portal_javascripts: (resource not found or not accessible)
I know the id is correct because I can access localhost/mysite/++theme++mythemename/js/myscript.js (even if Diazo is disabled).
If development mode is on the resource gets delivered on the final HTML. However on production mode cooking process fails silently. Or almost. Besides getting a different cachekey than the one showed on portal_javascripts/manage_jsComposition, I see the following error message by accessing the cooked file:
/* XXX ERROR -- access to '++theme++mythemename/js/myscript.js' not authorized */
Any hints on how to deal with those? Or will I really need to leave them uncooked?
Have you tried a browser:resourceDirectory instead of a plone:static ?
<browser:resourceDirectory
name="yourJsFolder"
directory="yourJsFolder"
layer=".interfaces.IThemeSpecific"
/>
and calling your js with :
++resource++yourJsFolder/yourJsFile.js
i added your observatorio.tema package to an existing plone 4.1 buildout and added a random js file to the js registry (positioned after collapsibleformfields.js so it gets properly cooked)
GS export looks like:
<javascript authenticated="False" cacheable="True" compression="safe"
conditionalcomment="" cookable="True" enabled="True" expression=""
id="++theme++observatorio/js/ui.js" inline="False" insert-after="collapsibleformfields.js"/>
no error in portal_jacascripts and the javascript file is included in /jquery-cachekey-e7bee35d43da7a91eb29c6586dcbd396.js
did you add cacheable="False" and cookable="False" for testing purposes?
https://github.com/observatoriogenero/observatorio.tema/blob/master/src/observatorio/tema/profiles/default/jsregistry.xml#L373
since plone:static internally is a resourceDirectory both should and do work with resourceregistries.
maybe there is some other code in your buildout that re-registers another (empty) directory for the same name (observatorio)?

Derbyjs TEMPLATE ERROR

I just started trying out Derbyjs, and I already ran into a problem. I can't find any support for this error, and most likely is some dumb mistake i'm making.
I'm trying to render a view, following the example from the www.derbyjs.com documentation.
My app is as simple as this:
var app = require('derby').createApp(module);
app.get('/', function (page, model) {
page.render('home');
});
My views are composed by two files.
"index.html"
<import: src="home">
<Body:>
Default page content
"home.html"
<Body:>
Welcome to the home page
I get the following error whenever the page is rendered:
TEMPLATE ERROR
Error: Template import of 'home'... ...can't contain content
As you can see, it is a very simple example. What am I missing?
I get that error even if I have the "home.html" file empty.
Well, I got the answer from one of the developers.
It seems like there was a subtle bug in the Template Parser that probably has already been fixed.
Having a whitespace or linebreak in front of
<import: src="home">
was causing the parser to raise the error. Writing
<import: src="home"><Body:>
solved the issue.

Copy/Paste Not Working in Chrome Extension

Following Copy/Paste code not working in Chrome Extension,
I need to write Chrome Extension that copy and paste data using clipboard.
I write following code in Backgroung.html page, but its not working.
function buttonClick(){
document.getElementById('initialText').select();
chrome.experimental.clipboard.executeCopy(1, function() {
alert("Copy");
document.getElementById('nameText').focus();
chrome.experimental.clipboard.executePaste(1, function() {
alert("Paste");
});
});
}
As of Chrome 13, clipboard access is no longer experimental.
The commands are now document.execCommand('paste'), document.execCommand('copy') and document.execCommand('cut').
However, permissions need to be added to your manifest: "clipboardRead" and "clipboardWrite".
Try implementing the above and see how you get on.
To eliminate the obvious; have you added the "experimental" permission to your manifest and are you using the latest dev build of Chrome as listed in the official documentation?
Otherwise, I'm not sure what may help you as I don't use the experimental API due to them not being usable in production. There is a workaround for copying without using the experimental API (using an input field and document.execCommand) but I'm not sure how to paste without it.
EDIT:
I've just noticed that experimental.clipboard is not longer listed on the experimental API page. It may be that this namespace has been deprecated/abandoned as can happen when using the experimental API. A simple test for this would be inserting;
console.log(typeof chrome.experimental.clipboard);
console.log(typeof chrome.experimental.clipboard.executeCopy);
console.log(typeof chrome.experimental.clipboard.executePaste);
Which should output the following the console for your background page;
> object
> function
> function

Making TTLauncherView open animated items

I'm currently working with Three20 in an iOS project. I've got the TTLauncherView displaying with a few icons. However, I can't see to get them to open their views in an animated fashion as with the Facebook app. I've tried:
[[TTNavigator navigator] openURLAction:[[TTURLAction actionWithURLPath:#"sb://launcher"] applyAnimated:YES]];
as well as
[[TTNavigator navigator] openURLAction:[[TTURLAction actionWithURLPath:URL.absoluteString] applyTransition:UIViewAnimationTransitionCurlDown]];
I also can't find anything on this documentation: https://github.com/facebook/three20/blob/60340d76780ac5ab8a5dc853e3577b1c854eb6e0/src/Three20/TTNavigator.h
Any help?
Thanks!
This should work. I just tried this in my code and the curl down transition works like expected. Here is the code which gets executed when the user taps an icon in the launcher:
- (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item {
[[TTNavigator navigator] openURLAction:[[[TTURLAction actionWithURLPath:item.URL] applyTransition:UIViewAnimationTransitionCurlDown] applyAnimated:YES] ];
}
Hope this helps.

Resources