44 |
45 | | Parameters | Type | Description |
46 | | flagState | CountryFlag | Enable (get flag with country name) / Disable (Disable flag) / ShowInDropdownOnly (display flag in dropdown only) |
47 | | layout | Layout | Toggle dropdown layout (Horizontal / Vertical) |
48 | | showStates | Boolean | Enable disable States dropdown (true / false) |
49 | | showCities | Boolean | Enable disable Cities dropdown (true / false) |
50 | | dropdownDecoration | BoxDecoration | Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabledDropdownDecoration) |
51 | | disabledDropdownDecoration | BoxDecoration | Disabled Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabled dropdownDecoration) |
52 | | selectedItemStyle | TextStyle | To change selected item style |
53 | | dropdownHeadingStyle | TextStyle | To change DropdownDialog Heading style |
54 | | dropdownItemStyle | TextStyle | To change DropdownDialog Item style |
55 | | dropdownDialogRadius | double | To change DropdownDialogBox radius |
56 | | searchBarRadius | double | To change search bar radius |
57 | | defaultCountry | CscCountry | To select default country |
58 | | disableCountry | Boolean | Disable country dropdown (Note: use it with default country) |
59 | | countryFilter | List of CscCountry | Show only countries in dropdown that you want |
60 | | countrySearchPlaceholder | String | Placeholder for country search field |
61 | | stateSearchPlaceholder | String | Placeholder for state search field |
62 | | citySearchPlaceholder | String | Placeholder for city search field |
63 | | countryDropdownLabel | String | Label/Title for country dropdown |
64 | | countryDropdownLabel | String | Label/Title for state dropdown |
65 | | countryDropdownLabel | String | Label/Title for city dropdown |
66 |
67 |
68 | ### Example
69 |
70 | ```dart
71 | import 'package:csc_picker/csc_picker.dart';
72 | import 'package:flutter/material.dart';
73 |
74 | /// This is a implementation of the Country State City Picker.
75 | void main() {
76 | runApp(MyApp());
77 | }
78 |
79 | class MyApp extends StatelessWidget {
80 | @override
81 | Widget build(BuildContext context) {
82 | return MaterialApp(
83 | title: 'CSC Picker',
84 | theme: ThemeData(
85 | primarySwatch: Colors.blue,
86 | visualDensity: VisualDensity.adaptivePlatformDensity,
87 | ),
88 | home: MyHomePage(title: 'CSC Picker'),
89 | );
90 | }
91 | }
92 |
93 | class MyHomePage extends StatefulWidget {
94 | MyHomePage({Key key, this.title}) : super(key: key);
95 |
96 | final String title;
97 |
98 | @override
99 | _MyHomePageState createState() => _MyHomePageState();
100 | }
101 |
102 | class _MyHomePageState extends State