gandalf_widgets 1.0.0
gandalf_widgets: ^1.0.0 copied to clipboard
Geliştirici dostu, özelleştirilebilir Flutter widget kütüphanesi.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:gandalf_widgets/gandalf_widgets.dart';
void main() => runApp(const MyWidgetsDemo());
class MyWidgetsDemo extends StatelessWidget {
const MyWidgetsDemo({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Gandalf Widgets Demo',
theme: ThemeData(primarySwatch: Colors.indigo),
home: const DemoHomePage(),
);
}
}
class DemoHomePage extends StatefulWidget {
const DemoHomePage({super.key});
@override
State<DemoHomePage> createState() => _DemoHomePageState();
}
class _DemoHomePageState extends State<DemoHomePage> {
final controller = TextEditingController();
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const CustomAppBar(title: 'Demo'),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
GradientButton(
label: 'Gradient Button',
width: double.infinity,
height: 48,
borderRadius: 12,
onPressed: () => showDialog(
context: context,
builder: (_) => CustomDialog(
title: 'Başarılı',
content: 'İşlem tamamlandı.',
onConfirm: () => Navigator.pop(context),
),
),
),
const SizedBox(height: 16),
const CustomShimmer(width: double.infinity, height: 20),
const SizedBox(height: 16),
CustomTextFieldWidget(
controller: controller,
hintText: 'Adınızı girin',
prefixIcon: Icons.person,
keyboardType: TextInputType.name,
obscureText: false,
),
const SizedBox(height: 16),
LoadingButton(
label: 'Kaydet',
width: double.infinity,
height: 48,
borderRadius: 12,
onPressed: () async {
await Future.delayed(const Duration(seconds: 2));
},
),
const SizedBox(height: 16),
const CustomCard(
title: 'Kart Başlığı',
subtitle: 'Alt bilgi',
icon: Icons.info,
),
],
),
);
}
}