Posts

Showing posts with the label thinking & coding

Thinking & coding: Small but important code implementations.

I was still able to employ a short programming session on Sunday. Yes, it will be difficult at this time to quietly program a few hours apart. It is very busy at work and with the "limited" holidays coming up, the family and relatives are also taking a little more time. So I produced a few little things. I also expanded my database with a few documents to test scrolling in the eventScreen. Then I have tested my App in as many situations as possible. Overflow There appears to be an overflow in the Row widgets of the eventCards, If the administrator of the backend enters texts that are too long, there is a problem. Text space is fairly limited in the UI, so I had to make sure that the code catches these errors. The only way I could find that works the way I want it to is to package the Row Widget with a Container Widget. And start using the dimension properties of this widget. Now space is limited and the widget will trim the excess text. Device orientation I also locked the d...

Thinking & coding: making my code Null safe.

Image
Hey everyone, I was able to start a programming session today. In this session I have built in the necessary security features in my code. The errors and exeptions, I wanted to catch today were the errors that were possible reading my data from the FireBase backend. And there were a few. Protect against reading non-existent database elements. In others words, the Null are intercepted. Catching a possible empty String, and this with the NetWorkImage Widget. In such a way that no more exception errors are possible when offering an incorrect or empty URL. Just a brief overview. My app only reads data. No data is written from the app to the backend. The backend is therefore managed by an administrator (the customer), who completes the database. In this case, therefore, a list of events and the data of these events. So I also have to secure the app against possible human error. I know you can secure that through the backend by building a structured portal that catches these errors. But then...

Thinking & coding: Studying on FireBase, ANSWER

Hi Hi. It was a tough week last week. I have invested a lot of time in research. And write very little in code. I have learned a lot. A serious study of error codes, as you can read in my previous post. In this post I will try to answer the problem I had with bulk data upload from the FireStore Database. First and foremost, I have been staring at the FireStore Console. Now I have also looked at the 'Google Cloud Platform' and its console. So I found a lot more information there. What did I learn. You cannot place images directly in the FireStore database, but you can place the link to the images. Which is then back in place, stored in the DataStorage. That is the method that I see everywhere. So we are so far on that. Furthermore, I cannot directly upload a large data file to the firestore without a detour. As I found in the documentation and also on Youtube and other information sources. I found the most explanation on the Youtube channel of 'Retroportal Studio' . Many...

Thinking & coding: I'm so greatful!! THANK YOU

Image
Hey everyone. What an emotional day. This morning I wanted to start a programming session, and then half of my software turned out not to work anymore. Without changing 1 line code. What was the problem. I could no longer read my data from the FireStore backend. I got a huge error. An Exception. Complete panic, unbelievable. I didn't get any head or tail. I have read this message countless times and did not understand it. It almost made me depressed, it controlled my day emotionally. And I have to admit this time it was really over my head. I had no choice but to give in to myself and ask for help from a good friend who has supported me since day 1. Max Weber from Flutter Explained .  I also threw the problem into the Matrix via Twitter. And several of my contacts responded very quickly. And offered possible solutions. Thank you all, and a super thank you to young developer / friend " Da Bot ". I have prepared a document with the error code as you can see above. I then sh...

Thinking & coding: Studying on FireBase.

Image
This session will be something completely different. I am going to look for a way to load my data into the backend in a simple and fast way. Because if you have to enter all data in Firestore via the console, that won't get you anywhere. In my search through the FireBase documentation, I came across the following. With the resulting problems. My data consists of various text elements, but also a image element. Now no images can be added to the database, according to the documentation. If a image is saved in the backend, this will be done in another FireBase service, Firestore. There you have a 'bucket' where you can dump this image data. So I have to store my photo element 'eventImage' in Firestore and all other 'event ......' elements in the Firebase database. Now there is no information on how to link them both, or I have not found it. At times like this, I am glad that we live with the infinite internet in this day and age. In the past, you could search l...

Thinking & coding: Snappy detail related to TweenAnimationBuilder

Today it is Friday. And what a great programming sessions I had this week. I am very happy with what I have achieved. And especially with the things that I have learned. As every Friday, there are no fundamental things planned in the programming. In addition to cleanup the code, which I do every week on Friday, I've also posted my TODOs for next week. I will probably also have time to write code here or there this weekend. But programming in the weekend is always seen by me as extra time. And that is not planned. What did I do today? What did I do today? I incorporated a few simple animations into the app. The animations are not for show, but rather functional. Although they are beautiful, I think, ....... And like every Friday the code is cleaned up and structured where necessary. Because I work without an appBar, I needed another 'BackButton' in my eventDetailScreen to return to the EventScreen with the EventCard's in the EventList. For that I used a simple FloatingAc...

Thinking & coding: a new screen, EventDetailScreen.

Image
In this programming session I am going to write the 'EventDetailScreen'. It will become a page showing all the info of the chosen event. In the 'EventCard' there is an 'InfoButton'. It is this button that will navigate the user to the detail screen. Lets start the journey. First I create a new Dart file in the project tree, the 'event_detail_screen.dart'. The class in this library will be named 'EventDetailScreen'. Then i largely build the UI of this new screen. That is all a bit of piecing and measuring, but in general, straightforward. The finishing touch will come later. Now its about the data handling. Now that I have some screen layout, I will try to link the data to this EventDetailScreen. My big question is, if I press the info button of an event card in the list of events, how do I get the correct details of the correct event in my detail screen. I'm going to fix the navigation first. When I push the info button, that I can go to the ...

Thinking & coding: Implementing the UI EventCard.

Image
Deploying my EventCard. After the last code session I got the StreamProvider of the Riverpod package up and running. And also be able to display the data from the backend using ListTile Widget, in the ListView.builder . And all this to test whether the code works so far. This includes the FirestoreFirebase service , the EventModel and the StreamProvider . Now I am going to replace the ListTile with the EventCard I wrote earlier. Let's see what problems we will encounter with this action. Normally, all of this should go pretty smoothly. Finally I bring the EventCard in the existing widget tree where the provider makes the data in stock. We will see. First and foremost, I modified the EventCard Widget. When we implement the EventCard, we have to create a possibility to access the variables. So we declare the necessary variables and build a named constructor. Code lines 5 - 17 Then I entered my variables in the UI code. Code lines 42, 49, 72 have been changed and later we will als...

Thinking & coding: Turning 180° with the code, a good lesson learned.

In this session I wanted to bring the eventcard into the listview. And then also the data of the backend. After all this I want to clean up the code a bit. I will still need a provider Still, I want to somehow separate the FirestoreService from the UI. I wanted to do this by extracting the widgets in the FirestoreService. But then I will still need a provider, a stream provider. Maybe I will switch to a FutureProvider later. I am not yet sure of that. I want to use Riverpod because I need 2 providers of the same type. I learned a good lesson So this session I learned a good lesson. If I want to separate the UI and the logic or backend I always need stat management. So I have to restore my thinking to the original idea. This will certainly not be the last time I have to overthrow my code to achieve my goal. But don't worry, we're flying back in there. A resume of what I have and should do. I have a Firestore service that reads the events from the backend. In the Firestore servic...

Thinking & coding: Building the UI EventCard to display in the Listview.

Image
This session I'm building a UI part. The "EventCard". There are 2 big reasons why I am now working on a UI part. The first reason is because this part is a logical consequence of the previous session, but also for motivation. Why motivation? The big advantage with UI construction is that you see noticeably strong progress with almost every new program line. Especially with the "hot reload" from Flutter. And you don't have that with the underlying logic code. And maybe this is just me, but I need that view of progress. I can understand that maybe for a seasoned SE this is not that important but for a newbie like me it is. Finally, don't forget that I have study work for almost every line of code. Because I don't want to just write a practice app, but a real production app. So I constantly ask myself whether I am using the correct programming method, and whether it can be more efficient. To start, I create a new folder in the project tree 'screen w...