PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, September 10, 2022

[FIXED] How to create apps in different platforms, each of different functionalities with Flutter?

 September 10, 2022     cross-platform, flutter, flutter-web, user-experience     No comments   

Issue

I was thinking about creating a small project using Flutter to create a mobile application along with website accessibility. I am quite new to Flutter and wanted to learn more about it. So basically, my application consists of two user targets; teachers and students. I want to allow teachers to be able to create courses ONLY on the website, but students and teachers are allowed to access the mobile application. Teachers can view courses and students can join classes through the app. The reason for only allowing students in the mobile app is that I want to make use of the gyroscope of mobile phones.

Hence, there are some questions that I need help with:

  1. Should I create 2 apps; an independent Flutter Web and an independent mobile app, or pack them together in one app?
  2. If I pack them together, how do I make the above conditions possible? I was thinking about checking the device used and displaying different interfaces on different devices. Is this possible?

Also, I am willing to receive any advice on what is better to implement, or what I could change. Thank you for your time!


Solution

  1. You can handle this scenario with a single codebase
  2. To check if user is using web you can use below condition. You can also use a combination of LayoutBuilder and MediaQuery to show responsive UI based on device dimensions.

There are different scenarios which u need to consider while deciding if you should have separate projects.For e.g. If the functionality on the web is completely different, then you can think about 2 app approach.

import 'package:flutter/foundation.dart' show kIsWeb;

if (kIsWeb) {
  // running on the web!
} else {
  // NOT running on the web! You can check for additional platforms here.
}


Answered By - Rohit
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing