Refactor ExampleApp theme and background color; enhance slider with divisions and labels
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -16,10 +16,6 @@ class ExampleApp extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: ThemeData(
|
|
||||||
useMaterial3: true,
|
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF24A6A8)),
|
|
||||||
),
|
|
||||||
home: const ExampleHome(),
|
home: const ExampleHome(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -83,7 +79,6 @@ class _ExampleHomeState extends State<ExampleHome> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: const Color(0xFF0D121A),
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('holo_shiny example'),
|
title: const Text('holo_shiny example'),
|
||||||
),
|
),
|
||||||
@@ -253,6 +248,8 @@ class _LabeledSlider extends StatelessWidget {
|
|||||||
Text('$label: ${value.toStringAsFixed(2)}'),
|
Text('$label: ${value.toStringAsFixed(2)}'),
|
||||||
Slider(
|
Slider(
|
||||||
value: value,
|
value: value,
|
||||||
|
divisions: 20,
|
||||||
|
label: value.toStringAsFixed(2),
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ void main() {
|
|||||||
expect(shinyCard.sparkleShape.primary, 0.0);
|
expect(shinyCard.sparkleShape.primary, 0.0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('default opacity is 1.0', () {
|
||||||
|
const Shiny shiny = Shiny(child: SizedBox.shrink());
|
||||||
|
const ShinyCard shinyCard = ShinyCard();
|
||||||
|
|
||||||
|
expect(shiny.opacity, 1.0);
|
||||||
|
expect(shinyCard.opacity, 1.0);
|
||||||
|
});
|
||||||
|
|
||||||
test('custom sparkle factories produce expected specs', () {
|
test('custom sparkle factories produce expected specs', () {
|
||||||
final SparkleShapeSpec star =
|
final SparkleShapeSpec star =
|
||||||
SparkleShapeSpec.customStar(points: 7, innerRatio: 0.33);
|
SparkleShapeSpec.customStar(points: 7, innerRatio: 0.33);
|
||||||
|
|||||||
Reference in New Issue
Block a user