Thinking & coding: building up my landingpage.

In this code session I broadly built the landing page. Everything still with the standard themes and fonts. I also exported the necessary image from Figma to the assetsmap in my flutter project. The great thing about Figma is that you can use the images where you have put time to adjust them in the prototype, straight from the box in Flutter. With the adjustments you made in Figma design.










As you can see from the two images we are not there yet, but the basic widget tree has been built. Only the following properties must be introduced from the prototype. Distances, colors, font, etc.



The second major part of this session I have devoted to centralizing all constant data. Such that the complete app can be adapted to the wishes of the customer in 1 dart file. As they say it so beautifully in Flutter. A dedicated constants library, or did I say this just now hahaha.


The next post will be about adapting or overriding the thema to my prototype specs.

Do, believe and be happy,


Stefaan




Code


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import 'package:flutter/material.dart';
import 'package:my_first_production/owner_data/owner_data.dart';

//landing screen right side of the screen
class NavigationScreen extends StatelessWidget {
  const NavigationScreen({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        //color: Colors.white,
        image: DecorationImage(
            image: AssetImage(navigationScreenBackground),
            fit: BoxFit.cover),
      ),
      child: Scaffold(
        backgroundColor: Colors.transparent,
        body: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
          SizedBox(height: 100),
          Padding(
            padding:
                const EdgeInsets.only(left: leftPaddingNavigationScreenWidgets),
            child: Text(
              'City Visit',
              style: TextStyle(fontSize: 20),
            ),
          ),
          SizedBox(height: 10),
          Padding(
            padding:
                const EdgeInsets.only(left: leftPaddingNavigationScreenWidgets),
            child: Text(
              cityName,
              style: TextStyle(fontSize: 40),
            ),
          ),
          SizedBox(height: 10),
          Padding(
            padding:
                const EdgeInsets.only(left: leftPaddingNavigationScreenWidgets),
            child: Text(
              'Welcome',
              style: TextStyle(fontSize: 20),
            ),
          ),
          SizedBox(height: 10),
          Padding(
            padding: const EdgeInsets.fromLTRB(
                leftPaddingNavigationScreenWidgets / 2,
                0,
                leftPaddingNavigationScreenWidgets / 2,
                0),
            child: Container(
              height: 220,
              width: 300,
              decoration: BoxDecoration(
                image: DecorationImage(
                    image: AssetImage(navigationScreenCenterImage),
                    fit: BoxFit.cover),
              ),
            ),
          ),
          SizedBox(height: 10),
          Padding(
            padding:
                const EdgeInsets.only(left: leftPaddingNavigationScreenWidgets),
            child: Text(
              welcomeText,
              style: TextStyle(fontSize: 20.0),
            ),
          ),
        ]),
      ),
    );
  }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import 'package:flutter/material.dart';

// NavigationScreen data
const String cityName = 'Hulst';
const String welcomeText = 'Whe are happy to welcome you in our midieval city. Through the navigation bar on the left side you can pick an interest.';
final String navigationScreenCenterImage = 'assets/images/Top image.png';
const double leftPaddingNavigationScreenWidgets = 20;
final String navigationScreenBackground = 'assets/images/Background.png';

// NavigationRail properties


// NavigationRail Icons
final navigationScreenIcon = Icons.home_outlined;
final eventScreenIcon = Icons.event_available_outlined;
final parkingScreenIcon = Icons.local_parking_outlined;
final foodScreenIcon = Icons.fastfood_outlined;
final sosScreenIcon = Icons.medical_services_outlined;

// Color pallet
const colorPalletLight = Color.fromRGBO(192,215,188,1);
const colorPalletDark = Color.fromRGBO(23,79,83,0.8);
const colorPalletDarkButAndText = Color.fromRGBO(23,79,83,0.8);
const colorPalletLightBut = Color.fromRGBO(237,248,240,1);

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