refactor(widgets): 重构卡片组件的样式
- 统一了卡片的阴影、边框和圆角样式 - 调整了卡片的外边距 - 优化了部分卡片的内边距 - 统一了难度等级的命名方式
This commit is contained in:
parent
4d9a554f0d
commit
6b64d1a0cd
@ -125,6 +125,13 @@ class _GiteaCardState extends State<GiteaCard> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
|
elevation: 4,
|
||||||
|
shadowColor: Colors.deepPurple.withOpacity(0.3),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide(color: Colors.deepPurple.withOpacity(0.1)),
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -101,6 +101,13 @@ class _GithubCardState extends State<GithubCard> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
|
elevation: 4,
|
||||||
|
shadowColor: Colors.deepPurple.withOpacity(0.3),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide(color: Colors.deepPurple.withOpacity(0.1)),
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -119,9 +119,13 @@ class _KodBoxCardState extends State<KodBoxCard> {
|
|||||||
final sourceID = isFileOperation ? _getSourceID(desc) : null;
|
final sourceID = isFileOperation ? _getSourceID(desc) : null;
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 2,
|
elevation: 4,
|
||||||
margin: const EdgeInsets.symmetric(vertical: 6.0),
|
shadowColor: Colors.deepPurple.withOpacity(0.3),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide(color: Colors.deepPurple.withOpacity(0.1)),
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 5.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: sourceID != null ? () => _launchFileUrl(sourceID) : null,
|
onTap: sourceID != null ? () => _launchFileUrl(sourceID) : null,
|
||||||
splashColor: Colors.deepPurple.withAlpha(30),
|
splashColor: Colors.deepPurple.withAlpha(30),
|
||||||
@ -211,9 +215,13 @@ class _KodBoxCardState extends State<KodBoxCard> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
shape: RoundedRectangleBorder(
|
||||||
elevation: 4,
|
borderRadius: BorderRadius.circular(20),
|
||||||
margin: const EdgeInsets.all(16),
|
side: BorderSide(color: Colors.deepPurple.withOpacity(0.15)),
|
||||||
|
),
|
||||||
|
elevation: 6,
|
||||||
|
shadowColor: Colors.deepPurple.withOpacity(0.4),
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -143,11 +143,11 @@ class _LeetCodeCardState extends State<LeetCodeCard>
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
const Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.bar_chart, color: Colors.green),
|
Icon(Icons.bar_chart, color: Colors.green),
|
||||||
const SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
const Text(
|
Text(
|
||||||
'解题进度',
|
'解题进度',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
@ -161,11 +161,11 @@ class _LeetCodeCardState extends State<LeetCodeCard>
|
|||||||
final difficulty = q['difficulty'] as String;
|
final difficulty = q['difficulty'] as String;
|
||||||
final count = q['count'] as int;
|
final count = q['count'] as int;
|
||||||
Color difficultyColor = Colors.grey;
|
Color difficultyColor = Colors.grey;
|
||||||
if (difficulty == 'Easy')
|
if (difficulty == 'EASY')
|
||||||
difficultyColor = Colors.green;
|
difficultyColor = Colors.green;
|
||||||
else if (difficulty == 'Medium')
|
else if (difficulty == 'MEDIUM')
|
||||||
difficultyColor = Colors.orange;
|
difficultyColor = Colors.orange;
|
||||||
else if (difficulty == 'Hard') difficultyColor = Colors.red;
|
else if (difficulty == 'HARD') difficultyColor = Colors.red;
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 6.0),
|
padding: const EdgeInsets.symmetric(vertical: 6.0),
|
||||||
@ -226,9 +226,13 @@ class _LeetCodeCardState extends State<LeetCodeCard>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
margin: const EdgeInsets.all(16),
|
shadowColor: Colors.deepPurple.withOpacity(0.3),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
side: BorderSide(color: Colors.deepPurple.withOpacity(0.1)),
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -332,11 +336,11 @@ class _LeetCodeCardState extends State<LeetCodeCard>
|
|||||||
final question = submission['question'];
|
final question = submission['question'];
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 2,
|
elevation: 3,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(16),
|
||||||
),
|
),
|
||||||
margin: const EdgeInsets.symmetric(vertical: 6),
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: CircleAvatar(
|
leading: CircleAvatar(
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user