42 lines
1014 B
Dart
42 lines
1014 B
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:wallpaper/pages/homePage/homePage_view.dart';
|
|
class TabbarPageView extends GetView {
|
|
const TabbarPageView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text("Tab"),
|
|
),
|
|
body: const Center(
|
|
child: Text("我是tab页面"),
|
|
),
|
|
);
|
|
}
|
|
|
|
//初始化地步tabbar的选项
|
|
List<BottomNavigationBarItem> getTabarItem(){
|
|
return [ const BottomNavigationBarItem(
|
|
icon: Icon(Icons.home),
|
|
label: "Home"
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.book),
|
|
label: "Collection"
|
|
),
|
|
const BottomNavigationBarItem(
|
|
icon: Icon(Icons.music_video),
|
|
label: "My"
|
|
),
|
|
];
|
|
}
|
|
|
|
//返回每个tabitem对应控制器视图,必须一一对应
|
|
List<Widget> getPages(){
|
|
return [HomePageView(),];
|
|
}
|
|
} |