【发布时间】:2022-01-04 08:27:21
【问题描述】:
我想制作卡片单选按钮。 我要制作卡片单选按钮。我要制作卡片单选按钮。 我要制作卡片单选按钮。我要制作卡片单选按钮。 我想制作卡片单选按钮。 我要制作卡片单选按钮。我要制作卡片单选按钮。我要制作卡片单选按钮。我要制作卡片单选按钮。我要制作卡片单选按钮。我要制作卡片单选按钮。我要制作卡片单选按钮。我想要制作卡片单选按钮。
这是我的代码
import 'package:cwc/ui/Home/homePage.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class LandingPage extends StatefulWidget {
const LandingPage({Key? key}) : super(key: key);
@override
_LandingPageState createState() => _LandingPageState();
}
class _LandingPageState extends State<LandingPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/bg.png"),
fit: BoxFit.cover,
),
),
width: double.infinity,
child: SafeArea(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 80,
),
Text(
'Membership Packages',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Text(
'Choose a membership plan to unlock all the features of the CWC Wellness Resource App',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 14,
color: Colors.white,
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 13,
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Container(
decoration: const BoxDecoration(
// borderRadius: BorderRadius.circular(10),
image: DecorationImage(
image: AssetImage("assets/ona.png"),
fit: BoxFit.fill,
),
),
height: 147,
width: MediaQuery.of(context).size.width,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width / 1.75,
color: Colors.transparent,
),
Image.asset(
'assets/onaa.png',
height: 114,
width: 114,
),
],
)),
),
),
const SizedBox(
height: 32,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/onb.png"),
fit: BoxFit.fill,
),
),
height: 147,
width: MediaQuery.of(context).size.width,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width / 1.75,
color: Colors.transparent,
),
Image.asset(
'assets/onbb.png',
height: 114,
width: 114,
),
],
)),
),
const SizedBox(
height: 32,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/onc.png"),
fit: BoxFit.fill,
),
),
height: 147,
width: MediaQuery.of(context).size.width,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width / 1.75,
color: Colors.transparent,
),
Image.asset(
'assets/oncc.png',
height: 114,
width: 114,
),
],
),
),
),
],
),
],
),
),
),
),
bottomNavigationBar: GestureDetector(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
);
},
child: Container(
color: Color(0xff3a99a4),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(60))),
width: double.infinity,
height: 57,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(27, 0, 0, 0),
child: Container(
width: 18,
height: 18,
),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Text(
'Continue',
style: GoogleFonts.poppins(
fontSize: 14,
color: Color(0xFF158998),
fontWeight: FontWeight.w600),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 27, 0),
child: const Icon(
Icons.arrow_right_alt_outlined,
size: 18,
color: Color(0xFF158998),
),
),
],
),
)))));
}
}
但我想要这样。
【问题讨论】:
-
所以你还想通过点击卡片来选择单选按钮?
-
@Diwyansh 是的,我想在卡片上设置单选按钮。
-
我的意思是当用户点击卡片时应该选择单选按钮?
-
@Diwyansh 不,实际上我想要那样的用户界面
标签: flutter flutter-layout flutter-dependencies flutter-animation flutter-test