first commit
This commit is contained in:
commit
39e38f931f
382 changed files with 520450 additions and 0 deletions
140
lib/widgets/daily_blob.dart
Normal file
140
lib/widgets/daily_blob.dart
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
import 'package:blobs/blobs.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Dailyblob extends StatelessWidget {
|
||||
Dailyblob(this.temperatur, {super.key});
|
||||
|
||||
int temperatur;
|
||||
Color mainColor = Color.fromARGB(255, 233, 125, 224);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color blobColor = mainColor.harmonizeWith(Theme.of(context).canvasColor);
|
||||
Color grad1 = Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 0.85).round(),
|
||||
(blobColor.green * 0.85).round(),
|
||||
(blobColor.blue * 0.85).round(),
|
||||
);
|
||||
|
||||
return Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
Blob.animatedFromID(
|
||||
loop: true,
|
||||
duration: Duration(milliseconds: 1300),
|
||||
size: 365,
|
||||
styles: BlobStyles(
|
||||
color: Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 0.8).round(),
|
||||
(blobColor.green * 0.8).round(),
|
||||
(blobColor.blue * 0.8).round(),
|
||||
).harmonizeWith(blobColor)),
|
||||
id: [
|
||||
'6-9-12903',
|
||||
'6-9-438',
|
||||
'6-9-9807',
|
||||
'6-9-18',
|
||||
'6-9-9260',
|
||||
'6-9-12903',
|
||||
'6-9-17311',
|
||||
],
|
||||
),
|
||||
Blob.animatedFromID(
|
||||
loop: true,
|
||||
duration: Duration(milliseconds: 1000),
|
||||
size: 355,
|
||||
styles: BlobStyles(
|
||||
color: Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 0.9).round(),
|
||||
(blobColor.green * 0.9).round(),
|
||||
(blobColor.blue * 0.9).round(),
|
||||
).harmonizeWith(blobColor)),
|
||||
id: const [
|
||||
'6-9-438',
|
||||
'6-9-9807',
|
||||
'6-9-18',
|
||||
'6-9-9260',
|
||||
'6-9-12903',
|
||||
'6-9-17311'
|
||||
],
|
||||
),
|
||||
Blob.animatedFromID(
|
||||
loop: true,
|
||||
duration: Duration(milliseconds: 1500),
|
||||
size: 340,
|
||||
styles: BlobStyles(color: blobColor),
|
||||
id: const [
|
||||
'6-9-17311',
|
||||
'6-9-438',
|
||||
'6-9-9807',
|
||||
'6-9-18',
|
||||
'6-9-9260',
|
||||
'6-9-12903',
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
ShaderMask(
|
||||
blendMode: BlendMode.srcIn,
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: blobColor.computeLuminance() > 0.1
|
||||
? [
|
||||
Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 0.35).round(),
|
||||
(blobColor.green * 0.35).round(),
|
||||
(blobColor.blue * 0.35).round(),
|
||||
),
|
||||
Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 0.5).round(),
|
||||
(blobColor.green * 0.5).round(),
|
||||
(blobColor.blue * 0.5).round(),
|
||||
)
|
||||
]
|
||||
: [
|
||||
Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 2.2).round(),
|
||||
(blobColor.green * 2.2).round(),
|
||||
(blobColor.blue * 2.2).round(),
|
||||
),
|
||||
Color.fromARGB(
|
||||
blobColor.alpha,
|
||||
(blobColor.red * 1.8).round(),
|
||||
(blobColor.green * 1.8).round(),
|
||||
(blobColor.blue * 1.8).round(),
|
||||
),
|
||||
],
|
||||
).createShader(bounds);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"$temperatur °C",
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Farbe",
|
||||
style: TextStyle(
|
||||
fontSize: 45,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in a new issue