migrate: material 3

This commit is contained in:
lollipopkit
2023-05-07 01:28:51 +08:00
parent e932241df0
commit 5afa543ba5
29 changed files with 438 additions and 480 deletions

View File

@@ -13,7 +13,8 @@ class CardDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
contentPadding: padding ?? const EdgeInsets.fromLTRB(24, 17, 24, 7),
contentPadding: padding,
actionsPadding: const EdgeInsets.all(7),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),

View File

@@ -1,13 +1,18 @@
import 'package:flutter/material.dart';
Widget buildPicker(List<Widget> items, Function(int idx) onSelected) {
Widget buildPicker(
List<Widget> items,
Function(int idx) onSelected, {
double height = 157,
}) {
final pad = (height - 37) / 2;
return SizedBox(
height: 111,
height: height,
child: Stack(
children: [
Positioned(
top: 36,
bottom: 36,
top: pad,
bottom: pad,
left: 0,
right: 0,
child: Container(
@@ -20,7 +25,7 @@ Widget buildPicker(List<Widget> items, Function(int idx) onSelected) {
),
ListWheelScrollView.useDelegate(
itemExtent: 37,
diameterRatio: 1.2,
diameterRatio: 2.7,
controller: FixedExtentScrollController(initialItem: 0),
onSelectedItemChanged: (idx) => onSelected(idx),
physics: const FixedExtentScrollPhysics(),

View File

@@ -1,16 +1,20 @@
import 'package:flutter/material.dart';
class RoundRectCard extends StatelessWidget {
const RoundRectCard(this.child, {Key? key}) : super(key: key);
const RoundRectCard(this.child, {Key? key, this.color}) : super(key: key);
final Widget child;
final Color? color;
@override
Widget build(BuildContext context) {
return Card(
key: key,
clipBehavior: Clip.antiAlias,
color: color,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(17))),
borderRadius: BorderRadius.all(Radius.circular(17)),
),
child: child,
);
}