nsg_input 0.0.2

Flutter Android iOS web

Component for user selection data with filtration.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:nsg_input/country/nsg_input_country.dart';
import 'package:nsg_input/country/nsg_input_country_item.dart';
import 'package:nsg_input/nsg_input.dart';
import 'package:nsg_input/nsg_input_item.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('NSG'),
      ),
      body: Center(
        child: Column(
          children: [getInput(context), getInputCountry(context)],
        ),
      ),
    );
  }

  Widget getInput(BuildContext context) {
    var list = List<NsgInputItem>();
    list.add(NsgInputItem(name: "English"));
    list.add(NsgInputItem(name: "Russian"));
    list.add(NsgInputItem(name: "Bulgarian"));

    var input = NsgInput(showPicture: false, elements: list);
    return input;
  }

  Widget getInputCountry(BuildContext context) {
    var list = List<NsgInputCountryItem>();
    list.add(NsgInputCountryItem(name: "US"));
    list.add(NsgInputCountryItem(name: "RU"));
    list.add(NsgInputCountryItem(name: "BG"));

    var input = NsgInputCountry(showPicture: true, elements: list);
    return input;
  }
}
1
likes
90
pub points
27%
popularity

Component for user selection data with filtration.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

zenkov25@gmail.com

License

BSD (LICENSE)

Dependencies

cupertino_icons, flutter

More

Packages that depend on nsg_input