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