diff --git a/android/app/build.gradle b/android/app/build.gradle index 7664254..e2d75a9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -56,6 +56,12 @@ android { } signingConfigs { + debug { + storeFile file("../certificate/wow_english") + storePassword "wow_english" + keyAlias "wow_english" + keyPassword "wow_english" + } release { storeFile file("../certificate/wow_english") storePassword "wow_english" diff --git a/assets/images/game_animal_4.png b/assets/images/game_animal_4.png new file mode 100644 index 0000000..bebc48d --- /dev/null +++ b/assets/images/game_animal_4.png diff --git a/assets/images/game_food_1.png b/assets/images/game_food_1.png new file mode 100644 index 0000000..62fd967 --- /dev/null +++ b/assets/images/game_food_1.png diff --git a/assets/images/game_halloween_2.png b/assets/images/game_halloween_2.png new file mode 100644 index 0000000..2446a9a --- /dev/null +++ b/assets/images/game_halloween_2.png diff --git a/assets/images/game_toy_3.png b/assets/images/game_toy_3.png new file mode 100644 index 0000000..9042a8f --- /dev/null +++ b/assets/images/game_toy_3.png diff --git a/lib/pages/games/bloc.dart b/lib/pages/games/bloc.dart index 51952b4..a118794 100644 --- a/lib/pages/games/bloc.dart +++ b/lib/pages/games/bloc.dart @@ -15,20 +15,20 @@ class GamesBloc extends Bloc { final List _games = [ GameEntity() ..id = 1 - ..imageName = 'pic_module_game'.assetPng - ..name = '游戏1', + ..imageName = 'game_food_1'.assetPng + ..name = 'Food', GameEntity() ..id = 2 - ..imageName = 'pic_module_game'.assetPng - ..name = '游戏2', + ..imageName = 'game_halloween_2'.assetPng + ..name = 'Halloween', GameEntity() ..id = 3 - ..imageName = 'pic_module_game'.assetPng - ..name = '游戏3', + ..imageName = 'game_toy_3'.assetPng + ..name = 'Toy', GameEntity() ..id = 4 - ..imageName = 'pic_module_game'.assetPng - ..name = '游戏4' + ..imageName = 'game_animal_4'.assetPng + ..name = 'Animal' ]; List get listData => _games; diff --git a/lib/pages/games/game_entity.dart b/lib/pages/games/game_entity.dart index ce642bf..530c498 100644 --- a/lib/pages/games/game_entity.dart +++ b/lib/pages/games/game_entity.dart @@ -1,6 +1,6 @@ - +/// 本地游戏实体 class GameEntity { late int id; diff --git a/lib/pages/games/view.dart b/lib/pages/games/view.dart index 8c3ad75..8f3e553 100644 --- a/lib/pages/games/view.dart +++ b/lib/pages/games/view.dart @@ -8,7 +8,6 @@ import 'package:wow_english/pages/games/state.dart'; import '../games/event.dart'; import 'bloc.dart'; - class GamesPage extends StatelessWidget { const GamesPage({super.key}); @@ -39,17 +38,19 @@ class _GamesPageView extends StatelessWidget { Widget _gamesView() => BlocBuilder(builder: (context, state) { final bloc = BlocProvider.of(context); - //屏幕中间横着放四张图片一行展示(尺寸120*200),每张图片下方有行文字 return Container( - margin: EdgeInsets.symmetric(horizontal: 50.0.w), + alignment: Alignment.center, + margin: EdgeInsets.symmetric(horizontal: 40.0.w), child: GridView.builder( padding: EdgeInsets.zero, + // 让 GridView 只占用所需的空间 + shrinkWrap: true, // physics: const NeverScrollableScrollPhysics(), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, + crossAxisCount: 4, crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 0.6, + childAspectRatio: 0.75, ), itemCount: bloc.listData.length, itemBuilder: (BuildContext context, int index) { @@ -59,12 +60,17 @@ class _GamesPageView extends StatelessWidget { bloc.add(GotoGamePageEvent(gameEntity.id)); }, child: Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset(gameEntity.imageName, - width: 120, height: 200), + //图片增加圆角 + ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Image.asset(gameEntity.imageName, + width: 150, height: 150)), + 10.verticalSpace, Text(gameEntity.name, style: TextStyle( - fontSize: 14.sp, + fontSize: 16.sp, color: const Color(0xFF140C10))) ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 0fb08c2..db64dc1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -137,7 +137,7 @@ flutter: - family: HannotateSC fonts: - asset: assets/fonts/HannotateSC-W5.ttf - + tobias: url_scheme: ishowwoweng ios: