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.
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/
I'm a tech artist, product designer. BLCO Seller
5 年Hmm