我遇到了麻烦,我在iTunes连接中做了一个测试订阅组,但现在我无法删除它.有没有办法删除它?
我在 state 类中有一个方法,但我需要使用它的小部件类引用在外部访问该方法,
class TestFormState extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _testState();
}
}
class _testFormState extends State<TestFormState> {
int count = 1;
@override
Widget build(BuildContext context) {
return Center(
child: Container(
color: Colors.green,
child: Text("Count : $count"),
),
);
}
clickIncrease(){
setState(() { count += 1; });
}
}
Run Code Online (Sandbox Code Playgroud)
我需要在另一个小部件中访问上述小部件的 clickIncrease,如下面的代码,
class TutorialHome extends StatelessWidget {
TestFormState test;
@override
Widget build(BuildContext context) {
// Scaffold is a layout for the major Material Components.
return Scaffold(
body: Column( …Run Code Online (Sandbox Code Playgroud) 我尝试使用 flutter 创建登录屏幕,在那里我添加了记住我复选框,但我无法正确对齐它,
Flutter 复选框在自身周围占用了不需要的空间,以提供良好的触摸用户体验。
这是我的布局显示的方式,
检查下面的代码,
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Row(
children: <Widget>[
new Checkbox(
activeColor: Colors.grey,
value: _isChecked,
onChanged: (bool value) {
_onChecked(value);
},
),
new GestureDetector(
onTap: () => print("Remember me"),
child: new Text(
"Remember me",
style: new TextStyle(color: Colors.white70),
),
)
],
),
new Text(
"Forgot password ?",
style: new TextStyle(color: Colors.white70),
)
],
),
Run Code Online (Sandbox Code Playgroud)