Commit e62c1a9728a1621a77e9af52f4e57cf89a3e9881
1 parent
2879454a
feat:1、游戏列表页优化;2、添加url_scheme(ios支付宝)3、android debug包签名与release一致
Showing
9 changed files
with
34 additions
and
17 deletions
android/app/build.gradle
@@ -56,6 +56,12 @@ android { | @@ -56,6 +56,12 @@ android { | ||
56 | } | 56 | } |
57 | 57 | ||
58 | signingConfigs { | 58 | signingConfigs { |
59 | + debug { | ||
60 | + storeFile file("../certificate/wow_english") | ||
61 | + storePassword "wow_english" | ||
62 | + keyAlias "wow_english" | ||
63 | + keyPassword "wow_english" | ||
64 | + } | ||
59 | release { | 65 | release { |
60 | storeFile file("../certificate/wow_english") | 66 | storeFile file("../certificate/wow_english") |
61 | storePassword "wow_english" | 67 | storePassword "wow_english" |
assets/images/game_animal_4.png
0 → 100644
86 KB
assets/images/game_food_1.png
0 → 100644
88.8 KB
assets/images/game_halloween_2.png
0 → 100644
81.8 KB
assets/images/game_toy_3.png
0 → 100644
86.5 KB
lib/pages/games/bloc.dart
@@ -15,20 +15,20 @@ class GamesBloc extends Bloc<GamesEvent, GamesState> { | @@ -15,20 +15,20 @@ class GamesBloc extends Bloc<GamesEvent, GamesState> { | ||
15 | final List<GameEntity> _games = [ | 15 | final List<GameEntity> _games = [ |
16 | GameEntity() | 16 | GameEntity() |
17 | ..id = 1 | 17 | ..id = 1 |
18 | - ..imageName = 'pic_module_game'.assetPng | ||
19 | - ..name = '游戏1', | 18 | + ..imageName = 'game_food_1'.assetPng |
19 | + ..name = 'Food', | ||
20 | GameEntity() | 20 | GameEntity() |
21 | ..id = 2 | 21 | ..id = 2 |
22 | - ..imageName = 'pic_module_game'.assetPng | ||
23 | - ..name = '游戏2', | 22 | + ..imageName = 'game_halloween_2'.assetPng |
23 | + ..name = 'Halloween', | ||
24 | GameEntity() | 24 | GameEntity() |
25 | ..id = 3 | 25 | ..id = 3 |
26 | - ..imageName = 'pic_module_game'.assetPng | ||
27 | - ..name = '游戏3', | 26 | + ..imageName = 'game_toy_3'.assetPng |
27 | + ..name = 'Toy', | ||
28 | GameEntity() | 28 | GameEntity() |
29 | ..id = 4 | 29 | ..id = 4 |
30 | - ..imageName = 'pic_module_game'.assetPng | ||
31 | - ..name = '游戏4' | 30 | + ..imageName = 'game_animal_4'.assetPng |
31 | + ..name = 'Animal' | ||
32 | ]; | 32 | ]; |
33 | 33 | ||
34 | List<GameEntity> get listData => _games; | 34 | List<GameEntity> get listData => _games; |
lib/pages/games/game_entity.dart
lib/pages/games/view.dart
@@ -8,7 +8,6 @@ import 'package:wow_english/pages/games/state.dart'; | @@ -8,7 +8,6 @@ import 'package:wow_english/pages/games/state.dart'; | ||
8 | import '../games/event.dart'; | 8 | import '../games/event.dart'; |
9 | import 'bloc.dart'; | 9 | import 'bloc.dart'; |
10 | 10 | ||
11 | - | ||
12 | class GamesPage extends StatelessWidget { | 11 | class GamesPage extends StatelessWidget { |
13 | const GamesPage({super.key}); | 12 | const GamesPage({super.key}); |
14 | 13 | ||
@@ -39,17 +38,19 @@ class _GamesPageView extends StatelessWidget { | @@ -39,17 +38,19 @@ class _GamesPageView extends StatelessWidget { | ||
39 | Widget _gamesView() => | 38 | Widget _gamesView() => |
40 | BlocBuilder<GamesBloc, GamesState>(builder: (context, state) { | 39 | BlocBuilder<GamesBloc, GamesState>(builder: (context, state) { |
41 | final bloc = BlocProvider.of<GamesBloc>(context); | 40 | final bloc = BlocProvider.of<GamesBloc>(context); |
42 | - //屏幕中间横着放四张图片一行展示(尺寸120*200),每张图片下方有行文字 | ||
43 | return Container( | 41 | return Container( |
44 | - margin: EdgeInsets.symmetric(horizontal: 50.0.w), | 42 | + alignment: Alignment.center, |
43 | + margin: EdgeInsets.symmetric(horizontal: 40.0.w), | ||
45 | child: GridView.builder( | 44 | child: GridView.builder( |
46 | padding: EdgeInsets.zero, | 45 | padding: EdgeInsets.zero, |
46 | + // 让 GridView 只占用所需的空间 | ||
47 | + shrinkWrap: true, | ||
47 | // physics: const NeverScrollableScrollPhysics(), | 48 | // physics: const NeverScrollableScrollPhysics(), |
48 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( | 49 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( |
49 | - crossAxisCount: 3, | 50 | + crossAxisCount: 4, |
50 | crossAxisSpacing: 10, | 51 | crossAxisSpacing: 10, |
51 | mainAxisSpacing: 10, | 52 | mainAxisSpacing: 10, |
52 | - childAspectRatio: 0.6, | 53 | + childAspectRatio: 0.75, |
53 | ), | 54 | ), |
54 | itemCount: bloc.listData.length, | 55 | itemCount: bloc.listData.length, |
55 | itemBuilder: (BuildContext context, int index) { | 56 | itemBuilder: (BuildContext context, int index) { |
@@ -59,12 +60,17 @@ class _GamesPageView extends StatelessWidget { | @@ -59,12 +60,17 @@ class _GamesPageView extends StatelessWidget { | ||
59 | bloc.add(GotoGamePageEvent(gameEntity.id)); | 60 | bloc.add(GotoGamePageEvent(gameEntity.id)); |
60 | }, | 61 | }, |
61 | child: Column( | 62 | child: Column( |
63 | + mainAxisAlignment: MainAxisAlignment.center, | ||
62 | children: [ | 64 | children: [ |
63 | - Image.asset(gameEntity.imageName, | ||
64 | - width: 120, height: 200), | 65 | + //图片增加圆角 |
66 | + ClipRRect( | ||
67 | + borderRadius: BorderRadius.circular(10), | ||
68 | + child: Image.asset(gameEntity.imageName, | ||
69 | + width: 150, height: 150)), | ||
70 | + 10.verticalSpace, | ||
65 | Text(gameEntity.name, | 71 | Text(gameEntity.name, |
66 | style: TextStyle( | 72 | style: TextStyle( |
67 | - fontSize: 14.sp, | 73 | + fontSize: 16.sp, |
68 | color: const Color(0xFF140C10))) | 74 | color: const Color(0xFF140C10))) |
69 | ], | 75 | ], |
70 | ), | 76 | ), |
pubspec.yaml
@@ -137,3 +137,8 @@ flutter: | @@ -137,3 +137,8 @@ flutter: | ||
137 | - family: HannotateSC | 137 | - family: HannotateSC |
138 | fonts: | 138 | fonts: |
139 | - asset: assets/fonts/HannotateSC-W5.ttf | 139 | - asset: assets/fonts/HannotateSC-W5.ttf |
140 | + | ||
141 | +tobias: | ||
142 | + url_scheme: ishowwoweng | ||
143 | + ios: | ||
144 | + ignore_security: true |