flutter学习中碰到的问题
1.Pageview 中关于条目选择的问题
//默认 tab数量等于3 BottomNavigationBarType.fixed
//否则BottomNavigationBarType.shifting
type: BottomNavigationBarType.fixed,
fixed的实际意义
2
return Scaffold(
appBar: AppBar(
title: Text(
_currentTitle,
style: TextStyle(color: Colors.white),
),
centerTitle: true,
elevation: 0.0,
),
);
elevation的具体使用
3.
Widget build(BuildContext context) {
return MaterialApp(
//为何无效
title: ‘Test Gank.io’,
theme: ThemeData(
primarySwatch: Colors.lightBlue,
primaryColor: Colors.lightBlue,
primaryColorDark: Colors.blue,
accentColor: Colors.green,
),
home: GankMainPage(),
);
}
title 无效
4
class _GankMainPageState extends State
StreamSubscription errorSubscription;
static const _titles =
var _currentTitle = _titles[0];
var _currrentIndex = 0;
PageController pageController; //未对pageController 初始化 居然不报错 但是影响正常使用
//底部tab控件list
5
@override
void initState() {
// TODO: implement initState
super.initState();
pageController=new PageController(initialPage: _currrentIndex);
// errorSubscription =
}
@override
void dispose() {
//要在父类前执行 why??
pageController.dispose();
errorSubscription.cancel();
// TODO: implement dispose
super.dispose();
}