添加个人中心

This commit is contained in:
yifeng.yl
2019-05-31 10:47:16 +08:00
16 changed files with 194 additions and 59 deletions

View File

@ -26,7 +26,9 @@ Language: [English](https://github.com/alibaba/flutter-go/blob/master/README-en.
android下载地址:
<img src="https://img.alicdn.com/tfs/TB1ylxGTMHqK1RjSZFgXXa7JXXa-436-432.png" width="200px">
华为市场已上线master分支上面已上传【FlutterGo.apk】apk包可点击下载
iphone下载地址: AppStore上面进行搜索fluttego

Binary file not shown.

View File

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.0.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.6","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

View File

@ -10,18 +10,19 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODE_WORLD_READABLE" />
<uses-permission android:name="android.permission.MODE_WORLD_WRITEABLE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="fluttergo"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher_logo">
android:label="FlutterGo"
android:icon="@mipmap/ic_launcher_logo"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
@ -35,5 +36,32 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="${applicationId}.flutter_downloader.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
android:enabled="false"
android:exported="false" />
<provider
android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
android:authorities="${applicationId}.flutter-downloader-init"
android:exported="false">
<meta-data
android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
android:value="5" />
</provider>
</application>
</manifest>

View File

@ -222,6 +222,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
C38E5EAE601417DA9DF11753 /* [CP] Embed Pods Frameworks */,
2432F011A7D713E4BFB3DC88 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -300,6 +301,24 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
2432F011A7D713E4BFB3DC88 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/flutter_downloader/FlutterDownloaderDatabase.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FlutterDownloaderDatabase.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@ -42,7 +42,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@ -11,4 +11,5 @@ class Api{
static const String GET_USER_INFO = BASE_URL+'getUserInfo';//获取用户信息
static const String RedirectIp = 'http://100.81.211.172/';
static const String VERSION = BASE_URL+'getAppVersion';//检查版本
}

View File

@ -59,4 +59,6 @@ class UserInfoControlModel {
Future deleteAll() async{
return await sql.deleteAll();
}
}

29
lib/model/version.dart Normal file
View File

@ -0,0 +1,29 @@
class Data {
String version;
String name;
Data.fromJson(Map<String, dynamic> json)
: version = json['version'],
name = json['name'];
@override
String toString() {
return 'name: $name ,version: $version';
}
}
class Version {
Data data;
int status;
bool success;
Version.formJson(Map<String, dynamic> json)
: status = json['status'],
success = json['success'],
data = Data.fromJson(json['data']);
@override
String toString() {
return 'status: $status ,success: $success,date: ${data.toString()}';
}
}

View File

@ -1,5 +1,8 @@
import 'dart:async' show Future;
import 'package:flutter_go/model/version.dart';
import 'package:package_info/package_info.dart';
import './net_utils.dart';
import '../model/user_info.dart';
import 'package:flutter_go/api/api.dart';
@ -48,4 +51,21 @@ class DataUtils {
print('退出登陆 $response');
return response['success'];
}
// 检查版本
static Future<bool> checkVersion(Map<String, String> params) async {
var response = await NetUtils.get(Api.VERSION, params);
Version version = Version.formJson(response);
var currVersion = version.data.version;
PackageInfo packageInfo = await PackageInfo.fromPlatform();
var localVersion = packageInfo.version;
//相同=0、大于=1、小于=-1
// localVersion = '0.0.2';
// currVersion = '1.0.6';
if (currVersion.compareTo(localVersion) == 1) {
return true;
} else {
return false;
}
}
}

View File

@ -75,7 +75,10 @@ class TabLayout extends StatelessWidget {
//labelPadding: EdgeInsets.all(12.0),
labelPadding: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0),
indicatorSize: TabBarIndicatorSize.label,
tabs: _allPages.map((_Page page) => Tab(text: page.labelId)).toList(),
tabs: _allPages
.map((_Page page) =>
Tab(text: page.labelId))
.toList(),
);
}
}

View File

@ -29,7 +29,6 @@ class AppPage extends StatefulWidget {
AppPage(this.userInfo);
@override
State<StatefulWidget> createState() {
return _MyHomePageState();
@ -38,37 +37,35 @@ class AppPage extends StatefulWidget {
class _MyHomePageState extends State<AppPage>
with SingleTickerProviderStateMixin {
SpUtil sp;
WidgetControlModel widgetControl = new WidgetControlModel();
SearchHistoryList searchHistoryList;
bool isSearch = false;
String appBarTitle = tabData[0]['text'];
List<Widget> list = List();
List<Widget> _list = List();
int _currentIndex = 0;
static List tabData = [
{'text': '业界动态', 'icon': Icon(Icons.language)},
{'text': 'WIDGET', 'icon': Icon(Icons.extension)},
{'text': '组件收藏', 'icon': Icon(Icons.favorite)},
{'text': '关于手册', 'icon': Icon(Icons.import_contacts)}
{'text': '关于手册', 'icon': Icon(Icons.import_contacts)},
];
List<BottomNavigationBarItem> myTabs = [];
List<BottomNavigationBarItem> _myTabs = [];
@override
void initState() {
super.initState();
initSearchHistory();
for (int i = 0; i < tabData.length; i++) {
myTabs.add(BottomNavigationBarItem(
_myTabs.add(BottomNavigationBarItem(
icon: tabData[i]['icon'],
title: Text(
tabData[i]['text'],
),
));
}
list
_list
// ..add(FirstPage())
..add(MainPage(userInfo: widget.userInfo))
..add(WidgetPage(Provider.db))
@ -126,7 +123,6 @@ class _MyHomePageState extends State<AppPage>
}
renderAppBar(BuildContext context, Widget widget, int index) {
print('renderAppBar=====>>>>>>${index}');
if (index == 0) {
return null;
}
@ -137,13 +133,16 @@ class _MyHomePageState extends State<AppPage>
Widget build(BuildContext context) {
return new Scaffold(
appBar: renderAppBar(context, widget, _currentIndex),
body: list[_currentIndex],
body: IndexedStack(
index: _currentIndex,
children: _list,
),
bottomNavigationBar: BottomNavigationBar(
items: myTabs,
items: _myTabs,
//高亮 被点击高亮
currentIndex: _currentIndex,
//修改 页面
onTap: _ItemTapped,
onTap: _itemTapped,
//shifting :按钮点击移动效果
//fixed固定
type: BottomNavigationBarType.fixed,
@ -153,7 +152,7 @@ class _MyHomePageState extends State<AppPage>
);
}
void _ItemTapped(int index) {
void _itemTapped(int index) {
setState(() {
_currentIndex = index;
appBarTitle = tabData[index]['text'];

View File

@ -77,7 +77,7 @@ packages:
name: dio
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
version: "2.1.6"
event_bus:
dependency: "direct main"
description:
@ -118,6 +118,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.11.1"
flutter_downloader:
dependency: "direct main"
description:
name: flutter_downloader
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.7"
flutter_markdown:
dependency: "direct main"
description:
@ -143,7 +150,7 @@ packages:
name: flutter_webview_plugin
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.4"
version: "0.3.5"
fluttertoast:
dependency: "direct main"
description:
@ -164,7 +171,7 @@ packages:
name: image_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0+2"
version: "0.6.0+8"
intl:
dependency: "direct main"
description:
@ -200,6 +207,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
open_file:
dependency: "direct main"
description:
name: open_file
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1+2"
package_info:
dependency: "direct main"
description:
name: package_info
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.0+3"
path:
dependency: transitive
description:
@ -213,7 +234,7 @@ packages:
name: path_provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
version: "1.1.0"
pedantic:
dependency: transitive
description:
@ -221,6 +242,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.0"
quiver:
dependency: transitive
description:

View File

@ -7,7 +7,7 @@ description: flutter_go
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.0
version: 1.0.6
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
@ -29,7 +29,6 @@ dependencies:
shared_preferences: ^0.4.3
share: ^0.6.1+1
flutter_spinkit: "^3.1.0"
path_provider: ^1.0.0
fluttertoast: ^3.1.0
dio: ^2.0.15
flutter_webview_plugin: ^0.3.4
@ -43,6 +42,11 @@ dependencies:
flutter_bloc: ^0.11.1
bloc: ^0.12.0
html: ^0.14.0+2
flutter_downloader: ^1.1.7
path_provider: ^1.1.0
permission_handler: ^3.0.0
open_file: ^2.0.1+2
package_info: ^0.4.0+3
dev_dependencies:
flutter_test: