w8ly 0.0.4
w8ly: ^0.0.4 copied to clipboard
A beautiful customizable horizontal weight picker for Flutter
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:w8ly/w8ly.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(useMaterial3: true, brightness: Brightness.light),
home: const DemoScreen(),
);
}
}
class DemoScreen extends StatelessWidget {
const DemoScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFF6F7FB),
body: SafeArea(
child: Column(
children: [
const SizedBox(height: 30),
const Text(
"W8ly Weight Picker",
style: TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
const Text(
"Smooth, customizable & production-ready Flutter widget",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(height: 40),
Expanded(
child: Center(
child: W8lyWeightPicker(
initialWeight: 31,
minWeight: 30,
maxWeight: 120,
unit: 'kg',
activeColor: Colors.blue,
inactiveColor: Colors.grey,
selectedTextStyle: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Colors.black,
),
labelTextStyle: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.black54,
),
onChanged: (weight) {
log('Selected weight: $weight kg');
},
),
),
),
const Padding(
padding: EdgeInsets.only(bottom: 20),
child: Text(
"Drag to select weight",
style: TextStyle(fontSize: 13, color: Colors.grey),
),
),
],
),
),
);
}
}