UI优化.
This commit is contained in:
parent
9a0fc52c78
commit
ebeb5a3fc1
|
|
@ -21,7 +21,7 @@
|
|||
<color name="dialog_gray">#E3E3E3</color>
|
||||
<color name="step_view">#FF7125</color>
|
||||
|
||||
<color name="test">#3E291C</color>
|
||||
<color name="test">#00FFFFFF</color>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ class NetworkConfig {
|
|||
static int SELECT_INDEX = 0;
|
||||
|
||||
static List BASE_URLS = [
|
||||
// "https://admin.shhuanmeng.com/",
|
||||
"http://192.168.1.23:81/",
|
||||
"https://api.onelight.vip/",
|
||||
// "http://192.168.1.23:81/",
|
||||
];
|
||||
|
||||
// static List BASE_URLS_AI = [
|
||||
|
|
|
|||
|
|
@ -242,87 +242,98 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
width: size.width,
|
||||
height: h50,
|
||||
margin: EdgeInsets.only(left: r14, right: r14),
|
||||
child: Row(
|
||||
child: Stack(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
pageIndex = 0;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: w166,
|
||||
height: h45,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(pageIndex == 0 ? 0xFF0C0C0C : 0xFF17181A),
|
||||
border: Border.all(color: Color(pageIndex == 0 ? 0xFF9C9C9C : 0xFF17181A), width: 1),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4))),
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: pageIndex == 0
|
||||
? [
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF7A6EFA),
|
||||
const Color(0xFF7A6EFA),
|
||||
]
|
||||
: [
|
||||
const Color(0xFF909090),
|
||||
const Color(0xFF909090),
|
||||
],
|
||||
).createShader(bounds);
|
||||
},
|
||||
blendMode: BlendMode.srcATop,
|
||||
child: Text(
|
||||
'推荐',
|
||||
style: TextStyle(fontSize: s14),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: h45,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Color(0xFF3B3C3F)),
|
||||
borderRadius: BorderRadius.all(Radius.circular(c4)),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (NetworkConfig.token == "") {
|
||||
Navigator.pushNamed(context, "/LoginPage");
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
pageIndex = 1;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: w166,
|
||||
height: h45,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(pageIndex == 1 ? 0xFF0C0C0C : 0xFF17181A),
|
||||
border: Border.all(color: Color(pageIndex == 1 ? 0xFF9C9C9C : 0xFF17181A), width: 1),
|
||||
borderRadius: BorderRadius.all(Radius.circular(c4))),
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: pageIndex == 1
|
||||
? [
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF7A6EFA),
|
||||
const Color(0xFF7A6EFA),
|
||||
]
|
||||
: [
|
||||
const Color(0xFF909090),
|
||||
const Color(0xFF909090),
|
||||
],
|
||||
).createShader(bounds);
|
||||
Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
pageIndex = 0;
|
||||
});
|
||||
},
|
||||
blendMode: BlendMode.srcATop,
|
||||
child: Text(
|
||||
'游戏排行',
|
||||
style: TextStyle(fontSize: s14),
|
||||
child: Container(
|
||||
width: w166,
|
||||
height: h45,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(pageIndex == 0 ? 0xFF0C0C0C : 0x00FFFFFF),
|
||||
border: Border.all(color: Color(pageIndex == 0 ? 0xFF9C9C9C : 0x00FFFFFF), width: 1),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4))),
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: pageIndex == 0
|
||||
? [
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF7A6EFA),
|
||||
const Color(0xFF7A6EFA),
|
||||
]
|
||||
: [
|
||||
const Color(0xFF909090),
|
||||
const Color(0xFF909090),
|
||||
],
|
||||
).createShader(bounds);
|
||||
},
|
||||
blendMode: BlendMode.srcATop,
|
||||
child: Text(
|
||||
'推荐',
|
||||
style: TextStyle(fontSize: s14),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (NetworkConfig.token == "") {
|
||||
Navigator.pushNamed(context, "/LoginPage");
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
pageIndex = 1;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: w166,
|
||||
height: h45,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(pageIndex == 1 ? 0xFF0C0C0C : 0x00FFFFFF),
|
||||
border: Border.all(color: Color(pageIndex == 1 ? 0xFF9C9C9C : 0x00FFFFFF), width: 1),
|
||||
borderRadius: BorderRadius.all(Radius.circular(c4))),
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: pageIndex == 1
|
||||
? [
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF22F1F5),
|
||||
const Color(0xFF7A6EFA),
|
||||
const Color(0xFF7A6EFA),
|
||||
]
|
||||
: [
|
||||
const Color(0xFF909090),
|
||||
const Color(0xFF909090),
|
||||
],
|
||||
).createShader(bounds);
|
||||
},
|
||||
blendMode: BlendMode.srcATop,
|
||||
child: Text(
|
||||
'游戏排行',
|
||||
style: TextStyle(fontSize: s14),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class _SearchPageState extends State<SearchPage> {
|
|||
child: index != 0
|
||||
? Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: s13, vertical: t4),
|
||||
margin: EdgeInsets.only(right: l10),
|
||||
margin: EdgeInsets.only(right: l10,bottom: b5),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF202530),
|
||||
borderRadius: BorderRadius.all(Radius.circular(t4)),
|
||||
|
|
@ -282,6 +282,7 @@ class _SearchPageState extends State<SearchPage> {
|
|||
),
|
||||
),
|
||||
|
||||
///热门搜索
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: h36),
|
||||
|
|
@ -296,13 +297,22 @@ class _SearchPageState extends State<SearchPage> {
|
|||
child: Wrap(
|
||||
children: List.generate(
|
||||
gameHotSearch.length,
|
||||
(index) => Container(
|
||||
width: size.width / 2 - l15 - l15,
|
||||
margin: EdgeInsets.only(right: l10, top: l10),
|
||||
child: Text(
|
||||
"${gameHotSearch[index]}",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: s14, color: Color(0xFF939394)),
|
||||
(index) => GestureDetector(
|
||||
onTap: () {
|
||||
FunctionUtil.loading();
|
||||
_viewModel.gameSearch(gameHotSearch[index]);
|
||||
_searchController.text = gameHotSearch[index];
|
||||
searchHistoryList.add(_searchController.text);
|
||||
saveArrayToSharedPrefs(searchHistoryList);
|
||||
},
|
||||
child: Container(
|
||||
width: size.width / 2 - l15 - l15,
|
||||
margin: EdgeInsets.only(right: l10, top: l10),
|
||||
child: Text(
|
||||
"${gameHotSearch[index]}",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: s14, color: Color(0xFF939394)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user