Skip to content

✨ Basic template for run iOS & Android devices simultaneously

Notifications You must be signed in to change notification settings

Kuromaea/TemplateDartFlutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Flutter Template for IOS & Android

Basic template for run iOS & Android devices simultaneously

Introduction 🎞

template

1. Technologies 💻

  • Dart
  • Flutter

2. Coding goals ✨

Development of a mobile application that serves as a model for the simultaneous use of the iOS and Android emulator.

🤔 Understanding:

  • How to create a template application for iOS & Android.
  • In-depth use of Dart & Flutter.

🤓 Learning:

  • Creation of a Flutter project as a template.
  • Validate the use of the MVC architecture in Flutter (to make the code maintainable).

🔁 Reflections

Note

I wanted to create a template to simplify the creation of mobile applications in Dart & Flutter. This template allows the use of iOS & Android emulators simultaneously during the development phase and during hot reloads. It's a simple idea but saves time in the coding part. There is a single "model" that serves as adaptation pages depending on the desired platform. For users on windows or linux, unfortunately, they will need to use an Apple machine emulator to enable deployment on both platforms (iOS / Android).

3. Features 🛠

Here are the additions of different features to this project:

  • final TargetPlatform platform;
    • Targets the platform during emulation.
  • bool isIos() => (widget.platform != TargetPlatform.iOS);
    • Boolean that returns true or false depending on whether we are on the iOS or Android platform and allows switching between Cupertino or Native widget styles integrated into Flutter.
  • Cupertino Widgets
    • Cupertino Widgets are properties that use Apple's guidelines.
  • Native Widgets
    • Native Widgets are properties that use Android's guidelines.

⚒ Optimizations

  • Review the code and optimize it (if possible).

4. Run and Debug ⚙

  1. Download the TemplateDartFlutter.zip folder from the project and unzip it.
  2. Open the TemplateDartFlutter folder with a code editor of your choice.
  3. Launch the file /TemplateDartFlutter/lib/main.dart in "Run and Debug" menu with you're initial emulators (you can use extensions such as Chrome, android, xcode, etc.).
  4. To modify the widgets, add your code to the TemplateDartFlutter/lib/model/adaptive_pages.dart page or cut according to the MVC architecture.
  5. Pour alterner sur le rendu iOS & Android dans votre émulateur: Il faut changer le symbole != ou == dans la ligne de code bool isIos() => (widget.platform != TargetPlatform.iOS); entre widget.platform et TargetPlatform.iOS. Disponible sur la page /TemplateDartFlutter/lib/main.dart

Links: