Code Monkey home page Code Monkey logo

faq's Introduction

FAQ widget (Frequently asked questions)

The FAQ is the most commonly used widget all over customer-facing projects.

Installing

Use this package as a library.

  1. Check the latest version. Depend on it. Add this to your pubspec.yaml file:
dependencies:
  faq: ^0.0.4
  1. Install it You can install packages from the command line:
with pub:
$ dart pub get

with Flutter:
$ flutter pub get

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for dart documents.

  1. Import it Now in your Dart code:
import 'package:faq/faq.dart';

How do I use them?

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            faqList(
              title: 'Expandable List demo',
              data: _generateData(),
            )
          ],
        ),
      ),
    );
  }

  List<List<String>> _generateData() {
    int numberOfGroups = 5;
    List<List<String>> results = List<List<String>>();
    for (int i = 0; i < numberOfGroups; i++) {
      // List<String> items = List<String>();
      // for (int j = 0; j < 1; j++) {
      //   items.add("Item $j in group $i");
      // }
      results.add([
        "Everything’s a widget in Flutter… so wouldn’t it be nice to know how to make your own? There are several methods to create custom widgets, but the most basic is to combine simple existing widgets into the more complex widget that you want. This is called composition."
      ]);
    }
    return results;
  }
}

Author

faq's People

Contributors

samnindersingh avatar shw2ypro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.