Skip to content

Commit

Permalink
refactor:根据规范,重构代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Nealyang committed Feb 19, 2019
1 parent 8817198 commit 1b266c0
Show file tree
Hide file tree
Showing 89 changed files with 368 additions and 461 deletions.
4 changes: 0 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
333E5DAE7FC10AC69FEC26C0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA792F029EDD7A11295D192 /* libPods-Runner.a */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
Expand Down Expand Up @@ -75,7 +74,6 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -148,7 +146,6 @@
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
Expand Down Expand Up @@ -274,7 +271,6 @@
0828E4A2220692B500A59437 /* iPhone Portrait-Retina HD 5.5.png in Resources */,
0828E49A220692B500A59437 /* iPhone X_XS Portrait.png in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
0828E49E220692B500A59437 /* iPad [email protected] in Resources */,
0828E49D220692B500A59437 /* iPhone [email protected] in Resources */,
0828E499220692B500A59437 /* iPhone Portrait-Retina HD 4.7.png in Resources */,
Expand Down
1 change: 1 addition & 0 deletions lib/components/cate_card.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import '../model/cat.dart';
import '../resources/widget_name_to_icon.dart';
import '../components/widget_item_container.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/components/category.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';

import '../routers/application.dart';
import '../model/cat.dart';
import '../model/widget.dart';
Expand Down
16 changes: 8 additions & 8 deletions lib/components/disclaimer_msg.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* Created with Android Studio.
* User: 一晟
* Date: 2019/1/12
* Time: 下午9:19
* email: [email protected]
*/
/// Created with Android Studio.
/// User: 一晟
/// Date: 2019/1/12
/// Time: 下午9:19
/// email: [email protected]
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:async';


const disclaimerText1 =
'\r\r\r\r\r\r本APP属于个人的非赢利性开源项目,以供开源社区使用,凡本APP转载的所有的文章 、图片、音频、视频文件等资料的版权归版权所有人所有,本APP采用的非本站原创文章及图片等内容无法一一和版权者联系,如果本网所选内容的文章作者及编辑认为其作品不宜上网供大家浏览,或不应无偿使用请及时用电子邮件或电话通知我们,以迅速采取适当措施,避免给双方造成不必要的经济损失。';
Expand Down
12 changes: 6 additions & 6 deletions lib/components/full_screen_code_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* @Author: 一凨
* @Date: 2019-01-14 11:42:32
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-14 14:42:00
*/
/// @Author: 一凨
/// @Date: 2019-01-14 11:42:32
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 14:42:00
import 'package:flutter/material.dart';

import 'package:flutter_go/utils/example_code_parser.dart';
import 'package:flutter_go/utils/syntax_highlighter.dart';

Expand Down
2 changes: 2 additions & 0 deletions lib/components/home_banner.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';

import '../model/story.dart';

class HomeBanner extends StatefulWidget {
Expand Down
3 changes: 2 additions & 1 deletion lib/components/list_refresh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
/// email: [email protected]
/// target: ListRefresh 的示例
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/material.dart';

class ListRefresh extends StatefulWidget {
final renderItem;
final requestApi;
Expand Down
11 changes: 5 additions & 6 deletions lib/components/list_view_item.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* @Author: 一凨
* @Date: 2019-01-14 17:53:54
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-14 17:57:51
*/
/// @Author: 一凨
/// @Date: 2019-01-14 17:53:54
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 17:57:51
import 'package:flutter/material.dart';
import '../routers/application.dart';
import '../routers/routers.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/components/markdown.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flutter_markdown/flutter_markdown.dart' as md;
import 'package:flutter_go/utils/high_light_code.dart';
import 'package:flutter/material.dart';

import 'package:flutter_go/utils/high_light_code.dart';

/// 使用方法
/// MarkdownBody(markdown)
final hightlighter = new HighLight();
Expand Down
3 changes: 2 additions & 1 deletion lib/components/pagination.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

import './home_banner.dart';
import '../model/story.dart';
import 'package:url_launcher/url_launcher.dart';

class Pagination extends StatelessWidget {
static final String routeName = '/material/page-selector';
Expand Down
1 change: 1 addition & 0 deletions lib/components/search_input.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:meta/meta.dart';

Expand Down
12 changes: 6 additions & 6 deletions lib/components/widget_demo.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* @author Nealyang
*
* 新widget详情页模板
*/
/// @author Nealyang
/// 新widget详情页模板
import 'dart:core';

import 'package:flutter/material.dart';

import '../routers/application.dart';
import '../routers/routers.dart';
import '../components/markdown.dart';
import '../model/collection.dart';
import '../widgets/index.dart';
import '../event/event_bus.dart';
import '../event/event_model.dart';
import 'dart:core';

class WidgetDemo extends StatefulWidget {
final List<dynamic> contentList;
Expand Down
6 changes: 3 additions & 3 deletions lib/components/widget_item.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @author 一凨
*/
/// @author 一凨
import 'package:flutter/material.dart';

import 'package:flutter_go/utils/style.dart';
import 'package:flutter_go/resources/widget_name_to_icon.dart';

Expand Down
1 change: 1 addition & 0 deletions lib/components/widget_item_container.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import './widget_item.dart';
import '../routers/application.dart';
import '../widgets/index.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:fluro/fluro.dart';
import 'package:flutter/rendering.dart';
import 'routers/routers.dart';
import 'routers/application.dart';

import 'package:flutter_go/utils/provider.dart';
import 'package:flutter_go/utils/shared_preferences.dart';
import 'package:flutter_go/views/first_page/home.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/model/base.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:sqflite/sqflite.dart';


class BaseModel{
Database db;
final String table = '';
Expand Down
1 change: 1 addition & 0 deletions lib/model/cat.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import 'dart:async';

import 'package:flutter_go/utils/sql.dart';

abstract class CatInterface{
Expand Down
12 changes: 6 additions & 6 deletions lib/model/collection.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* @Author: 一凨
* @Date: 2019-01-07 16:24:42
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-08 17:37:42
*/
/// @Author: 一凨
/// @Date: 2019-01-07 16:24:42
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-08 17:37:42
import 'dart:async';

import 'package:flutter_go/utils/sql.dart';

abstract class CollectionInterface {
Expand Down
4 changes: 3 additions & 1 deletion lib/model/widget.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

import 'dart:async';
import 'package:flutter_go/utils/sql.dart';

import "package:flutter/material.dart";

import 'package:flutter_go/utils/sql.dart';

abstract class WidgetInterface {
int get id;

Expand Down
14 changes: 6 additions & 8 deletions lib/resources/shared_preferences_keys.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/**
* Created with Android Studio.
* User: 三帆
* Date: 31/01/2019
* Time: 18:13
* email: [email protected]
* target: xxx
*/
/// Created with Android Studio.
/// User: 三帆
/// Date: 31/01/2019
/// Time: 18:13
/// email: [email protected]
/// target: xxx
//enum DateType {
// Int,
Expand Down
4 changes: 3 additions & 1 deletion lib/routers/application.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';

import 'package:flutter_go/utils/shared_preferences.dart';

class Application {
static Router router;
static TabController controller;
Expand Down
1 change: 1 addition & 0 deletions lib/routers/router_handler.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';

import 'package:flutter_go/components/category.dart';
import '../widgets/404.dart';
import 'package:flutter_go/components/full_screen_code_dialog.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/routers/routers.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';

import '../widgets/index.dart';
import './router_handler.dart';

Expand Down
17 changes: 7 additions & 10 deletions lib/utils/example_code_parser.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
/*
* @Author: 一凨
* @Date: 2019-01-14 11:42:36
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-14 16:53:11
*/
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @Author: 一凨
/// @Date: 2019-01-14 11:42:36
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 16:53:11
import 'dart:async';
import 'package:flutter_go/routers/application.dart';

import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter/material.dart';

import 'package:flutter_go/routers/application.dart';


Map<String, String> _exampleCode;
String _code;
Expand Down
4 changes: 3 additions & 1 deletion lib/utils/net_utils.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:dio/dio.dart';
import 'dart:async';

import 'package:dio/dio.dart';


var dio = new Dio();

class NetUtils {
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/provider.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';

import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:flutter/services.dart' show rootBundle;

//const createSql = {
// 'cat': """
// CREATE TABLE "cat" (
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/shared_preferences.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import 'dart:async';

import 'package:shared_preferences/shared_preferences.dart';

export 'package:flutter_go/resources/shared_preferences_keys.dart';

/// 用来做shared_preferences的存储
Expand Down
5 changes: 2 additions & 3 deletions lib/utils/sql.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import './provider.dart';
import 'dart:async';
import 'package:sqflite/sqflite.dart';


import 'package:sqflite/sqflite.dart';

import './provider.dart';

class BaseModel{
Database db;
Expand Down
13 changes: 4 additions & 9 deletions lib/utils/syntax_highlighter.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/*
* @Author: 一凨
* @Date: 2019-01-14 11:42:39
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-14 11:42:39
*/
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @Author: 一凨
/// @Date: 2019-01-14 11:42:39
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 11:42:39
import 'package:flutter/material.dart';
import 'package:string_scanner/string_scanner.dart';
Expand Down
15 changes: 8 additions & 7 deletions lib/views/collection_page/collection_page.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
* @Author: 一凨
* @Date: 2019-01-08 17:12:58
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-14 20:13:28
*/
/// @Author: 一凨
/// @Date: 2019-01-08 17:12:58
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 20:13:28
import 'package:flutter/material.dart';
import 'package:event_bus/event_bus.dart';

import 'package:flutter_go/model/collection.dart';
import 'package:flutter_go/routers/application.dart';
import 'package:flutter_go/routers/routers.dart';
import 'package:flutter_go/event/event_bus.dart';
import 'package:flutter_go/event/event_model.dart';
import 'package:event_bus/event_bus.dart';


class CollectionPage extends StatefulWidget {
_CollectionPageState createState() => _CollectionPageState();
Expand Down
Loading

0 comments on commit 1b266c0

Please sign in to comment.