dadata 0.3.0 copy "dadata: ^0.3.0" to clipboard
dadata: ^0.3.0 copied to clipboard

Dadata Suggestions for Dart

example/lib/main.dart

import 'package:flutter/material.dart';

import 'suggestions_screen.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('DadataSuggestions Demo'),
      ),
      body: Center(
        child: Padding(
          padding: EdgeInsets.all(24),
          child: TextFormField(
            decoration: InputDecoration(
              hintText: "Paste Dadata API token and press enter",
            ),
            onFieldSubmitted: (string) {
              Navigator.of(context).push(
                PageRouteBuilder(
                  opaque: false,
                  pageBuilder: (BuildContext context, a, b) {
                    return SuggestionsScreen(token: string);
                  },
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
1
likes
0
pub points
63%
popularity

Publisher

unverified uploader

Dadata Suggestions for Dart

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, json_annotation

More

Packages that depend on dadata