2-mashq. Android Studio dasturida MaterialApp widjedidan foydalanish va natijani skrenshot qilib joylash
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.tealAccent,
body: SafeArea(
child: Container(
child: Center(child: Text("Assalomu alaykum 22-21- guruh talabalari "),
),
),
),
),
);
}
}
3-mashq. Android Studio dasturida Scaffold, Appbar widjedlaridan foydalanish va natijani skrenshot qilib joylash.
import 'package:flutter/material.dart';
// import 'package:full_screen_network_image/full_screen_network_image.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
theme: ThemeData(
primarySwatch: Colors.purple,
),
home: Scaffold(
appBar: AppBar(
title: Text("Xabarlar"),
),
body: Center(
child: Text("Sizga yangi xabar keldi !!! ",
style: TextStyle(
color: Colors.indigo,
fontSize: 30,
),),
),
)
);
}
}
4-misol. Android Studio dasturida body, Image widjedlaridan foydalanish va natijani skrenshot qilib joylash.
import 'package:flutter/material.dart';
// import 'package:full_screen_network_image/full_screen_network_image.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.greenAccent,
appBar: AppBar(
backgroundColor: Colors.indigo,
centerTitle: true,
title: Text("Avtomobillar"),
),
body: Image(
image: AssetImage('images/car2.jpg'),
),
)
);
}
}
Do'stlaringiz bilan baham: |