liuyuqi-dellpc 1 year ago
parent
commit
245bb498ba

+ 10 - 1
lib/model/block_info.dart

@@ -1,8 +1,16 @@
+/// Description: 方块信息
+/// Time       : 05/01/2023 Monday
+/// Author     : liuyuqi.gov@msn.cn
 class BlockInfo {
 class BlockInfo {
+  /// 构造函数
+  /// value: 值
+  /// current: 当前位置
+  /// before: 上一个位置
+  /// myis: 是否是自己
   BlockInfo(
   BlockInfo(
       {required this.value,
       {required this.value,
       required this.current,
       required this.current,
-      this.before ,
+      this.before,
       this.myis = true}) {
       this.myis = true}) {
     if (this.before == null) {
     if (this.before == null) {
       this.before = this.current;
       this.before = this.current;
@@ -18,6 +26,7 @@ class BlockInfo {
   bool needCombine = false;
   bool needCombine = false;
   bool myis = false;
   bool myis = false;
 
 
+  /// 重置
   void reset() {
   void reset() {
     value = 0;
     value = 0;
     needMove = false;
     needMove = false;

+ 5 - 0
lib/model/display.dart

@@ -1,4 +1,9 @@
+/// Description: 屏幕显示
+/// Time       : 05/01/2023 Monday
+/// Author     : liuyuqi.gov@msn.cn
 class Display {
 class Display {
+  /// 屏幕宽度
   static double borderMargin = 10;
   static double borderMargin = 10;
+  /// 占位符单位
   static double spacerUnit = 2.5;
   static double spacerUnit = 2.5;
 }
 }

+ 1 - 0
lib/model/game_status.dart

@@ -1,5 +1,6 @@
 /// 当前状态
 /// 当前状态
 class GameStatus {
 class GameStatus {
+  
   GameStatus({
   GameStatus({
     required this.adds,
     required this.adds,
     required this.moves,
     required this.moves,

+ 8 - 0
lib/model/user_model.dart

@@ -0,0 +1,8 @@
+/// Description: 用户模型
+/// Time       : 05/01/2023 Monday
+/// Author     : liuyuqi.gov@msn.cn
+class UserModel {
+  late String username;
+  late String email;
+
+}

+ 3 - 3
lib/pages/guide_page.dart

@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
 /// Time       : 04/30/2023 Sunday
 /// Time       : 04/30/2023 Sunday
 /// Author     : liuyuqi.gov@msn.cn
 /// Author     : liuyuqi.gov@msn.cn
 class GuidePage extends StatefulWidget {
 class GuidePage extends StatefulWidget {
-  GuidePage({Key key}) : super(key: key);
+  GuidePage({Key? key}) : super(key: key);
 
 
   @override
   @override
   _GuidePageState createState() => _GuidePageState();
   _GuidePageState createState() => _GuidePageState();
@@ -14,7 +14,7 @@ class _GuidePageState extends State<GuidePage> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Container(
     return Container(
-       child: child,
+      child: ,
     );
     );
   }
   }
-}
+}

+ 1 - 1
lib/pages/index_page.dart

@@ -69,4 +69,4 @@ class GameProps {
   bool started;
   bool started;
 
 
   GameProps({required this.started});
   GameProps({required this.started});
-}
+}

+ 4 - 1
lib/pages/login_page.dart

@@ -1,7 +1,10 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 
 
+/// Description: 登录界面
+/// Time       : 05/01/2023 Monday
+/// Author     : liuyuqi.gov@msn.cn
 class LoginPage extends StatefulWidget {
 class LoginPage extends StatefulWidget {
-  LoginPage({Key key}) : super(key: key);
+  LoginPage({Key? key}) : super(key: key);
 
 
   @override
   @override
   _LoginPageState createState() => _LoginPageState();
   _LoginPageState createState() => _LoginPageState();

+ 1 - 0
lib/utils/screen.dart

@@ -2,6 +2,7 @@ import '../model/display.dart';
 import './device.dart';
 import './device.dart';
 
 
 class Screen {
 class Screen {
+  
   /// 随着大小间距变化
   /// 随着大小间距变化
   static double getBorderWidth(int gameType) {
   static double getBorderWidth(int gameType) {
     return Display.spacerUnit / gameType * Display.borderMargin;
     return Display.spacerUnit / gameType * Display.borderMargin;

+ 95 - 0
lib/widgets/walk_through.dart

@@ -0,0 +1,95 @@
+import 'package:flutter/material.dart';
+
+/// Description: guide页
+/// Time       : 05/01/2023 Monday
+/// Author     : liuyuqi.gov@msn.cn
+class Walkthrough extends StatefulWidget {
+  final title;
+  final content;
+  final imageIcon;
+  final imagecolor;
+
+  /// 构造函数
+  /// title: 标题
+  /// content: 内容
+  /// imageIcon: 图标
+  /// imagecolor: 图标颜色
+  Walkthrough(
+      {this.title,
+      this.content,
+      this.imageIcon,
+      this.imagecolor = Colors.redAccent});
+
+  @override
+  WalkthroughState createState() {
+    return WalkthroughState();
+  }
+}
+
+class WalkthroughState extends State<Walkthrough>
+    with SingleTickerProviderStateMixin {
+  late Animation animation;
+  late AnimationController animationController;
+
+  @override
+  void initState() {
+    super.initState();
+    animationController =
+        AnimationController(vsync: this, duration: Duration(milliseconds: 500));
+    animation = Tween(begin: -250.0, end: 0.0).animate(
+        CurvedAnimation(parent: animationController, curve: Curves.easeInOut));
+
+    animation.addListener(() => setState(() {}));
+
+    animationController.forward();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+    animationController.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: const EdgeInsets.all(20.0),
+      child: Material(
+        animationDuration: Duration(milliseconds: 500),
+        elevation: 2.0,
+        borderRadius: BorderRadius.all(Radius.circular(5.0)),
+        child: Column(
+          mainAxisSize: MainAxisSize.min,
+          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+          children: <Widget>[
+            Transform(
+              transform: Matrix4.translationValues(animation.value, 0.0, 0.0),
+              child: Text(
+                widget.title,
+                style: TextStyle(
+                    fontSize: 20.0,
+                    fontWeight: FontWeight.bold,
+                    color: Colors.black),
+              ),
+            ),
+            Transform(
+              transform: Matrix4.translationValues(animation.value, 0.0, 0.0),
+              child: Text(widget.content,
+                  softWrap: true,
+                  textAlign: TextAlign.center,
+                  style: TextStyle(
+                      fontWeight: FontWeight.normal,
+                      fontSize: 15.0,
+                      color: Colors.black)),
+            ),
+            Icon(
+              widget.imageIcon,
+              size: 100.0,
+              color: widget.imagecolor,
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}