Skip to content

Instantly share code, notes, and snippets.

@Kevin-Gomez10
Last active May 29, 2021 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kevin-Gomez10/72c33e44d4e59e2076fee179a08de1da to your computer and use it in GitHub Desktop.
Save Kevin-Gomez10/72c33e44d4e59e2076fee179a08de1da to your computer and use it in GitHub Desktop.
POO Act5 bottomNavigationBar
import 'package:flutter/material.dart';
void main() => runApp(KevinApp());
class KevinApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false, // quitar baner
theme: ThemeData(
primarySwatch: Colors.purple,
),
home: PaginaInicio(),
); // fin de material
} // fin de widget
}// fin de clase KevinApp herencia StatelessWidget
final img1 ="https://raw.githubusercontent.com/"+"Jorgeluis190260363-6/Mis-imagenes/main/iron%20man.jpg";
final img2 ="https://raw.githubusercontent.com/"+"Jorgeluis190260363-6/Mis-imagenes/main/hulk.jpg";
final img3 ="https://raw.githubusercontent.com/"+"Jorgeluis190260363-6/Mis-imagenes/main/capitan%20america.jpg";
class Tab1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Image.network(img1);
} //fin de widget
} // fin clase Tab1 herencia StatelessWidget
class Tab2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Image.network(img2);
} //fin de widget
} // fin clase Tab1 herencia StatelessWidget
class Tab3 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Image.network(img3);
} //fin de widget
} // fin clase Tab1 herencia StatelessWidget
class PaginaInicio extends StatelessWidget{
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: new Scaffold(
appBar: AppBar(
title: new Text("Nueva Pestañas Vengadores")
),
body: TabBarView(
children: <Widget>[Tab1(), Tab2(), Tab3()],
),// fin body
bottomNavigationBar: Container(
child: TabBar(
labelColor: Colors.grey,
unselectedLabelColor: Colors.purple,
labelStyle: TextStyle(
color: Colors.grey, fontWeight:
FontWeight.w800),
indicatorColor: Colors.purple,
tabs: <Widget>[
Tab(text: 'Cat #1', icon:Icon(Icons.keyboard_arrow_left)),
Tab(text: 'Cat #2', icon:Icon(Icons.keyboard_arrow_up)),
Tab(text: 'Cat #3', icon:Icon(Icons.keyboard_arrow_right))
])) // fin de contenedor navigator bar
)// fin de andamio
); // fin controlador
}// fin de widget
}// fin class PaginaInicio herencia StatelessWidget
@Kevin-Gomez10
Copy link
Author

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