Hello Swift UI vs Hello Flutter
#SwiftUI #iOSDevs

Hello Swift UI vs Hello Flutter

Level: Beginner

In the previous article, We've discussed Swift UI and we are going to compare Swift UI with Flutter.

I'm assuming that you've already installed Flutter on your machines, if not then please check this out. And, if you don't have Flutter installed it's not a big problem as this article is not to learn Flutter.

ContentView.swift (From previous article)

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Hello Swift UI")
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Now, I'm going to make an app similar to "Hello Swift UI" and call it "Hello Flutter".

main.dart

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Center(
          child: Text("Hello Flutter"),
        ),
      ),
    );
  }
}

Here's the screenshot of the app.

No alt text provided for this image

In the next article, I'm going to create a reactive app using Swift UI which is sort of a template app we get in Flutter.

Thanks. Have a great day.

Credits:

Cover Image: https://blog.codemagic.io/

Eloka Nwobi

I'm a tech artist, product designer. BLCO Seller

5 年

Hmm

回复

要查看或添加评论,请登录

Dheeraj Bhavsar的更多文章

  • Fall in ?? with Recursion

    Fall in ?? with Recursion

    Hello everyone, in your journey of programming you would have used recursion at least once. Today, I want to introduce…

  • Generic Codables - Swift

    Generic Codables - Swift

    Hello everyone, I guess you all have faced this problem which I came across in the past few days and didn't found any…

  • Navigation and Networking in SwiftUI

    Navigation and Networking in SwiftUI

    Level: Intermediate-Advanced Hello everyone, today we are going to learn the basics of navigation, networking and image…

    1 条评论
  • Tap Me!

    Tap Me!

    Level: Beginner-Intermediate Hello guys, today we are going to create a reactive app, and you are going to learn a new…

  • Hello Swift UI

    Hello Swift UI

    Level: Beginner Hello everyone, today we are going to create an application based on Swift UI. As a programmer, we all…

    1 条评论

社区洞察