效果图如下:
import 'package:flutter/material.dart';class AddPage extends StatefulWidget {@overrideState createState() {// TODO: implement createStatereturn AddPageState();}
}
class AddPageState extends State{num groupValue = 1;
Widget _topsection(){return Container(child:Row(children: [],),);
}@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(elevation: 0,title: Text('添加信息',style: TextStyle(fontWeight: FontWeight.bold),),centerTitle: true,leading:Icon(Icons.arrow_back_ios),actions: [Container(padding: EdgeInsets.only(top: 13.0,right: 10.0),child: Text('完成',textAlign: TextAlign.center,style: TextStyle(fontSize: 18.0,),),)],),body: Column(children: [_topsection(),Container(child: Column(children: [Row(children: [Radio(groupValue: groupValue,value: 1,onChanged: (value){groupValue=value;setState((){});},),Text('工作计划')],),Row(children: [Radio(value: 2,groupValue: groupValue,onChanged: (value){groupValue=value;setState((){});},),Text('工作计划2')],),Row(children: [Radio(value: 3,groupValue: groupValue,onChanged: (value){groupValue=value;setState((){});},),Text('工作计划3')],),],))],),);}
}