Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:my_first_app/home_screen.dart';
- void main() {
- runApp(MyApp());
- }
- class MyApp extends StatelessWidget {
- // This widget is the root o.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'My App Demo',
- theme: ThemeData(
- buttonColor: Colors.red,
- primarySwatch: Colors.red,
- floatingActionButtonTheme:
- FloatingActionButtonThemeData(backgroundColor: Colors.green)),
- home: HomeScreen(),
- );
- }
- }
- class HomeScreen extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("My AppBar"),
- centerTitle: true,
- ),
- body: Center(
- child: Container(
- // child: Text(
- // "Hello World",
- // style: TextStyle(
- // fontSize: 32,
- // fontWeight: FontWeight.w400,
- // color: Colors.red,
- // decoration: TextDecoration.none),
- // ),
- child: Icon(
- Icons.accessible_forward,
- size: 64,
- color: Colors.red,
- ),
- ),
- ),
- floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
- floatingActionButton: FloatingActionButton(
- onPressed: () {
- print("Added to favourites.");
- },
- backgroundColor: Colors.yellow,
- child: Icon(
- Icons.favorite,
- color: Colors.white,
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement