forked from lxm_tools/flutter-picgo
styles:improve class name and package
This commit is contained in:
@@ -4,7 +4,8 @@ import 'package:flutter_picgo/model/config.dart';
|
||||
import 'package:flutter_picgo/utils/image_upload.dart';
|
||||
import 'package:flutter_picgo/utils/strings.dart';
|
||||
|
||||
abstract class ConfigPageState<T extends StatefulWidget> extends State<T> {
|
||||
abstract class BasePBSettingPageState<T extends StatefulWidget>
|
||||
extends State<T> {
|
||||
List<TextEditingController> controllers = [];
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
@@ -3,15 +3,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_picgo/model/config.dart';
|
||||
import 'package:flutter_picgo/model/qiniu_config.dart';
|
||||
import 'package:flutter_picgo/resources/pb_type_keys.dart';
|
||||
import 'package:flutter_picgo/views/config_page/config_page.dart';
|
||||
import 'package:flutter_picgo/views/pb_setting_page/base_pb_page_state.dart';
|
||||
import 'package:flutter_picgo/views/pb_setting_page/qiniu_page/qiniu_page_presenter.dart';
|
||||
|
||||
class QiniuPage extends StatefulWidget {
|
||||
_QiniuPageState createState() => _QiniuPageState();
|
||||
}
|
||||
|
||||
class _QiniuPageState extends ConfigPageState<QiniuPage> implements QiniuPageContract {
|
||||
|
||||
class _QiniuPageState extends BasePBSettingPageState<QiniuPage>
|
||||
implements QiniuPageContract {
|
||||
QiniuPagePresenter _presenter;
|
||||
|
||||
_QiniuPageState() {
|
||||
@@ -28,15 +28,13 @@ class _QiniuPageState extends ConfigPageState<QiniuPage> implements QiniuPageCon
|
||||
String get pbType => PBTypeKeys.qiniu;
|
||||
|
||||
@override
|
||||
void save() {
|
||||
|
||||
}
|
||||
void save() {}
|
||||
|
||||
@override
|
||||
AppBar get appbar => AppBar(
|
||||
title: Text('七牛图床'),
|
||||
centerTitle: true,
|
||||
);
|
||||
title: Text('七牛图床'),
|
||||
centerTitle: true,
|
||||
);
|
||||
|
||||
@override
|
||||
loadConfig(QiniuConfig config) {
|
||||
@@ -45,49 +43,38 @@ class _QiniuPageState extends ConfigPageState<QiniuPage> implements QiniuPageCon
|
||||
Config config;
|
||||
if (key == 'accessKey') {
|
||||
config = Config(
|
||||
label: '设定AccessKey',
|
||||
placeholder: 'AccessKey',
|
||||
needValidate: true,
|
||||
value: value
|
||||
);
|
||||
label: '设定AccessKey',
|
||||
placeholder: 'AccessKey',
|
||||
needValidate: true,
|
||||
value: value);
|
||||
} else if (key == 'secretKey') {
|
||||
config = Config(
|
||||
label: '设定SecretKey',
|
||||
placeholder: 'SecretKey',
|
||||
needValidate: true,
|
||||
value: value
|
||||
);
|
||||
label: '设定SecretKey',
|
||||
placeholder: 'SecretKey',
|
||||
needValidate: true,
|
||||
value: value);
|
||||
} else if (key == 'bucket') {
|
||||
config = Config(
|
||||
label: '设定存储空间名',
|
||||
placeholder: 'Bucket',
|
||||
needValidate: true,
|
||||
value: value
|
||||
);
|
||||
label: '设定存储空间名',
|
||||
placeholder: 'Bucket',
|
||||
needValidate: true,
|
||||
value: value);
|
||||
} else if (key == 'url') {
|
||||
config = Config(
|
||||
label: '设定访问网址',
|
||||
placeholder: '例如:http://xxx.yyy.cloudcdn.cn',
|
||||
needValidate: true,
|
||||
value: value
|
||||
);
|
||||
label: '设定访问网址',
|
||||
placeholder: '例如:http://xxx.yyy.cloudcdn.cn',
|
||||
needValidate: true,
|
||||
value: value);
|
||||
} else if (key == 'area') {
|
||||
config = Config(
|
||||
label: '确认存储区域',
|
||||
placeholder: '例如z0',
|
||||
needValidate: true,
|
||||
value: value
|
||||
);
|
||||
label: '确认存储区域',
|
||||
placeholder: '例如z0',
|
||||
needValidate: true,
|
||||
value: value);
|
||||
} else if (key == 'options') {
|
||||
config = Config(
|
||||
label: '设定网址后缀',
|
||||
placeholder: '例如?imageslim'
|
||||
);
|
||||
config = Config(label: '设定网址后缀', placeholder: '例如?imageslim');
|
||||
} else if (key == 'path') {
|
||||
config = Config(
|
||||
label: '指定存储路径',
|
||||
placeholder: '例如img/'
|
||||
);
|
||||
config = Config(label: '指定存储路径', placeholder: '例如img/');
|
||||
}
|
||||
config.name = key;
|
||||
configs.add(config);
|
||||
|
||||
Reference in New Issue
Block a user