Jetpack Compose: Stack cannot be resolved - android-jetpack-compose

I am new to Jetpack compose and I'm currently trying to implement a Stack (composable). For some reason, I can't get a reference to it. I have tried adding it to my imports as shown below, but the Stack part is not getting resolved.
import androidx.compose.foundation.layout.Stack
Autocomplete can't seem to get it either as shown below:
I included org.jetbrains.kotlin.android among the list of my plugins. Highlighted below is a list of my dependencies:
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.0-alpha02'
implementation("androidx.compose.ui:ui:1.0.0-beta07")
implementation("androidx.compose.ui:ui-tooling:1.0.0-beta07")
implementation("androidx.compose.foundation:foundation:1.0.0-beta07")
implementation("androidx.compose.material:material:1.0.0-beta07")
implementation("androidx.compose.material:material-icons-core:1.0.0-beta07")
implementation("androidx.compose.material:material-icons-extended:1.0.0-beta07")
implementation("androidx.compose.runtime:runtime-livedata:1.0.0-beta07")
implementation("androidx.compose.runtime:runtime-rxjava2:1.0.0-beta07")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.0.0-beta07")
How do I fix this?

Stack is deprecated. Use Box() instead.
Since Version 1.0.0-alpha04: "Stack was renamed to Box. The previously existing Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. (I94893, b/167680279)"
https://developer.android.com/jetpack/androidx/releases/compose-ui?authuser=1#1.0.0-alpha04

Related

Use Beamer package with Get package

So In general everything works for me, nevertheless I get an error in my console regarding Getx & Beamer types
Expected a value of type 'GetNavConfig', but got one of type
'RouteInformation'
I think that I know where the RouteInformation comes from:
List<BeamPage> buildPages(
BuildContext context, RouteInformationSerializable state) {
return [HomePage.beamLocation];
}
it is an argument of the buildPages() method, that has to be implimented due to the abstract Beamer class.
On the other hand I think that the
GetMaterialApp
expects a GetNavConfig, but gets a RouteInformation. Im not really sure whether the things that I interpreted are correct. So I have no idea how to do something against the error. How could I fix the problem?
Well, since you're trying to rely on the beamer package instead of the Getx routing management feature, then you do not need the GetMaterialApp, you need to just use the MaterialApp, and for the beamer you need to use the MaterialApp.router.
Getx is a package that offers separate features, you could get state management and dependency injection... working fine without GetMaterialApp.
However, this means that you will not be allowed to use navigation methods such as Get.to() and Get.toNamed(), you cannot use the Get.context, and you cannot use the Getx's bottom sheet and dialogs.

How can I programmatically set the value inside a complex Map/List by a given path in Dart?

Here is an example on DartPad.
The example has the commentary but let me explain anyway. Suppose we have a quite complex Map<String, dynamic> or a List<dynamic>, e.g. it might contain an integer inside a map inside a list inside another map inside another list...
I get a path, which I called targetPath and is a List<dynamic>, defining where the target value is inside this complex data.
I'd like to change the value referred by this targetPath but have no idea how to do that.
How can I change a value inside a List/Map given by a path?
Thanks in advance.
Troubleshooting
I have looked up some solutions on the internet which have not been applicable in my situation but I'd like to put them here and state why they did not work in my case.
Merging Two Maps
Combine/merge multiple maps into 1 map
I have come across this while looking for it but my case has targetPath which is not applicable to this situation. The question has many answers but none of it covers my case.
Environment
Dart 2.15.1
Flutter 2.8.1 (if relevant)
Actually, I have found a package called deeply, which addresses the same issue I have at hand.
All the examples adress Maps though. However, I took a quick look at the implementation, which seems to be friendly with List type at the first glance.

VS2019 custom template - parent variable prefix (ext_) not working

I am trying to create a custom template for VS2019 comprised of multiple projects (based on this guide), and I'm having problems with the references.
My solution is based on the classic 3-tier architecture (data/business/ui), so when I create a new solution - call it "MySolution", I get "MySolution.Data", "MySolution.Business" and "MySolution.UI" - all good. I need the business layer to have a reference to the data layer - however, using the $ext_safeprojectname$ variable just gives me an unresolved reference in the projects node of my dependencies to "$ext_safeprojectname$.Data"
Other variables seem to work fine - for example, if I use $safeprojectname$, I get "MySolution.Business.Data" in my reference - correct parsing of the variable, for the business layer project, but not the desired result.
Has the ext_ prefix been replaced? I cannot seem to find any documentation for this anywhere.
Thanks!
I was able to solve it after commenting on your question. I was missing the CopyParameters=true attribute for ProjectTemplateLink element in the .vstemplate file. It is mentioned as a tip on Create a multi-project template from an existing solution. My ext_ variables were replaced once I did this. Your ProjectTemplateLink element should look something like below:
<ProjectTemplateLink ProjectName="MyProject" CopyParameters="true">...</ProjectTemplateLink>

cakephp highchart fatal error while rendering

Here I am, again. With another question concerning cakephp-2.5 and the plugin 'highcharts'.
I've been looking at the demo's an all the different things I could find were the extendings from the controllers. But... that isn't required because it's a plug, am I right?
So, I have included th plugin to my loadings inside the bootstrap file, and when I'm trying to render my HighChart I'm receiving the following error;
Error: Chart: "1" could not be found. Ensure that Chart Name is the same string that is passed to $this->HighCharts->render() in your view.
But the demos are working fine! Any idea what I f*cked up? The names are the same, I even renamed them to 'asd' ( both! ) and it still doesn't work. ^^"
I know this is an incredibly late response but for the benefit of those still experiencing problems with this, the CakePHP 2.* Highcharts plugin has been updated and is compatible up to CakePHP version 2.5.7.
Do note however that in order to maintain product name consistency throughout the repo, all previous references to "HighCharts" have been changed to "Highcharts" and "high_charts" is now simply "highcharts" . So for eg. you now have to call $this->Highcharts->render() where before you would have used $this->HighCharts->render().
The plugin was not yet compatible with CakePHP 2.5. Right now as we speak the developer is working on a new release for 2.5. :)
In CakePHP 2.5, you can avoid the error above and render your chart by calling it.
For example from within index() within your controller, use:
$this->bar();
In this example, bar() is the name of the function containing your chart.

How to keep editor alive in Virtualtreeview?

I'm trying to build a simple 2 columns grid "property editor" based on VirtualTreeView.
(I want to mimic look and user experience seen on Delphi's IDE object inspector)
The component is working almost and can handle multiple editors,
but I'm facing an annoying bug :
When I click on a new node (a new row), the node is selected and the editor appears, regardless of the column I've clicked on. It's expected and OK.
Then, when I click on the first column of the same row, I expect to see my editor content validated and the editor keeping focus (like in delphi's object inspector).
But the editor content is validated then it disappear and the entire node (row) is selected. The editor won't get back (even if I click on second column), until I select another node and click back on the previously selected node.
EDIT : added illustration and precision about my code.
about the code :
I do not have inserted code here because I used (as a starting point) the exact same code as the one found on Advanced Demo (properties page)
What I tried and found out :
the 2003's compiled Advanced demo (properties tree page) found here seems to works like what I expect from my component (and from virtual treeview).
But when I compile this same demo (I tried with versions 4.5.2, 4.8.7 and even 5.0.0 from current trunk on google code, on both delphi 2007 and 2009) the bug reappears !
I first think there was a documented breaking change between 2003 and more recent versions,
but I can't find anything.
I've also played with all available options trying to solve this, but without success.
I still don't know if this problem comes from new delphi RTL or a breaking change (bug?) in virtualtreeview.
so my questions :
do you have the same problem when compiling Advanced demo ?
any tip or workaround in code to solve my problem ?
As a side note, I nearly give up with virtualtreeview this afternoon and I wanted to try a solution with another component... I found this interesting question and decided to try berg's component, but was stopped in the buying process when reading an advice on their homepage (see my comment on the related question)
The VSTs onChange just gets called by changing the selection of nodes. The state will not change anymore, if the node is already selected. So, you have to implement a behaviour similar to Object Inspector on your own, e.g. by calling VSTs EditNode()-Method in the OnClick-Callback:
procedure TMainForm.VSTClick(Sender: TObject);
var node: PVirtualNode;
begin
node:= VST.GetFirstSelected();
if(node <> nil) then
VST.EditNode(node, EDITABLE_COLUMN_INDEX);
end;

Resources