flutter_widget_catalogue 1.1.3+3 copy "flutter_widget_catalogue: ^1.1.3+3" to clipboard
flutter_widget_catalogue: ^1.1.3+3 copied to clipboard

Create awesome apps very faster with Flutter's collection of visual, structural, platform, UI and interactive widgets.

example/lib/main.dart

import 'package:example/Neumorphic/Module/widgets/widgets_home.dart';
import 'package:flutter/material.dart';
import 'Switch/switch.dart';
import 'Button/buttons.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

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

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  List items = [
    'Button',
    "Neumorphic Container Widgets",
    "Switch",
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.cyan,
        title: Text(
          widget.title,
          style: const TextStyle(color: Colors.white),
        ),
      ),
      body: Container(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 5),
        child: ListView.builder(
            itemCount: items.length,
            itemBuilder: (BuildContext context, int index) {
              return GestureDetector(
                onTap: () {
                  if (index == 0) {
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) => const Buttons()),
                    );
                  } else if (index == 1) {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) => const WidgetsHome()),
                    );
                  } else if (index == 2) {
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) => const MySwitch()),
                    );
                  }
                },
                child: Padding(
                  padding: const EdgeInsets.only(top: 15),
                  child: listItem(items[index], index),
                ),
              );
            }),
      ),
    );
  }
}

Widget listItem(String title, int index) {
  return Container(
    height: 50,
    width: double.infinity,
    padding: const EdgeInsets.symmetric(vertical: 13),
    decoration: BoxDecoration(
        color: Colors.cyan,
        border: Border.all(
          color: Colors.white,
        ),
        borderRadius: const BorderRadius.all(Radius.circular(10))),
    child: Text(title,
        textAlign: TextAlign.center,
        style: const TextStyle(
            color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w700)),
  );
}
21
likes
150
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

Create awesome apps very faster with Flutter's collection of visual, structural, platform, UI and interactive widgets.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

cupertino_icons, flutter, font_awesome_flutter

More

Packages that depend on flutter_widget_catalogue