test_webview_game.dart 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import 'package:flutter/material.dart';
  2. import 'package:common_project/common_project.dart';
  3. import 'package:module_chat/view_model/test_games_web_cubit.dart';
  4. /// @class : TestWebviewGame
  5. /// @date : 2022/1/25 3:32 下午
  6. /// @name : rico
  7. /// @description : 测试游戏页面
  8. class TestWebviewGame extends StatefulWidget {
  9. TextEditingController editingController = TextEditingController();
  10. @override
  11. _TestWebviewGame createState() => _TestWebviewGame();
  12. }
  13. class _TestWebviewGame extends State<TestWebviewGame> {
  14. @override
  15. Widget build(BuildContext context) {
  16. return Scaffold(
  17. body: BlocProvider(
  18. create: (context) => TestGamesWebCubit(),
  19. child: Builder(
  20. builder: (context){
  21. TestGamesWebCubit bloc = BlocProvider.of<TestGamesWebCubit>(context);
  22. return Stack(
  23. children: [
  24. Container(child: ImageUtil.loadImage('assets/images/chat_room_background_test.jpg',package: ModuleName.Module_chat,width: Sizes.width,height: Sizes.height),),
  25. Align(
  26. alignment: Alignment.center,
  27. child: InkWell(
  28. onTap: (){
  29. bloc.openWeb(context, bloc.state.gameUrl);
  30. },
  31. child: Container(
  32. width: 300.w,
  33. height: 100.w,
  34. color: Colors.red,
  35. alignment: Alignment.center,
  36. margin: EdgeInsets.only(right: 80.w),
  37. child: Text(' 打开游戏'),
  38. ),
  39. ),
  40. ),
  41. ],
  42. );
  43. },
  44. ),
  45. ),
  46. );
  47. }
  48. }