Skip to content

Instantly share code, notes, and snippets.

@rubywai
Created May 11, 2023 11:00
Show Gist options
  • Save rubywai/a5abc9518314e370ffab2edd894df7ec to your computer and use it in GitHub Desktop.
Save rubywai/a5abc9518314e370ffab2edd894df7ec to your computer and use it in GitHub Desktop.
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