Skip to content

Instantly share code, notes, and snippets.

@DDOrozco17
Created February 13, 2024 15:21
Show Gist options
  • Save DDOrozco17/75f592c1360255ea44b11943258eaaac to your computer and use it in GitHub Desktop.
Save DDOrozco17/75f592c1360255ea44b11943258eaaac to your computer and use it in GitHub Desktop.
Ejemplo de AppBar con propiedades en Flutter
import 'package:flutter/material.dart';
void main() => runApp(const MiAplicacion());
class MiAplicacion extends StatelessWidget {
const MiAplicacion({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: EjMiAplicacion(),
);
}
}
class EjMiAplicacion extends StatelessWidget {
const EjMiAplicacion({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: true,
title: const Text("Ejemplo de appBar"),
centerTitle: true,
actions: [
IconButton(
icon: const Icon(Icons.search),
onPressed: () {
},
),
IconButton(
icon: const Icon(Icons.more_vert,),
onPressed: () {
},
),
IconButton(
icon: const Icon(Icons.add_card,),
onPressed: () {
},
),
],
toolbarHeight: 70,
shape: StadiumBorder(),
elevation: 8,
backgroundColor: Colors.blue,
shadowColor: Colors.blueGrey,
),//fin de appBar
drawer: const Drawer(),
body: const Center(
child: Text(
'Inicio Diego Diaz',
style: TextStyle(fontSize: 24),
),
),
);//fin de Scaffold estructura
}
}
@DDOrozco17
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment