- Nunito font replacing Plus Jakarta Sans - SButton: Stack-based 3D pressable (dark shadow layer + top layer translates on press) - SCard: flat border-based selection, no shadows - SProgressBar: 4px thin bar, animated fill - All screens: white bg, no gradients - Duolingo layout: illustration top zone, content below, sticky button
39 lines
1.0 KiB
Dart
39 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../theme.dart';
|
|
|
|
class SProgressBar extends StatelessWidget {
|
|
final double value; // 0.0 to 1.0
|
|
|
|
const SProgressBar({super.key, required this.value});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
return Stack(
|
|
children: [
|
|
Container(
|
|
height: 4,
|
|
width: constraints.maxWidth,
|
|
decoration: BoxDecoration(
|
|
color: SColors.borderLight,
|
|
borderRadius: BorderRadius.circular(2),
|
|
),
|
|
),
|
|
AnimatedContainer(
|
|
duration: const Duration(milliseconds: 300),
|
|
curve: Curves.easeOut,
|
|
height: 4,
|
|
width: constraints.maxWidth * value.clamp(0.0, 1.0),
|
|
decoration: BoxDecoration(
|
|
color: SColors.primary,
|
|
borderRadius: BorderRadius.circular(2),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|