flutter - 如何仅从一侧 FLUTTER 使上滑面板城市成为圆形
解决方案
我认为这会让你得到你想要的:
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: _title,
home: MyStatelessWidget(),
);
}
}
class MyStatelessWidget extends StatelessWidget {
const MyStatelessWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body:
Stack(
children: [
Center(
child: Container(
height: 300,
width: 300,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(50),
topLeft: Radius.circular(50))),
)),
),
Positioned(
// You can change top and left values based on the layout or device
top: 140,
left: 70,
child: Container(
height: 100,
width: 100,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100)),
child: Column(
children: [
SizedBox(
height: 20,
),
CircleAvatar(
radius: 20,
backgroundImage: NetworkImage(
'https://icon-library.com/images/avatar-icon-images/avatar-icon-images-4.jpg')),
Text('Patrick')
],
)),
),
),
],
),
);
}
}
推荐阅读
- java - 将元素添加到泛型列表
- python - 在 Pandas DataFrame 中查找具有特定特征的句点
- ios - ios 14 未收到 voip 通话通知
- angular - 类型“错误”不匹配签名“(此:Observable<{}>,订阅者:订阅者<{}>):TeardownLogic”
- c++ - 如何使用 devcon 为主机上构建的驱动程序安装驱动程序?
- javascript - React table - 格式化数据以创建 subRows
- regex - 正则表达式 - 如何精确匹配 url 中的 3 个单词?
- javascript - 无法使用 Quokka - 显示意外令牌
- laravel - Laravel 将多个模型的关系合并到一个查询中
- kql - KQL:将数组解包成列