
代码
import 'package:flutter/material.dart';
class PublishPage extends StatefulWidget {
const PublishPage({Key? key}) : super(key: key);
@override
_PublishPageState createState() => _PublishPageState();
}
class _PublishPageState extends State<PublishPage> {
int _part = 1;
int _partGroupValue = 1;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("发布需求"),
),
body: SingleChildScrollView(
child: Column(
children: [
//我是 甲方 乙方
SizedBox(
height: 10,
),
Row(
children: [
SizedBox(
width: 10,
),
Text("我是:"),
Radio(
value: 1,
groupValue: _part,
onChanged: (value) {
debugPrint(value.toString());
setState(() {
this._part = 1;
});
}),
Text("甲方"),
Radio(
value: 2,
groupValue: _part,
onChanged: (value) {
debugPrint(value.toString());
setState(() {
this._part = 2;
});
}),
Text("乙方"),
],
)
],
),
),
);
}
}
?
|