import 'package:flutter/material.dart';
class ProductInfor extends StatefulWidget {
Map arguments;
ProductInfor({Key key,this.arguments}): super(key:key);
@override
_ProductInforState createState() => _ProductInforState(arguments:this.arguments);
}
class _ProductInforState extends State<ProductInfor> {
Map arguments;
_ProductInforState({this.arguments});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("商品详情"),
centerTitle: true,
// backgroundColor: Colors.red,
leading: IconButton(
icon:Icon(Icons.menu),
onPressed: (){
print(1);
},
),
actions: <Widget>[
IconButton(
icon:Icon(Icons.menu),
onPressed: (){
print(1);
},
),
],
),
body: Text('商品详情页面${arguments["id"]}'),
);
}
}
import 'package:flutter/material.dart';
import './FromPage.dart';
class CatePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
title: Row(
children: <Widget>[
Expanded(
child: TabBar(
tabs: <Widget>[
Tab(text: '211221'),
Tab(text: '2333'),
Tab(text: '2333'),
Tab(text: '2333'),
],
),
)
],
),
// bottom:
),
body: TabBarView(
children: <Widget>[
ListView(
children: <Widget>[
ListTile(
title: Text('23123'),
)
],
),
ListView(
children: <Widget>[
ListTile(
title: Text('23123'),
)
],
),
ListView(
children: <Widget>[
ListTile(
title: Text('23123'),
)
],
),
ListView(
children: <Widget>[
ListTile(
title: Text('23123'),
)
],
)
],
),
),
);
}
}
flutter添加自定义appbar顶部tabar
最新推荐文章于 2022-11-22 20:13:56 发布