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 device orientation. As a designer, I choose to only display this app in portrait mode. The big reason why I do this is from my own experience. You are walking around, smartphone in hand, in the city you want to visit, and every time I move too much the app changes his orientation. I find it very annoying myself. So I just fixed this. So now the app can only be displayed in the upright orientation. For this I looked at both the native solutions and the Flutter solutions. The choice was easy. If I want to achieve this for all devices I have to write different codes in native language. And Flutter solution is the cross platform. So 1 time code. If it can be simple, why difficult.

See the hilited code below. To use the code you have to import the service package.

Import 'package:flutter/services.dart';


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
void main() async {
  // Binding and initialising of Firebase in Flutter app
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  runApp(
    ProviderScope(
      child: MyApp(),
    ),
  );
}


It is now very important that the entire UI is, so far, perfect. Because the same UI structure will be used for the second and third part of the app. Adjusting everything afterwards is counterproductive because then everything has to be adjusted three times.


So I will continue to look for the details that still need to be changed. And these must happen first. There are also a few people testing Beta. For the rest, the logic of the app is ready for the first big part.

I might like to change

There is one more thing I might like to change. And that's instead of a Listview.builder, to start using Slivers . Slivers scrolls a bit more elegantly. It is not necessary because it is a low-budget app. And in the prototype, a regular ListView has been used. I am going to study whether it is difficult to make the adjustments. I'll keep you informed.


So we are one step further, even if they are small steps. But rather small steps than running fast and then falling sharply just before the finish.


CU all next time.

Do, believe and be happy,

Stefaan

Comments

Popular posts from this blog

Thinking & coding: Linking Firebase to my Flutter App. Watch out for a important detail.

Software developer yes, but where to begin?

Thinking & coding: the Custom Navigation icons