Skip to content

Commit

Permalink
自动填充
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Jun 28, 2020
1 parent 0e92dab commit 1e6a28b
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 77 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ lib/generated_plugin_registrant.dart
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# Key
android/key.jks
android/key.properties
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.2] - 2020-06-28

### Added

- 登陆时可自动填写用户名密码

## [0.3.1] - 2020-03-26

### Fixed
Expand Down Expand Up @@ -76,8 +82,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- 利用 Flutter 编写的第一个可用的智慧家庭客户端

[Unreleased]: https://github.com/he0119/smart-home-flutter/compare/v0.3.1...HEAD
[Unreleased]: https://github.com/he0119/smart-home-flutter/compare/v0.3.2...HEAD

[0.3.2]: https://github.com/he0119/smart-home-flutter/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/he0119/smart-home-flutter/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/he0119/smart-home-flutter/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/he0119/smart-home-flutter/compare/v0.2.1...v0.2.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

## Requirements

- Flutter (Channel beta, v1.14.6)
- Flutter (Channel dev, 1.20.0-2.0.pre)

## Setup

启用 Web 功能

```shell
flutter channel beta
flutter channel dev
flutter upgrade
flutter config --enable-web
```
Expand Down
19 changes: 14 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ trigger:
- refs/tags/*

variables:
flutter_version: '1.17.0-dev.3.1'
flutter_channel: 'dev'
flutter_version: '1.20.0-2.0.pre'

pool:
vmImage: 'macOS-latest'
Expand All @@ -15,11 +16,19 @@ jobs:
steps:
- task: Install-Flutter@0
inputs:
channel: beta
channel: $(flutter_channel)
version: custom
customVersion: $(flutter_version)
- script: flutter test
- script: |
flutter pub get
flutter test --machine > example.jsonl
flutter pub global activate junitreport
flutter pub global run junitreport:tojunit --input example.jsonl --output TEST-report.xml
displayName: 'Flutter Test'
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/TEST-*.xml"
condition: succeededOrFailed()

- job: Android
dependsOn: Test
Expand All @@ -41,7 +50,7 @@ jobs:
displayName: 'InstallingKey'
- task: Install-Flutter@0
inputs:
channel: beta
channel: $(flutter_channel)
version: custom
customVersion: $(flutter_version)
- script: flutter build apk --split-per-abi -t ./lib/main_prod.dart
Expand All @@ -58,7 +67,7 @@ jobs:
steps:
- task: Install-Flutter@0
inputs:
channel: beta
channel: $(flutter_channel)
version: custom
customVersion: $(flutter_version)
- script: flutter config --enable-web
Expand Down
2 changes: 1 addition & 1 deletion lib/main_dev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
var configuredApp = AppConfig(
appName: '智慧家庭 DEV',
flavorName: 'development',
apiUrl: 'http://118.24.9.142:8000/graphql',
apiUrl: 'http://192.168.31.12:8000/graphql',
child: MyApp(),
);
runApp(configuredApp);
Expand Down
48 changes: 26 additions & 22 deletions lib/widgets/login_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,32 @@ class _LoginFormState extends State<LoginForm> {
return Padding(
padding: const EdgeInsets.all(20.0),
child: Form(
child: Column(
children: [
TextFormField(
decoration: InputDecoration(labelText: '用户名'),
controller: _usernameController,
),
TextFormField(
decoration: InputDecoration(labelText: '密码'),
controller: _passwordController,
obscureText: true,
),
RaisedButton(
onPressed:
state is! Authenticating ? _onLoginButtonPressed : null,
child: Text('登录'),
),
Container(
child: state is Authenticating
? CircularProgressIndicator()
: null,
),
],
child: AutofillGroup(
child: Column(
children: [
TextFormField(
decoration: InputDecoration(labelText: '用户名'),
controller: _usernameController,
autofillHints: <String>[AutofillHints.username],
),
TextFormField(
decoration: InputDecoration(labelText: '密码'),
controller: _passwordController,
obscureText: true,
autofillHints: <String>[AutofillHints.password],
),
RaisedButton(
onPressed:
state is! Authenticating ? _onLoginButtonPressed : null,
child: Text('登录'),
),
Container(
child: state is Authenticating
? CircularProgressIndicator()
: null,
),
],
),
),
),
);
Expand Down
76 changes: 31 additions & 45 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
version: "4.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.39.4"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.13"
version: "0.39.10"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -113,6 +106,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.0.9"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
charcode:
dependency: transitive
description:
Expand All @@ -127,6 +127,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
code_builder:
dependency: transitive
description:
Expand All @@ -140,7 +147,7 @@ packages:
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.12"
version: "1.14.13"
connectivity:
dependency: transitive
description:
Expand Down Expand Up @@ -225,6 +232,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
fixnum:
dependency: transitive
description:
Expand Down Expand Up @@ -329,13 +343,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.3"
image:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.12"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -384,7 +391,7 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
version: "0.12.8"
meta:
dependency: transitive
description:
Expand All @@ -406,13 +413,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.1"
multi_server_socket:
dependency: transitive
description:
name: multi_server_socket
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -447,7 +447,7 @@ packages:
name: package_config
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.1"
version: "1.9.3"
package_info:
dependency: "direct main"
description:
Expand All @@ -468,7 +468,7 @@ packages:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
version: "1.7.0"
path_provider:
dependency: transitive
description:
Expand All @@ -483,13 +483,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -690,21 +683,21 @@ packages:
name: test
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.2"
version: "1.15.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.15"
version: "0.2.17"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.3"
version: "0.3.9"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -810,13 +803,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.19+9"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.6.1"
yaml:
dependency: transitive
description:
Expand All @@ -825,5 +811,5 @@ packages:
source: hosted
version: "2.2.0"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: smart_home
description: 智慧家庭
version: 0.3.1+2
version: 0.3.2+2
homepage: https://github.com/he0119/smart-home-flutter

environment:
Expand Down

0 comments on commit 1e6a28b

Please sign in to comment.