Modfiy: 改造业内资讯页面

This commit is contained in:
ryan
2019-05-01 00:32:55 +08:00
80 changed files with 774 additions and 370 deletions

View File

@ -25,8 +25,15 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 27
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@ -38,21 +45,28 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ali.fluttergo"
applicationId "com.alibaba.fluttergo"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}
flutter {
@ -62,8 +76,8 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.8'
//Crashlytics SDK

View File

@ -1,42 +1,35 @@
{
"project_info": {
"project_number": "1002138254102",
//"firebase_url": "https://ali-flutter-go.firebaseio.com",
"project_id": "ali-flutter-go",
"storage_bucket": "ali-flutter-go.appspot.com"
"project_number": "611157827052",
"firebase_url": "https://alibaba-flutter-go.firebaseio.com",
"project_id": "alibaba-flutter-go",
"storage_bucket": "alibaba-flutter-go.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1002138254102:android:00e8533fa0274183",
"mobilesdk_app_id": "1:611157827052:android:c6129e5eff2f125d",
"android_client_info": {
"package_name": "com.ali.fluttergo"
"package_name": "com.alibaba.fluttergo"
}
},
"oauth_client": [
{
"client_id": "1002138254102-2r4hs0mm1avp4p1qielecihnbugan693.apps.googleusercontent.com",
"client_id": "611157827052-iiuevj8qu56alpqh47v37j9sd4e40di7.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDFdL3GSwVDfejIq44pyOpiEBZ32dTGMVA"
"current_key": "AIzaSyA9chxDIuds7gmPQTJPpDpoXyN9rDTdvhU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1002138254102-2r4hs0mm1avp4p1qielecihnbugan693.apps.googleusercontent.com",
"client_id": "611157827052-iiuevj8qu56alpqh47v37j9sd4e40di7.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "1002138254102-qo9jp8c3lc69p9lclu0rtp5dmt1kulv7.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.ali.fluttergo"
}
}
]
}

View File

@ -0,0 +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":{}}]

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ali.fluttergo">
package="com.alibaba.fluttergo">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ali.fluttergo">
package="com.alibaba.fluttergo">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.

View File

@ -1,4 +1,4 @@
package com.ali.fluttergo
package com.alibaba.fluttergo
import android.os.Bundle

View File

@ -6,7 +6,6 @@
<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/splash" />
android:src="@drawable/splash" />
</item>
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ali.fluttergo">
package="com.alibaba.fluttergo">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View File

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.0'
repositories {
google()
jcenter()
@ -10,7 +10,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.3.0'
//firebase
classpath 'com.google.gms:google-services:4.2.0'
//Crashlytics SDK

View File

@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableJetifier=true
android.useAndroidX=true

4
android/key.properties Normal file
View File

@ -0,0 +1,4 @@
storePassword=fluttergo123
keyPassword=fluttergo123
keyAlias=key
storeFile=/Users/xj.deng/key.jks

View File

@ -243,7 +243,8 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = RDJKXT446D;
DevelopmentTeam = 4WLT68XRNA;
ProvisioningStyle = Manual;
};
};
};
@ -252,6 +253,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
@ -350,8 +352,8 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@ -359,7 +361,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -509,8 +511,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = Launch2;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = RDJKXT446D;
DEVELOPMENT_TEAM = 4WLT68XRNA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -522,8 +525,9 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.ali.fluttergo;
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "FlutterGO-alibaba-develop";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@ -534,8 +538,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = Launch2;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = RDJKXT446D;
DEVELOPMENT_TEAM = 4WLT68XRNA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -547,8 +553,9 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.ali.fluttergo;
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = FlutterGO_alibaba_distribution_ad_hoc;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -3,115 +3,115 @@
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"filename" : "40*40@1x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"filename" : "60*60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"filename" : "29*29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"filename" : "58*58@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"filename" : "87*87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"filename" : "80*80@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"filename" : "120*120@2x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"filename" : "120*120@2x-1.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"filename" : "180*180@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"filename" : "20*20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"filename" : "40*40@1x-2.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"filename" : "29*29@1x-2.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"filename" : "58*58@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"filename" : "40*40@1x-1.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"filename" : "80*80@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"filename" : "76*76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"filename" : "152*152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"filename" : "167*167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"filename" : "1024*1024@as.png",
"scale" : "1x"
}
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -3,21 +3,21 @@
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1002138254102-qo9jp8c3lc69p9lclu0rtp5dmt1kulv7.apps.googleusercontent.com</string>
<string>611157827052-0n777p43lrtr2dpo7gco5o3lffu7a7r4.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1002138254102-qo9jp8c3lc69p9lclu0rtp5dmt1kulv7</string>
<string>com.googleusercontent.apps.611157827052-0n777p43lrtr2dpo7gco5o3lffu7a7r4</string>
<key>API_KEY</key>
<string>AIzaSyD01jR14RevQibnzkg4tBUbFzc7UjKESFQ</string>
<string>AIzaSyDztt5Q9D7plAc8VqNtHumAci6BaoOiTg4</string>
<key>GCM_SENDER_ID</key>
<string>1002138254102</string>
<string>611157827052</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.ali.fluttergo</string>
<string>com.alibaba.fluttergo</string>
<key>PROJECT_ID</key>
<string>ali-flutter-go</string>
<string>alibaba-flutter-go</string>
<key>STORAGE_BUCKET</key>
<string>ali-flutter-go.appspot.com</string>
<string>alibaba-flutter-go.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
@ -29,8 +29,8 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1002138254102:ios:00e8533fa0274183</string>
<string>1:611157827052:ios:c6129e5eff2f125d</string>
<key>DATABASE_URL</key>
<string>https://ali-flutter-go.firebaseio.com</string>
<string>https://alibaba-flutter-go.firebaseio.com</string>
</dict>
</plist>

View File

@ -3,43 +3,30 @@
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {

View File

@ -0,0 +1,14 @@
/**
* Created with Android Studio.
* User: 一晟
* Date: 2019/4/28
* Time: 7:11 PM
* email: zhu.yan@alibaba-inc.com
* tartget:
*/
class SearchResult {
String title;
String source;
SearchResult({this.title, this.source});
}

View File

@ -14,47 +14,45 @@ import './industry_model.dart';
import './search_result.dart';
var dio = new Dio();
class Api2 {
/// 关键字提示(起点)
Future<List<String>> suggestion(String query) async {
// http.Response response = await http.get(
// "https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query");
var response = await dio.get("https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query", data: {});
//var response = await dio.get("https://www.so.com/s?ie=utf-8&q=$query");
print('1=====>${query}');
print('2=====>${response.data}');
//var data = Suggestion.fromJson(json.decode(response.body));
//class Api2 {
// /// 关键字提示(起点)
// Future<List<String>> suggestion(String query) async {
//// http.Response response = await http.get(
//// "https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query");
// var response = await dio.get("https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query", data: {});
// //var response = await dio.get("https://www.so.com/s?ie=utf-8&q=$query");
// print('1=====>${query}');
// print('2=====>${response.data}');
// //var data = Suggestion.fromJson(json.decode(response.body));
// //var data = Suggestion.fromJson(json.decode(response.data));
// var data = Suggestion.fromJson(json.decode(response.data));
var data = Suggestion.fromJson(json.decode(response.data));
List<String> suggestion = [];
data.suggestions.forEach((k) {
//print('=====>${k.value}');
suggestion.add(k.value);
});
return Future.delayed(Duration(seconds:2), () {
return suggestion;
});
// List<String> suggestion = [];
// data.suggestions.forEach((k) {
// //print('=====>${k.value}');
// suggestion.add(k.value);
// });
//
// return Future.delayed(Duration(seconds:2), () {
// return suggestion;
}
}
// });
// //return suggestion;
// }
//}
class Api {
/// 关键字提示(起点)
Future<List<SearchResult>> suggestion(String query) async {
// http.Response response = await http.get(
// "https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query");
/// var response = await dio.get("https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query", data: {});
var response = await dio.get("https://www.so.com/s?ie=utf-8&q=$query");
var response = await dio.get("https://www.so.com/s?ie=utf-8&q=$query flutter");
var document = parse(response.data);
var app = document.querySelectorAll('.res-title a');
print('1=====>${query}');
print('2=====>${response.data}');
print('3=====>${app}');
//var data = Suggestion.fromJson(json.decode(response.body));
//var data = Suggestion.fromJson(json.decode(response.data));
///print('1=====>${query}');
///print('2=====>${response.data}');
////print('3=====>${app}');
List<SearchResult> res = [];
app.forEach((f) {
print('f==>${f}');
///print('f==>${f}');
res.add(
SearchResult(
title: f.text,

View File

@ -15,19 +15,27 @@ import './industry_state.dart';
class SuggestionBloc extends Bloc<SuggestionEvent, SuggestionState> {
@override
SuggestionState get initialState => SuggestionUninitialized();
@override
Stream<SuggestionState> mapEventToState(SuggestionEvent event)async* {
//Stream<SuggestionState> mapEventToState(SuggestionState currentState, SuggestionEvent event,) async* {
if (event is SuggestionFetch) {
print('event==>${event.query}');
//print('event==>${event}');
try {
yield SuggestionLoading();
final res = await api.suggestion(event.query);
print('res====>${res}');
yield SuggestionLoaded(res: res);
} catch (_) {
yield SuggestionError();
}
}
if (event is SuggestionClearFetch) {
//print('event==>${event}');
try {
yield SuggestionUninitialized();
} catch (_) {
yield SuggestionError();
}
}
}
}

View File

@ -15,3 +15,12 @@ class SuggestionFetch extends SuggestionEvent {
@override
String toString() => 'SuggestionFetch:获取关键字提示事件';
}
class SuggestionClearFetch extends SuggestionEvent {
final String query;
SuggestionClearFetch({this.query});
@override
String toString() => 'SuggestionClearFetch:清空界面';
}

View File

@ -6,52 +6,40 @@
* email: zhu.yan@alibaba-inc.com
*/
import 'package:flutter/material.dart';
//import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import './industry_bloc.dart';
import './industry_event.dart';
import './industry_state.dart';
//class Industry extends StatelessWidget {
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// title: '关键字提示',
// home: Scaffold(
// appBar: AppBar(
// title: Text('关键字提示'),
// ),
// body: AppHome(),
// ),
// );
// }
//}
final SuggestionBloc suggestion = SuggestionBloc();
class IndustryPage extends StatefulWidget {
final Function itemTitle;
IndustryPage({Key key,this.itemTitle}) : super(key: key);
@override
_IndustryState createState() => _IndustryState();
}
class _IndustryState extends State<IndustryPage> {
final SuggestionBloc _suggestion = SuggestionBloc();
@override
Widget build(BuildContext context) {
return Material(
child: Column(
children: [
TextField(
autofocus: true,
textAlign: TextAlign.center,
onSubmitted: (text) {
_suggestion.dispatch(SuggestionFetch(query: text));
},
),
// TextField(
// autofocus: true,
// textAlign: TextAlign.center,
// onSubmitted: (text) {
// print('onSubmitted:${text}');
// suggestion.dispatch(SuggestionFetch(query: text));
// },
// ),
Expanded(
child: BlocBuilder(
bloc: _suggestion,
bloc: suggestion,
builder: (BuildContext context, SuggestionState state) {
print('-------${state}');
print('BlocBuilder----${state}');
if (state is SuggestionUninitialized) {
return Center(
child: Text('暂无内容'),
@ -65,34 +53,15 @@ class _IndustryState extends State<IndustryPage> {
child: Text('出现错误'),
);
} else if (state is SuggestionLoaded) {
// return ListView.builder(
// itemBuilder: (BuildContext context, int index) {
// //return ListTile(title: Text(state.res[index]));
// return null;
// },
// itemCount: state.res.length,
// );
return ListView.builder(
itemBuilder: (BuildContext context, int index) {
return ListTile(
dense: true,
leading: Icon(
Icons.bookmark_border,
size: 32,
),
title: Text(
state.res[index].title,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(state.res[index].source),
onTap: () {
// 在这里对选中的结果进行解析因为我目前是用golang实现的所以就没贴代码了。
print(state.res[index].source);
},
);
},
itemCount: state.res.length,
if (state.res.length == 0) {
return Center(
child: Text('没有适合的结果,更换查询条件试试'),
);
}else {
if (widget.itemTitle is Function) {
return widget.itemTitle(state);
}
}
}
},
),
@ -104,7 +73,7 @@ class _IndustryState extends State<IndustryPage> {
@override
void dispose() {
_suggestion.dispose();
//suggestion.dispose();//添加这个第二次进入会失灵
super.dispose();
}
}

View File

@ -42,6 +42,18 @@ class _BannerState extends State<HomeBanner> {
timer.cancel();
}
/// pagination 的计数器
Widget _numberIndicator(BuildContext context, int index, int itemCount) {
return Container(
decoration: BoxDecoration(
color: Colors.black45, borderRadius: BorderRadius.circular(20.0)),
margin: EdgeInsets.only(top: 10.0, right: 5.0),
padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 2.0),
child: Text("${++index}/$itemCount",
style: TextStyle( color: Colors.white70, fontSize: 12.0, fontWeight:FontWeight.bold )),
);
}
@override
Widget build(BuildContext context) {
return Container(
@ -54,6 +66,11 @@ class _BannerState extends State<HomeBanner> {
onPageChanged: _onPageChanged,
children: _buildItems(),),
_buildIndicator(), // 下面的小点
Positioned(//方法二
top: 0.0,
right: 0.0,
child: _numberIndicator(context,virtualIndex,widget.bannerStories.length),
)
]),
);
}

View File

@ -6,7 +6,7 @@ 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';
import 'package:flutter_go/views/home.dart';
import 'package:flutter_go/model/search_history.dart';
import 'package:flutter_go/utils/analytics.dart' as Analytics;
//import 'views/welcome_page/index.dart';
@ -53,6 +53,7 @@ class MyApp extends StatelessWidget {
home: new Scaffold(
body: showWelcomePage()
),
debugShowCheckedModeBanner: false,
onGenerateRoute: Application.router.generator,
navigatorObservers: <NavigatorObserver>[Analytics.observer],
);

View File

@ -5,7 +5,7 @@ import 'package:flutter_go/components/category.dart';
import '../widgets/404.dart';
import 'package:flutter_go/components/full_screen_code_dialog.dart';
import 'package:flutter_go/views/web_page/web_view_page.dart';
import 'package:flutter_go/views/first_page/home.dart';
import 'package:flutter_go/views/home.dart';
// app的首页
var homeHandler = new Handler(

View File

@ -40,7 +40,7 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
/// 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
_unKnow.then((bool value) {
new Future.delayed(const Duration(seconds: 1),(){
if (!value) {
if (!value && key.currentState is DisclaimerMsgState && key.currentState.showAlertDialog is Function) {
key.currentState.showAlertDialog(context);
}
});
@ -80,8 +80,8 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
return result;
}
/// 每个item的样式
Widget makeCard(index,item){
var myTitle = '${item.title}';
var myUsername = '${'👲'}: ${item.username} ';
var codeUrl = '${item.detailUrl}';

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
//import 'package:flutter_wanandroid/common/component_index.dart';
//import 'package:flutter_wanandroid/ui/pages/main_left_page.dart';
//import 'package:flutter_wanandroid/ui/pages/page_index.dart';
import 'package:flutter/cupertino.dart';
import './first_page.dart';
import './sub_page.dart';
import './main_app_bar.dart';
import './search_page.dart';
class _Page {
final String labelId;
@ -12,10 +12,10 @@ class _Page {
}
final List<_Page> _allPages = <_Page>[
_Page('titleHome'),
_Page('titleHome'),
_Page('titleHome'),
_Page('titleHome'),
_Page('项目1'),
_Page('项目2'),
_Page('项目3'),
_Page('项目4'),
];
class MainPage extends StatelessWidget {
@ -40,10 +40,7 @@ class MainPage extends StatelessWidget {
IconButton(
icon: Icon(Icons.search),
onPressed: () {
/// NavigatorUtil.pushPage(context, SearchPage(),
///pageName: "SearchPage");
// NavigatorUtil.pushPage(context, TestPage());
// NavigatorUtil.pushPage(context, DemoApp());
pushPage(context, SearchPage(), pageName: "SearchPage");
})
],
),
@ -55,12 +52,18 @@ class MainPage extends StatelessWidget {
}
}
void pushPage(BuildContext context, Widget page, {String pageName}) {
if (context == null || page == null) return;
Navigator.push(context, CupertinoPageRoute<void>(builder: (ctx) => page));
}
class TabLayout extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TabBar(
isScrollable: true,
labelPadding: EdgeInsets.all(12.0),
//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) =>
@ -73,32 +76,23 @@ class TabLayout extends StatelessWidget {
class TabBarViewLayout extends StatelessWidget {
Widget buildTabView(BuildContext context, _Page page) {
String labelId = page.labelId;
// switch (labelId) {
// case Ids.titleHome:
// //return HomePage(labelId: labelId);
// return ReposPage(labelId: labelId);
// break;
// case Ids.titleRepos:
// return ReposPage(labelId: labelId);
// break;
// case Ids.titleEvents:
// return EventsPage(labelId: labelId);
// break;
// case Ids.titleSystem:
// return SystemPage(labelId: labelId);
// break;
// default:
// return Container();
// break;
// }
return Container(
child: new ClipOval(
child: Image.network(
'https://hbimg.huabanimg.com/9bfa0fad3b1284d652d370fa0a8155e1222c62c0bf9d-YjG0Vt_fw658',
scale: 5.0,
),
)
);
switch (labelId) {
case '项目1':
return FirstPage();
break;
case '项目2':
return SubPage();
break;
case '项目3':
return SubPage();
break;
case '项目4':
return SubPage();
break;
default:
return Container();
break;
}
}
@override

View File

@ -0,0 +1,189 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/cupertino.dart';
import 'dart:ui';
import 'dart:async';
import 'package:flutter_go/blocs/industry_main.dart' as Industry;
import 'package:flutter_go/blocs/industry_event.dart';
import 'package:flutter_go/routers/application.dart';
import 'package:flutter_go/routers/routers.dart';
final _industryPage = Industry.IndustryPage(itemTitle: (state){
return ListView.builder(
itemBuilder: (BuildContext context, int index) {
return ListTile(
dense: true,
leading: Icon(
Icons.bookmark_border,
size: 32,
),
title: Text(
state.res[index].title,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(state.res[index].source),
onTap: () {
// 在这里对选中的结果进行解析因为我目前是用golang实现的所以就没贴代码了。
print(state.res[index].source);
final itemTitle = state.res[index].title;
final itemUrl = state.res[index].source;
Application.router.navigateTo(context, '${Routes.webViewPage}?title=${Uri.encodeComponent(itemTitle)}&url=${Uri.encodeComponent(itemUrl)}');
},
);
},
itemCount: state.res.length,
);
});
final suggestion = Industry.suggestion;
final searchBarPage = SearchBarPage();
class SearchPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// print('suggestion::${Industry.suggestion}');
return Scaffold(
appBar: PreferredSize(
preferredSize: Size(double.infinity, 52), // 44 is the height
child: AppBar(title: searchBarPage)
),
//body: ProgressView(),
body: _industryPage,
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.search),
onPressed: () {
//print('searchBarPage=====>${controller.text}');
//print('searchBarPage=====>${that.getResultsDebounced}');
if(that is _SearchBarPageState && that.getResultsDebounced is Function && controller.text is String ) {
that.getResultsDebounced(controller.text);
}
},
),
);
}
}
/// 加载loading
class ProgressView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox(
width: 24.0,
height: 24.0,
child: CircularProgressIndicator(
strokeWidth: 2.0,
),
),
);
}
}
class SearchBarPage extends StatefulWidget{
@override
State<StatefulWidget> createState() => _SearchBarPageState();
}
final TextEditingController controller = TextEditingController();
var that;
class _SearchBarPageState extends State<SearchBarPage> {
@override
void initState() {
super.initState();
that = this;
}
Timer _resultsTimer;
bool _loading = false;
String oldKey;
/// 防抖函数
Future getResultsDebounced(String text) async {
if(oldKey == text){
print('请求内容重复');
return;
}
if (text == '' || !mounted) {
return;
}
_loading = true;
if (_resultsTimer != null && _resultsTimer.isActive) {
_resultsTimer.cancel();
}
_resultsTimer = new Timer(new Duration(milliseconds: 400), () async {
_loading = true;
if(mounted){
suggestion.dispatch(SuggestionFetch(query: text));
}
oldKey = text;
});
}
void onSearchTextChanged(String text){
print('onSearchTextChanged:${text}');
//suggestion.dispatch(SuggestionFetch(query: text));
getResultsDebounced(text);
}
@override
void dispose() {
print('dispose');
suggestion.dispatch(SuggestionClearFetch());
controller.dispose();
super.dispose();
}
Widget build(BuildContext context) {
return Container(
color: Theme.of(context).primaryColor,
//color: Colors.amber,
child: Padding(
//padding: EdgeInsets.only(top: MediaQueryData.fromWindow(window).padding.top,),
padding: EdgeInsets.all(0.0),
child: Container(
//height: 162.0,
child: Padding(
padding: const EdgeInsets.all(6.0),
child: Card(
child: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(width: 5.0,),
Icon(Icons.search, color: Colors.grey,size: 18.0,),
Expanded(
child: Container(
alignment: Alignment.center,
child: TextField(
controller: controller,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 0.0),
hintText: '搜索全局flutter知识库',
hintStyle:TextStyle(fontSize: 12.0),
border: InputBorder.none
),
onChanged: onSearchTextChanged,
),
),
),
IconButton(
icon: Icon(Icons.cancel),
color: Colors.grey,
iconSize: 18.0,
onPressed: () {
controller.clear();
// onSearchTextChanged('');
},
),
],
),
)
)
),
),
),
);
}
}

View File

@ -0,0 +1,125 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_go/components/list_view_item.dart';
import 'package:flutter_go/components/list_refresh.dart' as listComp;
import 'package:flutter_go/components/pagination.dart';
import 'package:flutter_go/views/first_page/first_page_item.dart';
import 'package:flutter_go/components/disclaimer_msg.dart';
import 'package:flutter_go/utils/net_utils.dart';
// ValueKey<String> key;
class SubPage extends StatefulWidget {
@override
SubPageState createState() => SubPageState();
}
class SubPageState extends State<SubPage> with AutomaticKeepAliveClientMixin{
Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
Future<bool> _unKnow;
GlobalKey<DisclaimerMsgState> key;
@override
bool get wantKeepAlive => true;
@override
void initState() {
super.initState();
if (key == null) {
key = GlobalKey<DisclaimerMsgState>();
// key = const Key('__RIKEY1__');
//获取sharePre
_unKnow = _prefs.then((SharedPreferences prefs) {
return (prefs.getBool('disclaimer::Boolean') ?? false);
});
/// 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
_unKnow.then((bool value) {
new Future.delayed(const Duration(seconds: 1),(){
if (!value && key.currentState is DisclaimerMsgState && key.currentState.showAlertDialog is Function) {
key.currentState.showAlertDialog(context);
}
});
});
}
}
Future<Map> getIndexListData([Map<String, dynamic> params]) async {
const juejin_flutter = 'https://timeline-merger-ms.juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438';
var pageIndex = (params is Map) ? params['pageIndex'] : 0;
final _param = {'page':pageIndex,'pageSize':20,'sort':'rankIndex'};
var responseList = [];
var pageTotal = 0;
try{
var response = await NetUtils.get(juejin_flutter, params: _param);
responseList = response['d']['entrylist'];
pageTotal = response['d']['total'];
if (!(pageTotal is int) || pageTotal <= 0) {
pageTotal = 0;
}
}catch(e){
}
pageIndex += 1;
List resultList = new List();
for (int i = 0; i < responseList.length; i++) {
try {
FirstPageItem cellData = new FirstPageItem.fromJson(responseList[i]);
resultList.add(cellData);
} catch (e) {
// No specified type, handles all
}
}
Map<String, dynamic> result = {"list":resultList, 'total':pageTotal, 'pageIndex':pageIndex};
return result;
}
Widget makeCard(index,item){
var myTitle = '${item.title}';
var myUsername = '${'👲'}: ${item.username} ';
var codeUrl = '${item.detailUrl}';
return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,);
}
headerView(){
return
Column(
children: <Widget>[
Stack(
//alignment: const FractionalOffset(0.9, 0.1),//方法一
children: <Widget>[
Pagination(),
Positioned(//方法二
top: 10.0,
left: 0.0,
child: DisclaimerMsg(key:key,pWidget:this)
),
]),
SizedBox(height: 1, child:Container(color: Theme.of(context).primaryColor)),
SizedBox(height: 10),
],
);
}
@override
Widget build(BuildContext context) {
super.build(context);
return new Column(
children: <Widget>[
new Expanded(
child: listComp.ListRefresh(getIndexListData,makeCard)
)
]
);
}
}

View File

@ -22,10 +22,7 @@ import 'package:flutter_go/components/search_input.dart';
import 'package:flutter_go/model/search_history.dart';
import 'package:flutter_go/resources/widget_name_to_icon.dart';
import 'package:flutter_go/blocs/industry_main.dart';
//import 'package:flutter_go/blocs/search_widget.dart';
import 'main_page.dart';
import './first_page/main_page.dart';
@ -99,7 +96,9 @@ class _MyHomePageState extends State<AppPage>
});
searchHistoryList
.add(SearchHistory(name: targetName, targetRouter: targetRouter));
print("searchHistoryList ${searchHistoryList.toString()}");
print("searchHistoryList1 ${searchHistoryList.toString()}");
print("searchHistoryList2 ${targetRouter}");
print("searchHistoryList3 ${widgetPoint.name}");
Application.router.navigateTo(context, "$targetRouter");
}
@ -140,8 +139,6 @@ class _MyHomePageState extends State<AppPage>
appBar: renderAppBar(context,widget),
body: new TabBarView(controller: controller, children: <Widget>[
//new FirstPage(),
//new IndustryPage(),
//new SearchWidget(),
MainPage(),
WidgetPage(db),
CollectionPage(),

View File

@ -30,8 +30,7 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
final widget;
final parent;
const FlexibleSpaceBarLessDefault([this.widget, this.parent])
: super();
const FlexibleSpaceBarLessDefault([this.widget, this.parent]) : super();
@override
Widget build(BuildContext context) {
@ -39,7 +38,8 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
height: 300.0,
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
expandedHeight: 150.0,
@ -55,6 +55,13 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
background: Image.network(
"https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350",
fit: BoxFit.cover,
/// 色彩叠加 UI可以理解为两个色彩涂层在图片混合一个色层
// color: Colors.redAccent, //混合的颜色
// colorBlendMode: BlendMode.darken, //混合方式
///图片重复填充容器
// repeat: ImageRepeat.repeat,
)),
),
];
@ -63,6 +70,6 @@ class FlexibleSpaceBarLessDefault extends StatelessWidget {
child: Text("向上提拉 ⬆ 查看效果..."),
),
),
)
);
}}
));
}
}

View File

@ -13,7 +13,6 @@ class GridTileDemo extends StatefulWidget {
class _Demo extends State<GridTileDemo> {
Widget build(BuildContext context) {
return Container(
height: 400,
@ -55,3 +54,34 @@ class _Demo extends State<GridTileDemo> {
);
}
}
class GridViewDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 200,
color: Color(0xffc91b3a),
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
///列数
crossAxisCount: 3,
///列间距
mainAxisSpacing: 10.0,
///横轴距离
crossAxisSpacing: 4.0,
///缩放比例
childAspectRatio: 1.3,),
padding: const EdgeInsets.only(left: 10,right: 10,top: 10),
children: <Widget>[
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover),
],),
);
}
}

View File

@ -49,6 +49,13 @@ const String _Text0 = """
- GridView.extent
""";
const Text1="""
###
> SliverGridDelegateWithFixedCrossAxisCount
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount,实现网格
""";
class Demo extends StatefulWidget {
@ -68,8 +75,10 @@ class _DemoState extends State<Demo> {
_Text0,
GridTileDemo(),
SizedBox(
height: 100.0,
)
height: 10.0,
),
Text1,
GridViewDemo(),
],
docUrl: 'https://docs.flutter.io/flutter/material/GridView-class.html',
);

View File

@ -20,7 +20,9 @@ class DecoratedBoxCreate extends StatelessWidget {
color: const Color(0xff7c94b6),
//设置图片内容
image: DecorationImage(
fit: BoxFit.cover,
///fix:BoxFit.contain: 保持图片的比例,最大程度填充容器 BoxFit.fill:容器被图片完全填充,不在意图片比例,只填充整个容器
///fix:BoxFit.fitWidth图片以宽被完全填充 BoxFit.fix:fixHigth:图片以高度完全填充
fit: BoxFit.cover, //图片填充整个容器,按比例放大,多余部分被裁切
image: ExactAssetImage('assets/images/food01.jpeg')),
//外宽边框,可以不设置
border: Border.all(
@ -77,3 +79,27 @@ class DecoratedBoxCreateShape extends StatelessWidget {
);
}
}
class DecoratedBoxCreateShapes extends StatelessWidget {
DecoratedBoxCreateShapes({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return DecoratedBox(
position: DecorationPosition.background,
decoration: BoxDecoration(
gradient: const LinearGradient(
//渐变效果 线性渐变
colors: [Colors.red, Colors.yellowAccent, Colors.lightGreenAccent]),
// color: const Color(0xff7c94b6),
border: Border.all(
color: Colors.blue.shade50,
width: 5.0,
),
shape: BoxShape.circle,
),
);
}
}

View File

@ -68,6 +68,14 @@ class _DemoState extends State<Demo> {
height: 100.0,
width: 100.0,
child: DecoratedBoxCreateShape(),
),
SizedBox(
height: 10.0,
),
Container(
height: 100.0,
width: 100.0,
child: DecoratedBoxCreateShapes(),
)
],
);

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
/// Author: xiaojia.dxj
/// Date: 2018/11/22
/// Email: xiaojia.dxj@alibaba-inc.com
@ -92,3 +93,34 @@ class RowLayoutCreate extends StatelessWidget {
);
}
}
class RowExpanded extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
////填充数据
Expanded(child: new RaisedButton(
onPressed: (){
},
color: Color(0xfffce4ec),
child:new Text('flutter',style: TextStyle(color: Colors.white),)
),),
Expanded(child: new RaisedButton(
onPressed: (){
},
color: Color(0xfff8bbd0),
child:new Text('Expanded',style: TextStyle(color: Colors.white),)
),),
Expanded(child: new RaisedButton(
onPressed: (){
},
color: Color(0xfff48fb1),
child:new Text('flutter',style: TextStyle(color: Colors.white),)
),),
],
);
}
}

View File

@ -60,6 +60,8 @@ class _DemoState extends State<Demo> {
return Column(
children: <Widget>[
RowLayoutCreate(),
SizedBox(height: 10.0,),
RowExpanded(),
Row(
children: <Widget>[
Expanded(

View File

@ -5,105 +5,91 @@ packages:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
bloc:
dependency: "direct main"
description:
name: bloc
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
city_pickers:
dependency: "direct main"
description:
name: city_pickers
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.16"
version: "0.0.4"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
cookie_jar:
dependency: transitive
description:
name: cookie_jar
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.8"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.17"
event_bus:
dependency: "direct main"
description:
name: event_bus
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1+3"
version: "1.2.0+1"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
fluro:
dependency: "direct main"
description:
name: fluro
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
flutter:
@ -111,18 +97,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.11.1"
flutter_markdown:
dependency: "direct main"
description:
name: flutter_markdown
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
flutter_test:
@ -134,91 +113,77 @@ packages:
dependency: "direct main"
description:
name: flutter_webview_plugin
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
html:
dependency: "direct main"
description:
name: html
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.14.0+2"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12+1"
version: "0.6.0+1"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.7"
lpinyin:
dependency: transitive
description:
name: lpinyin
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
markdown:
dependency: transitive
description:
name: markdown
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.3+1"
version: "0.12.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
version: "1.5.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.21.0"
version: "2.0.3"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
sky_engine:
@ -230,79 +195,79 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.4"
version: "1.5.5"
sqflite:
dependency: "direct main"
description:
name: sqflite
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2+1"
version: "1.1.5"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.8"
version: "2.0.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.2"
version: "0.2.5"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0+3"
version: "5.0.2"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
sdks:
dart: ">=2.1.0 <3.0.0"
flutter: ">=0.5.6 <2.0.0"
dart: ">=2.2.0 <3.0.0"
flutter: ">=1.2.1 <2.0.0"

View File

@ -21,23 +21,20 @@ dependencies:
cupertino_icons: ^0.1.2
event_bus: ^1.0.1
fluro: ^1.3.4
image_picker: ^0.4.10
sqflite: ^0.12.1
image_picker: ^0.6.0+1
sqflite: ^1.1.5
flutter_markdown: ^0.2.0
url_launcher: ^4.0.1
url_launcher: ^5.0.2
# 本地存储、收藏功能
shared_preferences: ^0.4.3
dio: ^1.0.6
flutter_webview_plugin: ^0.3.0+2
flutter_webview_plugin: ^0.3.4
# 日期格式化
intl: 0.15.7
city_pickers: ^0.1.0
firebase_analytics: ^2.0.2+1
city_pickers: ^0.0.1
firebase_analytics: ^1.1.0
#firebase_auth: ^0.8.3 #auth
firebase_core: ^0.3.0 # add dependency for Firebase Core
flutter_bloc: ^0.11.1
bloc: ^0.12.0
html: ^0.14.0+2
firebase_core: ^0.3.4 # add dependency for Firebase Core
dev_dependencies:
flutter_test: