Flutter:
import 'package:flutter/material.dart';
import 'package:flutter_ui_demo/screen/widget/custom_button.dart';
import 'package:flutter_ui_demo/screen/widget/custom_button_with_icon.dart';
import 'package:flutter_ui_demo/screen/widget/custom_text.dart';
import 'package:flutter_ui_demo/screen/widget/image_widget.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
children: [
Row(
children: const [
CustomText(label: 'Home'),
CustomButton(),
CustomButtonWithIcon(),
SizedBox(
width: 100,
height: 50,
child: ImageWidget(),
)
],
),
Column(
children: const[
CustomText(label: 'Home'),
CustomButton(),
CustomButtonWithIcon(),
SizedBox(
width: 100,
height: 50,
child: ImageWidget(),
)
],
)
],
)
)
);
}
}
SwiftUI:
import SwiftUI
struct HomeScreenView: View {
var body: some View {
VStack {
HStack {
Text("Text1")
Text("Text2")
Text("Text3")
Text("Text4")
Text("Text5")
}
TextUIView()
ButtonView()
ButtonWithIconView()
ImageView()
}
}
}
struct HomeScreenView_Previews: PreviewProvider {
static var previews: some View {
HomeScreenView()
}
}
Compose:
@Composable
fun HomeScreen() {
Column() {
Row() {
CustomText("Next page")
CustomButton("Next page")
CustomButtonWithIcon("Edit", Icons.Filled.Edit)
Box(modifier = Modifier.width(100.dp).height(50.dp)) {
CustomImageView()
}
}
CustomText("Next page")
CustomButton("Next page")
CustomButtonWithIcon("Edit", Icons.Filled.Edit)
CustomImageView()
}
}