flutter_widget_catalogue 1.1.2+5 copy "flutter_widget_catalogue: ^1.1.2+5" to clipboard
flutter_widget_catalogue: ^1.1.2+5 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/Container/Module/widgets/widgets_home.dart';
import 'package:flutter/material.dart';

import 'Button/buttons.dart';

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

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

  // This widget is the root of your application.
  @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",
    "Slider",
    "Text Field",
    "Segment"
  ];

  @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()),
                    );
                  }
                },
                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
0
pub points
14%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter, font_awesome_flutter

More

Packages that depend on flutter_widget_catalogue