vk_custom_widgets 1.0.0 copy "vk_custom_widgets: ^1.0.0" to clipboard
vk_custom_widgets: ^1.0.0 copied to clipboard

A package containing most used custom widgets like - custom elevated buttons, password text form fields etc.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:vk_custom_widgets/vk_custom_widgets.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Vk Custom Widgets Example',
      theme: ThemeData(primarySwatch: Colors.blue, useMaterial3: true),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _textController = TextEditingController();
  final TextEditingController _passwordController = TextEditingController();
  String _selectedItem = 'Item 1';

  final List<DropdownMenuItem<String>> _dropdownItems = [
    const DropdownMenuItem(value: 'Item 1', child: Text('Item 1')),
    const DropdownMenuItem(value: 'Item 2', child: Text('Item 2')),
    const DropdownMenuItem(value: 'Item 3', child: Text('Item 3')),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Vk Custom Widgets Example')),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const Text(
              'Buttons',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 10),
            VkElevatedButton(
              label: 'Default Button',
              onPressed: () {
                debugPrint('Default Button Pressed');
              },
            ),
            const SizedBox(height: 10),
            VkElevatedButton(
              label: 'Custom Style Button',
              backgroundColor: Colors.deepPurple,
              borderRadius: 10,
              onPressed: () {
                debugPrint('Custom Button Pressed');
              },
            ),
            const SizedBox(height: 30),
            const Text(
              'Form Fields',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 10),
            VkTextFormField(
              controller: _textController,
              label: 'Text Field',
              onChanged: (value) {
                debugPrint('Text changed: $value');
              },
            ),
            const SizedBox(height: 10),
            VkPasswordFormField(
              controller: _passwordController,
              label: 'Password Field',
            ),
            const SizedBox(height: 30),
            const Text(
              'Dropdown',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 10),
            VkDropdown<String>(
              dropdownList: _dropdownItems,
              value: _selectedItem,
              label: 'Select an Item',
              onChanged: (value) {
                if (value != null) {
                  setState(() {
                    _selectedItem = value;
                  });
                }
              },
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
160
points
164
downloads

Publisher

unverified uploader

Weekly Downloads

A package containing most used custom widgets like - custom elevated buttons, password text form fields etc.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on vk_custom_widgets