我有个人资料表格供用户编辑自己的个人资料.在这种形式,我有当前的密码.必须匹配从seved到数据库.
形成:
{{ Form::password('currPassword', array('id'=>'currPassword')) }}
Run Code Online (Sandbox Code Playgroud)
我想在Controller中使用此功能来检查数据库.
$data = User::find($id);
if( ! Hash::check( $data->password , Input::get('currPassword') ) )
{
return Redirect::to('/admin/profile')
->with('message', 'Current Password Error !')
->withInput();
}
Run Code Online (Sandbox Code Playgroud)
哈希123456密码进入数据库是确定的,并把后123456在currPassword那一定是收益TRUE但回报FALSE始终.
在颤振中,我只是学习了如何Bloc在应用程序上使用,我想尝试使用此功能实现简单的登录。在实现了一些类之后bloc,在视图中使用它
当我尝试使用此代码时出现错误
BlocProvider.of<LoginListingBloc>(context).dispatch(LoginEvent(loginInfoModel: testLogin));
Run Code Online (Sandbox Code Playgroud)
里面 RaisedButton
错误:
BlocProvider.of() 使用不包含 LoginListingBloc 类型的 Bloc 的上下文调用。
我的看法 :
class _HomePageState extends State<HomePage> {
LoginListingBloc _loginListingBloc;
@override
void initState() {
super.initState();
_loginListingBloc =
LoginListingBloc(loginRepository: widget.loginRepository);
}
...
@override
Widget build(BuildContext context) {
return BlocProvider(
bloc: _loginListingBloc,
child: Scaffold(
appBar: AppBar(
elevation: 5.0, title: Text('Sample Code', style: appBarTextStyle)),
body: Center(
child: RaisedButton(
child: Text(
'click here',
style: defaultButtonStyle,
),
onPressed: () {
BlocProvider.of<LoginListingBloc>(context).dispatch(LoginEvent(loginInfoModel: testLogin));
}),
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
LoginListingBloc …
在我想使用的项目中SweepGradient,当我尝试使用此定义时,出现错误:
Context: Found this candidate, but the arguments don't match.
const SweepGradient({
^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
我的代码实现:
static final BoxDecoration _gradientBorderDecoration = BoxDecoration(
shape: BoxShape.circle,
// https://brandpalettes.com/instagram-color-codes/
gradient: SweepGradient(
colors: [
Color(0xFF833AB4), // Purple
Color(0xFFF77737), // Orange
Color(0xFFE1306C), // Red-pink
Color(0xFFC13584), // Red-purple
],
),
);
Run Code Online (Sandbox Code Playgroud)
SweepGradient 构造类:
const SweepGradient({
this.center = Alignment.center,
this.startAngle = 0.0,
this.endAngle = math.pi * 2,
required List<Color> colors,
List<double>? stops,
this.tileMode = TileMode.clamp,
GradientTransform? transform,
}) : assert(center != null),
assert(startAngle != null),
assert(endAngle != …Run Code Online (Sandbox Code Playgroud) 我有WSDL以下格式的网址,似乎是正确的.使用后,wsimport在终端解析,我得到一个错误:
从终端运行:
tux-world@alachiq:~/Desktop/Project/java > wsimport -keep -s wsdl/ example.com/wsdl/wsdl.php?wsdl
parsing WSDL...
[ERROR] "Use of SOAP Encoding is not supported.
SOAP extension element on line 59 in example.com/wsdl/wsdl.php?wsdl has use="encoded" "
Failed to parse the WSDL.
Run Code Online (Sandbox Code Playgroud)
解析的WSDL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:tsmswsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:tsmswsdl">
<types>
<xsd:schema targetNamespace="urn:tsmswsdl"
>
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
<xsd:complexType name="outGetMessages">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
<message name="GetMessagesRequest"> …Run Code Online (Sandbox Code Playgroud) 我怎样才能画这样的半圆?
代码:
class DrawHalfCircleClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
final Path path = new Path();
...
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
return true;
}
Run Code Online (Sandbox Code Playgroud) 使用下面的代码,我试图访问存储在asset/raw文件夹中的文件,但获取null和
E/ERR: file:/android_asset/raw/default_book.txt (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
错误,我的代码是:
private void implementingDefaultBook() {
String filePath = Uri.parse("file:///android_asset/raw/default_book.txt").toString();
File file = new File(filePath);
try {
FileInputStream stream = new FileInputStream(file);
} catch (Exception e) {
e.printStackTrace();
Log.e("ERR ", e.getMessage());
} catch (OutOfMemoryError e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
我下面的代码下载文件工作正常,当没有实现resume,在阅读更多的解决方案来实现和解决问题我知道我必须检查Last-Modified标头并设置它的连接,
但我不能这样做,因为我得到的错误,如android Cannot set request property after connection is made我得到null的httpURLConnection,
我正在使用这个参考
getHeaderField heaser返回:
{
null=[HTTP/1.1 200 OK],
Cache-Control=[public],
Connection=[keep-alive],
Content-Length=[8037404],
Content-Md5=[VEqXHCc/Off7a6D0gRFpiQ==],
Content-Type=[image/jpeg],
Date=[Tue, 19 Jan 2016 07:24:36 GMT],
Etag=["544a971c273f39f7fb6ba0f481116989"],
Expires=[Sat, 29 Jul 2017 10:07:00 GMT],
Last-Modified=[Thu, 18 Dec 2014 08:44:34 GMT],
Server=[bws],
X-Android-Received-Millis=[1501063623576],
X-Android-Response-Source=[NETWORK 200],
X-Android-Selected-Protocol=[http/1.1],
X-Android-Sent-Millis=[1501063623532]
}
Run Code Online (Sandbox Code Playgroud)
现在我该如何设置恢复下载文件?
public void run() {
final URL url;
HttpURLConnection httpURLConnection = null;
try {
try {
url = new URL(mUrl); …Run Code Online (Sandbox Code Playgroud) 在我的应用程序的这一部分中ListView,当我运行应用程序时,出现此错误并且无法解决:
Scaffold(
body: Directionality(
textDirection: TextDirection.rtl,
child: Container(
child: StreamBuilder(
stream: globals.database.ticketsDao.getTicketsStream(),
builder: (BuildContext context, AsyncSnapshot<List<Tickets>> snapshot) {
if (snapshot.hasData) {
return Column(
children: <Widget>[
Expanded(
child: ListView.separated(
itemBuilder: (context, index) {
return ListTile(
title: Flexible(
child: Text(
snapshot.data[index].subject,
style: Theme.of(context).textTheme.caption.copyWith(fontFamily: 'IranSansBold'),
),
),
subtitle: Text(
snapshot.data[index].description,
style: Theme.of(context).textTheme.caption.copyWith(fontFamily: 'IranSansLight'),
),
);
},
separatorBuilder: (context, index) {
return Divider();
},
itemCount: snapshot.data.length),
),
],
);
} else {
return Container(
child: Center(
child: Text(
Strings.notAnyTickets,),
),
));
} …Run Code Online (Sandbox Code Playgroud) 我想DraggableScrollableSheet在我的应用程序上使用小部件,当我使用下面的代码时,可以毫无问题地显示:
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('DraggableScrollableSheet'),
),
body: SizedBox.expand(
child: DraggableScrollableSheet(
builder: (BuildContext context, ScrollController scrollController) {
return Container(
color: Colors.blue[100],
child: ListView.builder(
controller: scrollController,
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
return ListTile(title: Text('Item $index'));
},
),
);
},
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我想通过按例如floatingActionButton不显示来显示时
floatingActionButton: GestureDetector(
child: FloatingActionButton(
child: Icon(
Icons.add,
size: 35.0,
),
elevation: 5,
backgroundColor: Colors.deepOrange,
foregroundColor: Colors.white,
onPressed: …Run Code Online (Sandbox Code Playgroud)