Created
May 11, 2023 11:00
-
-
Save rubywai/a5abc9518314e370ffab2edd894df7ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_ui_lesson/screens/second_screen.dart'; | |
class FirstScreen extends StatelessWidget { | |
FirstScreen({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return DefaultTabController( | |
length: 2, | |
child: Scaffold( | |
appBar: AppBar( | |
bottom: const TabBar( | |
tabs: [ | |
Tab( | |
text: 'Home', | |
icon: Icon(Icons.home), | |
), | |
Tab( | |
text: 'Specification', | |
icon: Icon(Icons.info), | |
) | |
], | |
), | |
), | |
body: TabBarView( | |
children: [ | |
_home(), | |
_specification() | |
], | |
), | |
), | |
); | |
} | |
Widget _home() => const Center(child: Text('Home'),); | |
Widget _specification() => const Center(child: Text('Specification'),); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment