Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tabs.dart-
- class Tabs extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Row(
- crossAxisAlignment: CrossAxisAlignment.end,
- children: <Widget>[
- SizedBox(width: 24),
- MyTab(text: 'Nearby', isSelected: false),
- MyTab(text: 'Recent', isSelected: true),
- MyTab(text: 'Notice', isSelected: false),
- ],
- );
- }
- }
- class MyTab extends StatelessWidget {
- final String text;
- final bool isSelected;
- const MyTab({Key key, @required this.isSelected, @required this.text})
- : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- text,
- style: TextStyle(
- fontSize: isSelected ? 16 : 14,
- color: isSelected ? Colors.black : Colors.grey,
- fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
- ),
- ),
- Container(
- height: 6,
- width: 20,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(4),
- color: isSelected ? Color(0xFFFF5A1D) : Colors.white,
- ),
- )
- ],
- ),
- );
- }
- }
- class HomePage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.white,
- body: Stack(
- children: <Widget>[
- SafeArea(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- SizedBox(height: 8),
- Header(),
- SizedBox(height: 40),
- Tabs(),
- SizedBox(height: 8),
- SlidingCardsView(),
- ],
- ),
- ),
- ],
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement