Skip to content

Instantly share code, notes, and snippets.

View Vanns35's full-sized avatar
🎯
Focusing

Vandana Ghadge Vanns35

🎯
Focusing
View GitHub Profile
@Vanns35
Vanns35 / App.js
Created August 1, 2020 09:22
React Native Custom Multi Selector - Step 1
import React, { Component } from 'react';
import { Text, View, StyleSheet, Modal, CheckBox, TouchableOpacity, ScrollView, Dimensions, Image } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
// import Ionicons from 'react-native-vector-icons/Ionicons';
const BannerWidth = Dimensions.get('window').width - 20;
class MultiSelector extends Component {
constructor(props) {
super(props);
@Vanns35
Vanns35 / App.js
Last active August 1, 2020 09:26
React Native Custom Multi Selector - Step 2
class MultiSelector extends Component {
constructor(props) {
super(props);
this.state = {
MultiSelectPopup: false,
PokemonList : [{
id: '1',
Choose: false,
Name: 'Pikachu',
Avatar: 'https://assets.pokemon.com/assets/cms2/img/pokedex/full/025.png'
@Vanns35
Vanns35 / App.js
Created August 1, 2020 09:28
React Native Custom Multi Selector - Step 3
selectPokemon(item) {
if (!item.Choose) {
const newArray = [...this.state.PokemonList];
const replaceArray = {
id: item.id,
Name: item.Name,
Avatar: item.Avatar,
Choose: !item.Choose
};
newArray.splice(newArray.findIndex(ele => ele.id === item.id), 1, replaceArray);
{ this.state.SavedPokemon.length > 0 ?
<View style={{ marginTop: 5 }}>
<Text style={styles.selectListTitle}>Your Pokemon List</Text>
<ScrollView>
<View style={styles.cardView}>
{ this.state.SavedPokemon.map(item => (
<View style={styles.cardMain}>
<Image
style={styles.pokeImage}
source={{ uri: item.Avatar }}
@Vanns35
Vanns35 / App.js
Created August 1, 2020 10:47
React Native Custom Multi Selector - Step 4
{ this.state.SavedPokemon.length > 0 ?
<View style={{ marginTop: 5 }}>
<Text style={styles.selectListTitle}>Your Pokemon List</Text>
<ScrollView>
<View style={styles.cardView}>
{ this.state.SavedPokemon.map(item => (
<View style={styles.cardMain}>
<Image
style={styles.pokeImage}
source={{ uri: item.Avatar }}
@Vanns35
Vanns35 / App.js
Created August 1, 2020 10:49
React Native Custom Multi Selector - Final Code
import React, { Component } from 'react';
import { Text, View, StyleSheet, Modal, CheckBox, TouchableOpacity, ScrollView, Dimensions, Image } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
// import Ionicons from 'react-native-vector-icons/Ionicons';
const BannerWidth = Dimensions.get('window').width - 20;
class MultiSelector extends Component {
constructor(props) {
super(props);
@Vanns35
Vanns35 / main.dart
Last active November 24, 2023 07:57
windy-waterfall-5497
void main() {
int quantityModelX = 8;
double priceModelX = 50000.00;
int quantityModelZ = 10;
double priceModelZ = 60000.00;
String customerAccountNo = "1025496";
double customerAccountBalance = 80000.00;
String model = "Model-X";
int shippingDistance = 25;