mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-06 19:00:20 +08:00
Modfiy:
首页 轮播图 不置顶 免责 样式
This commit is contained in:
@ -69,15 +69,33 @@ class DisclaimerMsgState extends State<DisclaimerMsg> {
|
||||
barrierDismissible: false, // user must tap button!
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text('免责声明'),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text(disclaimerText1),
|
||||
Text(disclaimerText2),
|
||||
],
|
||||
//title: Text('免责声明'),
|
||||
content:SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(5.0, 5.0, 10.0, 10.0),
|
||||
//width: 100,
|
||||
height: 35,
|
||||
child: Text('免责声明',style:TextStyle(fontSize: 18,fontWeight:FontWeight.w700 )),
|
||||
decoration: BoxDecoration(
|
||||
//color: Colors.blue,
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitWidth,
|
||||
image: AssetImage('assets/images/paimaiLogo.png')
|
||||
),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
//alignment: Alignment.bottomRight,
|
||||
)
|
||||
),
|
||||
SizedBox(height:20),
|
||||
Text(disclaimerText1),
|
||||
Text(disclaimerText2),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
shape:RoundedRectangleBorder(borderRadius: new BorderRadius.circular(20.0)), // 圆角
|
||||
actions: <Widget>[
|
||||
Container(
|
||||
|
@ -11,8 +11,9 @@ import 'package:flutter/material.dart';
|
||||
class ListRefresh extends StatefulWidget {
|
||||
final renderItem;
|
||||
final requestApi;
|
||||
final headerView;
|
||||
|
||||
const ListRefresh([this.requestApi, this.renderItem]) : super();
|
||||
const ListRefresh([this.requestApi, this.renderItem, this.headerView]) : super();
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _ListRefreshState();
|
||||
@ -167,7 +168,11 @@ class _ListRefreshState extends State<ListRefresh> {
|
||||
itemCount: items.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0 && index != items.length) {
|
||||
return Container(height: 0);
|
||||
if(widget.headerView is Function){
|
||||
return widget.headerView();
|
||||
}else {
|
||||
return Container(height: 0);
|
||||
}
|
||||
}
|
||||
if (index == items.length) {
|
||||
//return _buildLoadText();
|
||||
@ -178,7 +183,6 @@ class _ListRefreshState extends State<ListRefresh> {
|
||||
if (widget.renderItem is Function) {
|
||||
return widget.renderItem(index, items[index]);
|
||||
}
|
||||
//return makeCard(index,items[index]);
|
||||
}
|
||||
},
|
||||
controller: _scrollController,
|
||||
|
@ -98,25 +98,46 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
|
||||
return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,);
|
||||
}
|
||||
|
||||
headerView(){
|
||||
return
|
||||
Column(
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
//alignment: const FractionalOffset(0.9, 0.1),//方法一
|
||||
children: <Widget>[
|
||||
Pagination(),
|
||||
Positioned(//方法二
|
||||
top: 10.0,
|
||||
left: 0.0,
|
||||
child: DisclaimerMsg(key:key,pWidget:this)
|
||||
),
|
||||
]),
|
||||
SizedBox(height: 1, child:Container(color: Theme.of(context).primaryColor)),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return new Column(
|
||||
children: <Widget>[
|
||||
new Stack(
|
||||
//alignment: const FractionalOffset(0.9, 0.1),//方法一
|
||||
children: <Widget>[
|
||||
Pagination(),
|
||||
Positioned(//方法二
|
||||
top: 10.0,
|
||||
left: 0.0,
|
||||
child: DisclaimerMsg(key:key,pWidget:this)
|
||||
),
|
||||
]),
|
||||
SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)),
|
||||
// new Stack(
|
||||
// //alignment: const FractionalOffset(0.9, 0.1),//方法一
|
||||
// children: <Widget>[
|
||||
// Pagination(),
|
||||
// Positioned(//方法二
|
||||
// top: 10.0,
|
||||
// left: 0.0,
|
||||
// child: DisclaimerMsg(key:key,pWidget:this)
|
||||
// ),
|
||||
// ]),
|
||||
// SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)),
|
||||
new Expanded(
|
||||
//child: new List(),
|
||||
child: listComp.ListRefresh(getIndexListData,makeCard)
|
||||
child: listComp.ListRefresh(getIndexListData,makeCard,headerView)
|
||||
)
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user