simple_phone_countries 1.0.3 copy "simple_phone_countries: ^1.0.3" to clipboard
simple_phone_countries: ^1.0.3 copied to clipboard

A simple, synchronous Flutter package for phone country codes, dial codes, and SVG country flags

example/lib/main.dart

import 'package:example/country_list_tab.dart';
import 'package:example/country_phone_detect_tab.dart';
import 'package:example/country_search_tab.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Simple Phone Countries Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage>
    with SingleTickerProviderStateMixin {
  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Simple Phone Countries'),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        bottom: TabBar(
          controller: _tabController,
          tabs: const [
            Tab(icon: Icon(Icons.list), text: 'Countries'),
            Tab(icon: Icon(Icons.search), text: 'Search'),
            Tab(icon: Icon(Icons.phone), text: 'Detect'),
          ],
        ),
      ),
      body: TabBarView(
        controller: _tabController,
        children: [
          const CountryListTab(),
          const CountrySearchTab(),
          const CountryPhoneDetectTab(),
        ],
      ),
    );
  }
}
6
likes
160
points
137
downloads

Publisher

verified publisherkrisna.codes

Weekly Downloads

A simple, synchronous Flutter package for phone country codes, dial codes, and SVG country flags

Repository (GitHub)
View/report issues

Topics

#phone #country #dial-code #flags #country-picker

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on simple_phone_countries