Flutter Archives - Female Tech Entrepreneur https://femaletechentrepreneur.com/category/becoming-a-tech-entrepreneur/technology/flutter/ Lessons learned from starting a tech company Sun, 29 Sep 2024 07:52:27 +0000 en-US hourly 1 https://femaletechentrepreneur.com/wp-content/uploads/2023/09/cropped-Favicon-Female-tech-entrepreneur-32x32.png Flutter Archives - Female Tech Entrepreneur https://femaletechentrepreneur.com/category/becoming-a-tech-entrepreneur/technology/flutter/ 32 32 Adobe XD to Flutter code https://femaletechentrepreneur.com/adobe-xd-to-flutter-code/?utm_source=rss&utm_medium=rss&utm_campaign=adobe-xd-to-flutter-code Sat, 23 May 2020 16:11:43 +0000 https://femaletechentrepreneur.com/?p=569 Transform your Adobe XD design to Flutter code with a single click. See how easy it is. Safe time transforming your designers work to beautiful apps.

The post Adobe XD to Flutter code appeared first on Female Tech Entrepreneur.

]]>

I’m happy to share with you a totally new feature to make your frontend work in Flutter much faster. Adobe XD have just released a new plugin that makes it possible for you to export your Adobe XD design to Flutter code, with a simple press of a button. It’s pretty cool!

Let’s check out how it works. 

Install Adobe XD to Flutter

Go to https://xd.adobelanding.com/xd-to-flutter/ where you can get direct access to download XD to Flutter. Follow their direction and install the plugin. When installed you will find the plugin under Plugins and you will be able to see a new panel as shown below.

adobe XD to Flutter plugin

Create a new Flutter project

When you export your design you need a project to export it to. So let us start be creating a new Flutter project. Check out my post on how to create a new Flutter project if you are new to Flutter.

In your pubspec.yaml file add adobe_xd to your dependencies.

adobe_xd: "^0.1.3"

You are now ready to export you design to Flutter. 

Export all widgets to Flutter

Now to the magic part exporting your Adobe XD design to Flutter code. Go back to Adobe XD and in the plugin panel choose UI Panel. Here you can choose your newly created Flutter project. When you are ready press Export All Widgets.

If you go to your lib folder in your Flutter project, you will now see a new file. You can rename it to what ever you want.

To see you results go to main.dart and change you home to be the new widget you have imported.

home: Stats(),

And run Flutter run.

Adobe XD Design

Adobe xd layout

Flutter layout

adobe XD to Flutter app view

That’s a really easy and fast way to export your design to functional code.

Let me know what you experience is with this new plugin. I personally look forward to working with it and seeing what difference it can make to my day to day work.

Happy coding 👩🏽‍💻

The post Adobe XD to Flutter code appeared first on Female Tech Entrepreneur.

]]>
Navigation in Flutter https://femaletechentrepreneur.com/navigation-in-flutter-getting-started/?utm_source=rss&utm_medium=rss&utm_campaign=navigation-in-flutter-getting-started Sun, 17 May 2020 16:20:07 +0000 https://femaletechentrepreneur.com/?p=509 Want to navigate between screens in Flutter. Here you will find a basic introduction to navigation in Flutter using Navigator, pushNamed, onGenerateRoute().

The post Navigation in Flutter appeared first on Female Tech Entrepreneur.

]]>

An app with only one screen isn’t fun, so lets learn about navigation in Flutter. In this post you are going to learn about Navigator, setting up routes and pass information from one screen to another. 

Navigation is a key element in apps as you only have limited space and therefor needs to navigate between screens often. We will start be getting the terminology in place. In Flutter screens and pages is called routes. If you already are familiar with developing Android or iOS apps, then you might know that in android a route is an activity and in iOS apps it’s a ViewController. But as everything else in Flutter route is a widget.

  • Navigator simple
  • Named routes with Navigator
  • Pass arguments with named routes
  • Navigation for scalable Flutter apps – onGenerateRoute()

Test the different navigation possiblities in your own app, while reading the post. This will help you to understand which option is best suited for your application. If you haven’t already started a Flutter project, you can follow my guide Creating a new Flutter project.

Navigator simple

If it’s your first time using Flutter and you want a simple way to navigate between two screens. Then, you can use this simple code snippet to navigate between two screens.

Navigate to a new screen: Navigator.push()

Navigate back to the previous page: Navigator.pop()

h

dart

// Within the `FirstRoute` widget
onPressed: () {
  Navigator.push(
    context,
    MaterialPageRoute(builder: (context) => SecondRoute()),
  );
}
// Within the SecondRoute widget
onPressed: () {
  Navigator.pop(context);
}

This is a really simple way to navigate between screens, but it will result in a lot of duplication if you want to navigate to the same screens in other screens. Furthermore, if your screens widgets are build in different files, then you have to import the file that include the screen you want to navigate to. So, are you building a larger application, then read further on and I will tell you about some other more scalable solutions. 

Named Routes with Navigator

Are you building an application containing more than two screens, then named routes is your go to. Here you define the routes, just like when you navigate on a website. “/” leads to the homepage and “/About” lead to your about page. You define the routes in MaterialApp as shown below.

h

dart

MaterialApp(
initialRoute: '/',
routes: {
'/': (context) => FirstScreen(),
'/second': (context) => SecondScreen(),
},
);

InitialRoute defines the home page for the app and routes defines the different screens. When you want to navigate between views you will now replace .push with .pushNamed as seen below. Tip: When using named routes you don’t need to define Home in MaterialApp.

h

dart

// Within the `FirstScreen` widget
onPressed: () {
  Navigator.pushNamed(context, '/second');
}
// Within the SecondScreen widget
onPressed: () {
  Navigator.pop(context);
}

If you have many screens/routes, then I will recommend that you create a separate file called router.dart and define your different routes there instead. This will make your code much easier to read. I will explain it in details in the following sektion. 

Navigation for scalable Flutter apps

Lets look at how you can setup your navigation in Flutter, so your app is ready for scale. We will be using named routes as explained above, but we will add the property onGenerateRoute().

onGenerateRoute() basically lets you create a function that calls the route settings.  It’s called in MaterialApp where it replaces routes and instead call the new router file. Which we are going to create in a bit.

If you have read my previous post, you know that I’m building a Flutter app that will present statistics for my company DecorRaid. We will continue working on this app, for this example. At this state my app only have one screen, statsView. That’s why I have used the simple navigation of just setting Home: StatsView(). Notice how I have to import the stats.view.dart file to be able to navigate to it.

h

main.dart

import 'package:flutter/material.dart';

import ‘package:DecorRaid_Admin/ui/shared/utils/appTheme.dart’;

import 'package:DecorRaid_Admin/ui/views/stats/stats.view.dart';

void main() => runApp(MyApp());


class MyApp extends StatelessWidget {

@override

Widget build(BuildContext context) {

return MaterialApp(

title: ‘Flutter admin’,

theme: ThemeData(

primaryColor: AppTheme.colors.dustyBlue,

),

home: StatsView(),

);}}

I’m planning that my app should include a lot more screens, as you properly also are for your app. So, to make it scalable from the beginning we are going to use onGenerateRoute().

Setup

But first we need some pages to navigate between. I have my statsView, but I will create a Home view as well. For now I will just create it in the main.dart file and add text widget.

h

main.dart

class Home extends StatelessWidget {

@override

Widget build(BuildContext context) {

return Scaffold(

body: Center(child: Text('Home')),

);}}

If you just created you Flutter project, you might want to have a look at my post about setting up a scalable folder structure

Routing Setup

Now it’s time to setup routing between your new screens. We will start be creating a new file called router.dart. Within this file we will define the settings for our navigation. If you have followed my example on how to structure your Flutter app folder, then you can add the file to ui > shared > utils.

In the file we are going to create a RoutePaths class. Because we are defining a class we don’t need to add “/” before the name of where we are navigating too. 

Furthermore, we are going to define a Router class that defines the function Route<dynamic> and takes in RouteSettings which onGenerateRoute() needs. Within this function we will define the different navigation cases. In our example we have Home and StatsView we want to navigate too. The settings provides two keys we can use, the name and the arguments. In this example we will only use the name as it’s the one used to determine which view to return. We will get back to arguments later in the post.

h

router.dart

import 'package:flutter/material.dart';
import 'package:DecorRaid_Admin/main.dart';
import 'package:DecorRaid_Admin/ui/views/stats/stats.view.dart';
 
class RoutePaths {
static const String Home = 'home';
static const String StatsView = 'statsView';
}
 
class Router {
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case RoutePaths.Home:
return MaterialPageRoute(builder: (_) => Home());
break;
case RoutePaths.StatsView:
return MaterialPageRoute(builder: (_) => StatsView());
break;
default:
return MaterialPageRoute(
builder: (_) => Scaffold(
body: Center(
child: Text('No route defined for ${settings.name}')),
));
}
}
}

Now to the last part. Go to main.dart and to your MaterialApp where we will remove home and declare onGenerateRoute and initialRoute instead. 

Remember to import your newly created router.dart file. In initialRoute you will declare which view will be your starting view and afterwards pass the generateRoute function to onGenerateRoute. 

h

main.dart

import 'package:flutter/material.dart';
import 'package:DecorRaid_Admin/ui/shared/utils/appTheme.dart';
import 'package:DecorRaid_Admin/ui/shared/utils/router.dart';
 
void main() => runApp(MyApp());
 
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter admin',
theme: ThemeData(
primaryColor: AppTheme.colors.dustyBlue,
),
initialRoute: RoutePaths.Home,
onGenerateRoute: Router.generateRoute,

);
}
}

Navigation

All your basic settings for using onGenerateRoute is set, so now when you want to navigate between views, you can use:

Navigator.pushNamed(context, Home); 
Navigator.pushNamed(context, StatsView);

Just remember everytime you add a new view you have to add the route in Router.dart.  

Pass arguments with named routes

Now we have learned how we can navigate between different screens in Flutter, but what if we want to pass information from one screen to another?

As an example lets make our ViewStats take in a string as a parameter.

h

stats.view.dart

import 'package:flutter/material.dart';
import 'package:DecorRaid_Admin/ui/shared/widgets/WKpiTracker.dart';
 
class StatsView extends StatelessWidget {
 final String title;
 
 StatsView(this.title);
 
 @override 
 Widget build(BuildContext context) {
  return Scaffold(
   appBar: AppBar(
   title: Text('$title'),
   ),
   body: Center(
    child: WKpiTracker(
     kpi: 'USERS',
     value: '4000',
     )
    )
   );
  }
}

 

h

main.dart

 class Home extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
return Scaffold(
 floatingActionButton: FloatingActionButton(onPressed: (){
 Navigator.pushNamed(context, RoutePaths.StatsView, arguments: 'STATS');
 },),
 body: Center(child: Text('Home')),
 );
 }
}
h

router.dart

case RoutePaths.StatsView:
var title = settings.arguments as String;
return MaterialPageRoute(builder: (_) => StatsView(title));

If you tap the floating action button on the Home view you’ll be navigated to the StatsView and see that passed title is there. You can pass any kind of  data in the arguments.

I hope you have enjoyed the guide and now know how to handle navigation in Flutter. 

If you have any questions or comments please reach out in the comments below.

Happy coding  👩🏽‍💻

The post Navigation in Flutter appeared first on Female Tech Entrepreneur.

]]>
Intro to Flutter Widgets https://femaletechentrepreneur.com/intro-to-flutter-widgets/?utm_source=rss&utm_medium=rss&utm_campaign=intro-to-flutter-widgets Sun, 03 May 2020 15:13:10 +0000 https://femaletechentrepreneur.com/?p=407 Flutter is all about widgets. Get a basic intro to Flutter Widgets so you can start coding. With Flutter widgets it's easy to create beautiful UI.

The post Intro to Flutter Widgets appeared first on Female Tech Entrepreneur.

]]>

Flutter is all about widgets, so that’s where we are going to begin out journey into coding in Flutter. This it going to be a basic intro to Flutter widgets, where we are going through what a widget is and what type of widgets that are available. You can import prebuilt widgets or build your own from scratch. We are going to take it step-by-step, but in the end you will be able to built you own widget. 

What is a Flutter widget?

Flutter is a framework for building beautiful UI, which is build out of widgets. A widget describes what the view should look like and if it should change based on a state like pressing a button. When a widget’s state changes, the widget is rebuild. The smart thing is, that a view often consist of multiple widgets and then if one of the widgets in the view changes, only that specific widget has to be updated/reloaded. This makes the user experience really smooth and fast.

When you initiate a new Flutter project it already consist of widgets. Below is shown a simple function runApp() that calls the given widget and makes it the root of the widget tree. In the simple example the widget tree consists of two widgets, the Center widget and its child, the Text widget. It’s called a widget tree as its an easy way to understand how the widgets are related. In this case the Center widget is the main branch and then it has a child within, which is a Text widget. The Center widget tells that whatever is inside that widget has to be centered. The Text widget allows us to present a text string. We can add style to the text widget if like to make it bold or change the color or fonts etc. 

h

dart

import 'package:flutter/material.dart';

void main() {
  runApp(
    Center(
      child: Text(
        'Hello, world!',
      ),
    ),
  );
}
Simple text widget flutter

Types of Flutter widgets – Stateless and Stateful

Before starting to build a widget you need to thing of the purpose of the widget. Is it going to be static or dynamic?

Static layout is not going to change after its build, like a your title or an image. You wouldn’t want your title to change based on user activity, right?

Dynamic layout is a layout that has the ability to change, like a button pressed that for instance add a product to your basket in a webshop.

These are the two different cases your should thing of, to figure out if it’s a StatelessWidget or a StatefulWidget you should use. Your views are often a StatelessWidget, like MaterialApp which is the root of your application. This is not going to change based on user activity, whereas a widget within a view might change and therefor is a StatefullWidget. With this basic introduction to Flutter widgets, we can try to build our own widget. 

Build your own Flutter widget

You will come across multiple widgets and likely make you own widgets as well. When you first get a hang of it, you will really appreciate the world of widgets. Let’s take a look at how you create a widget for your Flutter app.

You probably want to make a beautiful view with different functionalities. To do that we can break a view into widgets. Below is a view that I would like to build. The layout is for a Flutter webpage, but as Flutter code can be used for app and web development, the same code is used. First thing is the headline. A headline is usually text, so here we will use a basic Text Widget. But what about the rest if the UI? We are going to look at the container containing Key Perfomance Indicators (KPIs) for DecorRaid. In this tutorial we are only going to focus on the UI, but I will show in a later post, how we are going to connect Flutter with a backend. 

First step create a new view

To keep an overview of the different widgets and views of your app, start by structuring you folder. You can read how to in my previous post. In the Views folder create a folder called stats. Within that folder we create a dart file called stats.view.dart. This file is where we are going to combine the different widgets that define the UI of this specific view.  As the view is going to be static we will use a StatelessWidget.

Note: To show this view when running your app go to the main.dart file and add the view where it stands home:. Remember to import the view first.

h

stats.view.dart

import 'package:flutter/material.dart';

class StatsView extends StatelessWidget {
  @override 
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('STATS'),
      ),
        body: Center(
          child: Text('Hello, World!')
          )
    );
  }
}
Stateless widget Flutter

Second Step build a StatelessWidget

Within the stats.view.dart we will define the StatsView which extends the StatelessWidget. A StatelessWidget always consist of @override wherein you build your widget. It’s within the build() method that you define your layout. If you go to the main.dart you can see that the build functions return MaterialApp which is the primary widget of your Flutter app. But as we are building a specific view within the app, we will return another widget. I have chosen the Scaffold widget, as it returns a basic UI for showing a drawer, snackBar and buttons. 

Within the Scaffold widget the appBar is defined with a Text widget and within the body we can add the content for our view. 

Lets build our own widget that can be displayed within the body instead of the Text widget with “Hello World”. 

Third step build your own statelesswidget

To make the code organized we will create a new file in the folder lib > ui > shared > widgets called WKpiTracker.dart.  I add a W in the beginning to make myself aware that it’s a shared widget. I’m going to use this widget later on in another views of my app, that’s way I add it to the shared widget folder. 

StatelessWidget Flutter container

The widget is a KPI tracker that show the KPI name and the responding value. This is the widgets variable, but a variable could also be a color if you want it to display a different color depending on the view or type of KPI. This is your widget, so you decide.

h

WKpiTracker.dart

class WKpiTracker extends StatelessWidget {
  final String kpi;
  final String value; 

  WKpiTracker({this.kpi, this.value});

  @override 
  Widget build(BuildContext context) {
    return Container(

The variables that you want to change depending on where you use the widget, is defined in the beginning of your widget. We use final as it make it possible for us to define the variable in our class or function. After final we add what kind of variable is acceptable. It can be a String (text), Color or bool (true/false) etc. In this example we a using String.  Next you need to define what values that needs to be gathered when calling to WKpiTracker. This we can do by writing
WKpiTracker({this.kpi, this.value});

With the variables ready, we can build the UI.

Build the UI of your Flutter widget

First, we are building the box which is called a Container. Within the container you can customize the layout. If you have any questions to the code or styling then please add a comment below. I’m not going to go into details about the styling. But here you have the code and then you can copy it and change the format as you desire.

h

WKpiTracker.dart

import 'package:flutter/material.dart';
import 'package:DecorRaid_Admin/ui/shared/utils/appTheme.dart';

class WKpiTracker extends StatelessWidget {
  final String kpi;
  final String value;

  WKpiTracker({this.kpi, this.value});

  @override 
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.centerLeft,
      width: 250.0,
      height: 100.0,
      padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
      decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(10.0),
          color: AppTheme.colors.dustyTurquoise,
          boxShadow: [
            BoxShadow(
              color: AppTheme.colors.dustyBlue,
              blurRadius: 10.0, // has the effect of softening the shadow
              spreadRadius: 3.0, // has the effect of extending the shadow
              offset: Offset(
                5.0, // horizontal, move right 5
                5.0, // vertical, move down 5
              ),
            )
          ],
      ),   
    );       
  }
}

This code results in a turquoise box with round corners and a box shadow. Now it's time to add some text. To do that we a going to add a child to the container.  Add the below code after the closing bracket of BoxDecoration. The child makes it possible for us to add text inside the box. As we wants to add two Text widgets within the child, we add children to that child.  

h

WKpiTracker.dart

child: Column(
        children: [
          Padding(
            padding: const EdgeInsets.symmetric(
              horizontal: 0, vertical: 15),
              child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,      
                        children: [
                          Text(kpi, 
                              style: TextStyle(
                              color: AppTheme.colors.white, 
                              fontSize: 12.0
                              ),
                              ),
                          Padding(padding: const EdgeInsets.fromLTRB(0, 0, 0, 6),),    
                          Text(value, 
                              style: TextStyle(
                                color: AppTheme.colors.white, 
                                fontSize: 38.0)
                                ),
                        ],
                      ),
                    )
          ],   
        )  

Now you have your widget ready but before you can see it in action you need to add it to your view. So, go back to stats.view.dart and instead of the Text widget in your body you add the WKpiTracker widget you just build. To be able to use your new widget you have to remember to import it. And, remember to add your variables. Pretty cool you have build your first Flutter widget!

h

stats.view.dart

import 'package:flutter/material.dart';
import 'package:DecorRaid_Admin/ui/shared/widgets/WKpiTracker.dart';

class StatsView extends StatelessWidget {
  @override 
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('STATS'),
      ),
        body: Center(
          child: WKpiTracker(
            kpi: 'USERS',
            value: '4000',
          )
          )
    );
  }
}
Flutter KPI tracker widget

Add the widget as many times as you like, remember you need to add children to the child, if you want to add mulitple widgets to the body.

I hope this Intro to Flutter widgets helped you to understand widgets better and you feel comfortable with trying to build your own Flutter widget. If you have any questions or comments please reach out in the comments below.

Happy coding  👩🏽‍💻

The post Intro to Flutter Widgets appeared first on Female Tech Entrepreneur.

]]>
Flutter scalable app folder structure https://femaletechentrepreneur.com/flutter-scalable-app-folder-structure/?utm_source=rss&utm_medium=rss&utm_campaign=flutter-scalable-app-folder-structure https://femaletechentrepreneur.com/flutter-scalable-app-folder-structure/#comments Sun, 19 Apr 2020 10:23:43 +0000 https://femaletechentrepreneur.com/?p=412 Why not structure your app nicely from the begining. Here is my take on, a good folder structure for your Flutter app so it's ready for scale.

The post Flutter scalable app folder structure appeared first on Female Tech Entrepreneur.

]]>

Are you ready to begin on your new Flutter project? To make your work easier, I will share with you, how to setup your folder structure, so you can create a scalable Flutter app.

The folder structure is what I have used for all my Flutter projects. The structure will cover most apps needs. I will share with you what each folder is for and then you can decide what is necessary for your Flutter app.

First of all, you are mainly going to work in the Folder lib. This is also where I will show you how to set up your folder structure. Are you new to Flutter? Then, here is a short walkthrough of the default folders and files first.

Quick guide of the main folder structure in Flutter

.dart_tool is a folder that Flutter use, but you are not going to do anything in this folder. 

.idea includes the configuration for Android Studio, but again you are probably not going to change anything in that folder.

android is the folder for all Android-specific changes. If you are planning on setting up your app to Android, you are going to add some things in here.

build is a folder automatically generated as a part of the flutter build process.

ios is the folder for all IOS-specific changes. 

lib is the folder you are going to spend the most time in. It contains your dart files, and include main.dart as a default.

test is a folder containing code which is written for the Flutter application in order to run automated tests when building. 

web will only show if you have setup your application to run on web. 

Files in your Flutter project

sssNow let us look at the files in your Flutter project.

.gitignore is a text file that includes all the folders or files that should be ignored when working with git. By default, the file will include some folders for instance .dart_tool and .idea, but you may have to add files here in the future.

.metadata is managed by Flutter automatically and you a never going to change anything in this file.

.packages is automatically generated based on Flutter SDK and is not a place you are going to change anything in.

flutter_admin_app.iml is named after your project and includes further settings of your Flutter project. Again, this is not a file you are going to make changes to.

pubspec.lock is generated based on pudspec.yaml. If you delete this file you can generate it again by getting packages from the next file.

pubspec.yaml is a file that you are going to be working with a lot. This file includes:

  • General project settings like name, description and version of the project
  • Project dependencies
  • Assets (e.g. images) which should be available in your Flutter project

README.md includes some links on how to get started.

Now you know the basics of what your Flutter project includes and we can move into the lib folder

Folder structure in the lib folder

You can structure your Flutter project as you want to. This is my take on a good project folder structure that has worked well for my Flutter apps. If you are creating a very simple application, then some of the folders may not be necessary for you.

Flutter is a framework for building beautiful UI, but you probably want to extract data from an API and handle some of the imported data in your app. That’s why I recommend that you separate your lib folder into two folders core and ui. The core folder will act as your communication center to your backend and the UI folder will include all the widgets and UI that will be presented in your app. 

The Core folder

In the core folder I have added three more folders apis, models, and services. The API folder includes all dart files that extract data from the APIs you are communicating with. In the models folder, I have all my dart files that convert the imported data from the APIs to a model, that the Flutter widgets can handle. Last, in the service folder I for instance have auth.service.dart, which is the service that handles the login API.

The UI folder

In the UI folder I have separated the files into shared and views. The shared folder is for all files that are used in multiple places in the project. Where the views folder is for all the different views you have in your project. Each view is separated into its own folder to make it easy to keep an overview.

rThe shared folder I have separated into two folders utils and widgets. The utils folder includes all dart files that are used in multiple views as your custom theme file or the router file. The widgets folder includes all your custom-made widgets, that you want to reuse as the appbar or a button. 

As I mentioned the views folder is separated into as many different views, as you have in your Flutter project. Within each view, you can separate the code into two more folders if needed. First, you have the view.dart file which is the basic UI file for this view. But then you may have some widgets that you only use for this view, but want to use it multiple times within the view. You can add these widgets to the widget folder. If your view includes blocs you can add these to a bloc folder as well. 

I hope this helped you get an idea of how you can setup your folder structure in your Flutter project, so it’s ready to scale. Not sure what your new Flutter project should be, then I have shared a few ideas in my previous post, Choosing a Flutter project

If you have any comments or wanna share how you structured your Flutter project, please reach out to me.

Have a great day and happy coding 👩🏽‍💻

The post Flutter scalable app folder structure appeared first on Female Tech Entrepreneur.

]]>
https://femaletechentrepreneur.com/flutter-scalable-app-folder-structure/feed/ 11
Choosing a Flutter project https://femaletechentrepreneur.com/choosing-a-flutter-project/?utm_source=rss&utm_medium=rss&utm_campaign=choosing-a-flutter-project Fri, 17 Apr 2020 17:49:06 +0000 https://femaletechentrepreneur.com/?p=382 Do you want to learn to code your own Flutter app, but needs a project? Here I'm going to share with you my approach to choosing a Flutter project.

The post Choosing a Flutter project appeared first on Female Tech Entrepreneur.

]]>

Have you ever thought of building your own flutter app?  I’m going to share with you, my ideas for choosing a Flutter project. As an extra I’m going to share the Flutter project idea I have chosen to work on. This is part 2 in the series on building a new Flutter app from scratch.

What should you build? I know that it’s not all of you who have an app idea. But, I really recommend that you find a project you are really motivated to solve. I’m going to take you with me on my journey to finding a starter app project. I already have experience in Flutter as I’m in charge of our Flutter app development in my company DecorRaid. But I didn’t build the app myself and therefor I want to learn how to code a Flutter app from the beginning, I don’t find it motivating to build the same app from scratch, as I already know the code base. So, instead I have found a project that motivates me to learn Flutter.

Examples of Fun Flutter Projects

For finding a project that motivates you, try looking at your life and think of which features could make your life easier. Maybe, your hobby is cooking, then wouldn’t it be cool with your own recipe app? Think creative, to get your ideas rolling, I have collected a few examples of fun Flutter proejcts you can build. 

  • Portfolio website
  • Book database of you favorite books
  • Notes app
  • Recipe app
  • Gardering notes with notifications
  • Remake your favorite app etc.

I’m going to build a Flutter app that can monitor my companies KPI’s with different stats. You can follow along in my example or find your own project. If you have your own website you can connect Flutter with Google Analytics and get data for your own Flutter Stats app. How to get data for your stats app we are going to figure out in a later post. Don’t think so much about what is possible at the moment, it’s about taking it one widget at a time. 

Make a Simple Mockup of your New Flutter Project

Before you start coding, you need to make a simple mockup of the Flutter project you have decided to code. With the mockup it will be much easier for you to figure out which widget you need. Start with one simple page of the app. I like to use Instagram to get inspiration for beautiful UI Design, by searching on hashtags like #appdesign #uidesign #uitrends.

It’s always good to get inspiration from others, especially if, there is not the big UI designer hidden in you. When you have gathered some inspiration for the UI, choose some colors that you like for your app. You can go to my post on How to Choose & Install a WordPress, where I go through what you should think about when choosing the color pallet for you website or app. The most important part it to choose three colors. But, I will really recommend you to read the post, as your app is going to look so much better if you are consistent with the use of colors.

How to draw a mockup of your Flutter project

For drawing a simple mockup of your app, you can use pen and paper or find an online drawing tool. I came across Adobe XD, where you easily can setup a new prototype for a mobile or web application. The really cool thing about it, is that they are working on making it possible to generate Dart code automatically from the design you have created. So far, it has been free for me to use. I started with this simple mockup, you can see below. I added some text to help me figure out which widgets that can build my UI. To learn more about widgets go to Flutterbyexample.com they are really great at explaining the basics. 

Now that you have a mockup of your app you can start coding. If you haven’t already created a Flutter project for your new idea go to my post on Creating a New Flutter Project.

The post Choosing a Flutter project appeared first on Female Tech Entrepreneur.

]]>
Creating a new Flutter project https://femaletechentrepreneur.com/creating-a-new-flutter-project/?utm_source=rss&utm_medium=rss&utm_campaign=creating-a-new-flutter-project https://femaletechentrepreneur.com/creating-a-new-flutter-project/#comments Mon, 13 Apr 2020 11:33:35 +0000 https://femaletechentrepreneur.com/?p=325 Want to build your own app or website? I'm going to take you with me on my journey on creating a new Flutter project for both iOS, Android and web.

The post Creating a new Flutter project appeared first on Female Tech Entrepreneur.

]]>

Have you ever tried creating a new Flutter project? Me neither. 

Why not do it together so you can learn from my mistakes and hopefully I can show that it’s possible to do for everyone, no matter your prior programming skills. I have been working in Flutter since November 2019 when I became head of our Flutter development in my company, DecorRaid. There are still not a lot of Flutter Developers out there and as we didn’t have money to pay for a Flutter developer, I decided to take over the development. This meant that a Flutter Developer had written the app as we had ordered and released it to the App – and Play Store. But every update or new feature to the app I had to develop. 

This was my introduction to Flutter. Just to make it clear I’m not an experienced developer – I’m self-taught and initiated my journey into programming in 2018 simultaneously with starting DecorRaid. I had experience in Python and Angular prior to starting programming in Flutter. I’m telling you this just to make it clear that it’s possible for you to begin no matter your background.

Let us get to the fun part of programming. 

Flutter is written in Dart, so that’s the programming language we are going to be working with. 

Create a new Flutter Project

I like working in VS Code so everything is going to be done using that code editer. If you haven’t already set up your code editor for Flutter, they have great documentations on that.

The first step into the world of Flutter is to install a new project.

Go to VS Code

  1. Open the Command Palette (Ctrl+Shift+P (Cmd+Shift+P on macOS)).
  2. Select the Flutter: New Project command and press Enter.
  3. Enter your desired Project name.
  4. Select a Project location.

When the project is installed add the folder to your workspace, by going to File > Add Folder to Workspace.

Now go to your folder > lib > main.dart here you will find the main code of your new app. Lets try to run the app, connect your device or simulator and press fn5 or write flutter run in the terminal.

Your code should be up and running and look something like this: 

Create a Flutter web application

One of the reasons we choose Flutter as our programming Framework for DecorRaid Swipeshop was that it support cross platform and the ability to use the same codebase for the App Store, Play Store, and web. Unfortunately, web is still in beta. But I always wanted to try it out, so let us try to make our new Flutter project ready for web. 

To enable web support run these commands in your terminal:

$ flutter channel beta

$ flutter upgrade

$ flutter config –enable-web

$ flutter devices

2 connected device:

Chrome • chrome • web-javascript • Google Chrome 78.0.3904.108
Web Server • web-server • web-javascript • Flutter Tools

$ flutter create .

$ flutter run -d chrome

That was actually, not that hard. If you have any questions or problems please reach out to me and I will see if I can help. Do you want to know what each file and folders is used for and how to structure your new application go to my post on Flutter Scalable App – Folder Structure.

Now you are ready, to code on your new Flutter project. If you don’t know what the project should be about go to the next post Choosing a Flutter project.

Have a great day and happy coding 👩🏽‍💻

The post Creating a new Flutter project appeared first on Female Tech Entrepreneur.

]]>
https://femaletechentrepreneur.com/creating-a-new-flutter-project/feed/ 2