Browse Source

更改项目结构

liuyuqi-dellpc 1 year ago
parent
commit
96fab40bd3

+ 4 - 4
lib/app/app_navigator.dart

@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
 import 'package:shuqi/public.dart';
 
 import 'package:shuqi/pages/novel_detail/novel_detail_scene.dart';
-import 'package:shuqi/pages/me/login_scene.dart';
-import 'package:shuqi/pages/me/web_scene.dart';
+import 'package:shuqi/pages/login/login_page.dart';
+import 'package:shuqi/pages/web_page.dart';
 import 'package:shuqi/pages/reader/reader_scene.dart';
 
 class AppNavigator {
@@ -23,13 +23,13 @@ class AppNavigator {
 
   static pushLogin(BuildContext context) {
     Navigator.push(context, MaterialPageRoute(builder: (context) {
-      return LoginScene();
+      return LoginPage();
     }));
   }
 
   static pushWeb(BuildContext context, String url, String title) {
     Navigator.push(context, MaterialPageRoute(builder: (context) {
-      return WebScene(url: url, title: title);
+      return WebPage(url: url, title: title);
     }));
   }
 

+ 2 - 2
lib/index_page.dart

@@ -6,7 +6,7 @@ import 'package:shuqi/public.dart';
 
 import 'package:shuqi/pages/home/home_scene.dart';
 import 'package:shuqi/pages/bookshelf/bookshelf_scene.dart';
-import 'package:shuqi/pages/me/me_scene.dart';
+import 'package:shuqi/pages/me/mine_page.dart';
 
 class IndexPage extends StatefulWidget {
   @override
@@ -76,7 +76,7 @@ class IndexPageState extends State<IndexPage> {
         children: <Widget>[
           BookshelfScene(),
           HomeScene(),
-          MeScene(),
+          MinePage(),
         ],
         index: _tabIndex,
       ),

+ 0 - 0
lib/pages/me/code_button.dart → lib/pages/login/code_button.dart


+ 3 - 3
lib/pages/me/login_scene.dart → lib/pages/login/login_page.dart

@@ -5,12 +5,12 @@ import 'package:shuqi/public.dart';
 
 import 'code_button.dart';
 
-class LoginScene extends StatefulWidget {
+class LoginPage extends StatefulWidget {
   @override
-  State<StatefulWidget> createState() => LoginSceneState();
+  State<StatefulWidget> createState() => LoginPageState();
 }
 
-class LoginSceneState extends State {
+class LoginPageState extends State {
   TextEditingController phoneEditer = TextEditingController();
   TextEditingController codeEditer = TextEditingController();
   int coldDownSeconds = 0;

+ 6 - 3
lib/pages/me/me_scene.dart → lib/pages/me/mine_page.dart

@@ -3,10 +3,13 @@ import 'package:flutter/services.dart';
 
 import 'package:shuqi/public.dart';
 import 'me_header.dart';
-import 'setting_scene.dart';
+import '../setting_page.dart';
 import 'me_cell.dart';
+/// Description: 我的页面
+/// Time       : 10/10/2023 Tuesday
+/// Author     : liuyuqi.gov@msn.cn
+class MinePage extends StatelessWidget {
 
-class MeScene extends StatelessWidget {
   Widget buildCells(BuildContext context) {
     return Container(
       child: Column(
@@ -51,7 +54,7 @@ class MeScene extends StatelessWidget {
             iconName: 'img/me_setting.png',
             onPressed: () {
               Navigator.push(context, MaterialPageRoute(builder: (context) {
-                return SettingScene();
+                return SettingPage();
               }));
             },
           ),

+ 3 - 2
lib/pages/me/setting_scene.dart → lib/pages/setting_page.dart

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
 
 import 'package:shuqi/public.dart';
 
-class SettingScene extends StatelessWidget {
+class SettingPage extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     List<Widget> children = [];
@@ -17,7 +17,8 @@ class SettingScene extends StatelessWidget {
           height: 50,
           color: Colors.white,
           child: Center(
-            child: Text('退出登录', style: TextStyle(fontSize: 16, color: SQColor.red)),
+            child: Text('退出登录',
+                style: TextStyle(fontSize: 16, color: SQColor.red)),
           ),
         ),
       ));

+ 6 - 5
lib/pages/me/web_scene.dart → lib/pages/web_page.dart

@@ -3,17 +3,17 @@ import 'package:flutter/services.dart';
 import 'package:webview_flutter/webview_flutter.dart';
 import 'package:share/share.dart';
 
-class WebScene extends StatefulWidget {
+class WebPage extends StatefulWidget {
   final String url;
   final String? title;
 
-  WebScene({required this.url, this.title});
+  WebPage({required this.url, this.title});
 
   @override
-  _WebSceneState createState() => _WebSceneState();
+  _WebPageState createState() => _WebPageState();
 }
 
-class _WebSceneState extends State<WebScene> {
+class _WebPageState extends State<WebPage> {
   WebViewController? controller;
 
   @override
@@ -31,7 +31,8 @@ class _WebSceneState extends State<WebScene> {
       appBar: AppBar(
         systemOverlayStyle: SystemUiOverlayStyle.dark,
         backgroundColor: Colors.white,
-        title: Text(widget.title ?? '', style: TextStyle(color: Colors.black87)),
+        title:
+            Text(widget.title ?? '', style: TextStyle(color: Colors.black87)),
         leading: IconButton(
           onPressed: () => Navigator.maybePop(context),
           icon: Icon(Icons.arrow_back_ios, color: Colors.black87),