widget_tray 0.1.2 copy "widget_tray: ^0.1.2" to clipboard
widget_tray: ^0.1.2 copied to clipboard

A Flutter package with a collection of custom widgets to streamline UI design and simplify app development.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'Listtile/listtile_example.dart';
import 'Sidebar/sidebar.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MainScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Custom WidgetTray'),
      ),
      body: Column(
        children: [
          const Text('Example All Wigdet'),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              iconButton(
                  context, Icons.list_outlined, const ExpansionListExample()),
              iconButton(context, Icons.view_sidebar, const SidebarExample()),
            ],
          )
        ],
      ),
    );
  }

  Widget iconButton(BuildContext context, icon, Widget page) {
    return IconButton(
        tooltip: '$page',
        onPressed: () => navigate(context, page),
        icon: Icon(icon));
  }

  void navigate(BuildContext context, page) {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => page,
      ),
    );
  }
}
1
likes
150
points
578
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package with a collection of custom widgets to streamline UI design and simplify app development.

Repository

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on widget_tray