पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

GitHub रिपॉज़िटरीmu-dawood/open_location_picker

open_location_picker

OpenStreetMap से एक या अधिक स्थानों का चयन करने के लिए FormField

open_location_picker प्रोजेक्ट कवर
स्टार
13
फ़ोर्क
9
अंतिम पुश (UTC)
20 नव॰ 2023
प्रोजेक्ट स्थिति
सक्रिय

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

FormField to pick one or more locations from open streat map

Features

  • Pick single location
  • Pick multi locations
  • display open street maps
  • can work with bloc pattern
  • respective to dark theme

Getting started

At first you have to put your configration settings

  • handle how you get your current location
  • you can use location or geolocator package or any thing you want
    return OpenMapSettings(
      onError: (context, error) {},
      getCurrentLocation: _getCurrentLocationUsingLocationPackage,
      
      reverseZoom: ReverseZoom.suburb,
      getLocationStream: () => location.onLocationChanged.map((event) => LatLng(event.latitude!, event.longitude!)),
      child: MaterialApp(
        title: 'Flutter Demo',
        locale: const Locale("ar"),
        localizationsDelegates: const [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
          GlobalCupertinoLocalizations.delegate,
        ],
        supportedLocales: const [
          Locale('en', ''), // English, no country code
          Locale('ar', ''), // Spanish, no country code
        ],
        theme: ThemeData.light(),
        darkTheme: ThemeData.dark(),
        themeMode: ThemeMode.dark,
        home: const MyHomePage(title: 'open_location_picker demo'),
      ),
    );

Usage

  • There are 3 ways to this pcakge

OpenMapPicker

    OpenMapPicker(
      decoration: const InputDecoration(hintText: "My location"),
      onSaved: (FormattedLocation? newValue) {
        /// save new value
      },
    ),

MultiOpenMapPicker

    MultiOpenMapPicker(
      decoration: const InputDecoration(hintText: "My  multi location"),
      onSaved: (List<FormattedLocation> newValue) {
        /// save new value
      },
    ),

Custom

  • first create your own bloc
 class CustomBloc extends Cubit<OpenMapState> implements OpenMapBloc {
   CustomBloc(OpenMapState initialState) : super(initialState);
 }
  • second use it
  Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) {
    return OpenStreetMaps(
      options: OpenMapOptions(),
      bloc: CustomBloc(const OpenMapState.selected(SelectedLocation.single(null))),
    );
  }));
    
Mohamed Dawood GitHub avatar
GitHub लेखक

Mohamed Dawood ↗

Full stack developer

भाषाएँDartC++CMakeHTMLRubySwiftCKotlinObjective-C

उपयोग की गई निर्भरताएँ

निर्भरता सूची 9 आइटम

अपने प्रोजेक्ट के लिए रिपॉज़िटरी कैसे चुनें?

उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।

  1. नाम, लेखक या विवरण से खोजें और तकनीकी विषय से परिणाम सीमित करें।
  2. स्टार, फ़ोर्क और हाल के पुश की तुलना करें। स्टार रुचि दर्शाते हैं, गुणवत्ता की गारंटी नहीं।
  3. उपयोग से पहले GitHub पर README, लाइसेंस और Issues जाँचें।

स्रोत और रखरखाव

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗