MaterialApp with Stateless Widget
import 'package:flutter/material.dart';
void main(){runApp(MaterialApp(debugShowCheckedModeBanner: false,}
initialRoute: '/',
routes: {
'/':(context)=> MyApp(),
},
)); 💪 // MaterialAppclass MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBar(
title: Text("Firebase Messaging"),
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.green,Colors.lightGreenAccent],
begin: Alignment.bottomRight,
end: Alignment.topLeft,
),
),
),
),body: SafeArea(
child: Container(
child: ListView(
children: [Container(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
margin: EdgeInsets.all(10.0),
width: 100,
height: 200,
color: Colors.blue,
child: Text("Raj"),
),
],),
),
),
); 💪 // Scaffold
}
}
No comments:
Post a Comment