Giter VIP home page Giter VIP logo

log-alimentar-mobile's Introduction

Bem-vindo ao meu perfil no Github!

Sou um programador apaixonado por aprender e ensinar. Possuo habilidades sólidas em .Net, Node.js e Mensageria, e estou sempre procurando desafios e novas tecnologias para explorar. Recentemente, tenho me interessado por blockchain e web3.

Espero que você encontre algo interessante em meus projeto e sinta-se livre para compartilhar suas opiniões ou sugestões. Obrigado por dar uma olhada no meu perfil!

log-alimentar-mobile's People

Contributors

leo-tavares avatar

Watchers

 avatar  avatar

log-alimentar-mobile's Issues

Error no id dos refeições ao registrar uma nova refeição

Descrição

Ao registrar uma nova refeição recebemos a seguinte menssagem de error:

Warning: Each child in a list should have a unique "key" prop

A stack trace indica que o problema ocorre no component Meals da dashboard page path doc component src/pages/Dashboard/components/Meals/index.tsx

Se em seguida fizermos mais um registro de refeição recebemos a seguinte menssagem

A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

A diferença é que dessa vez é uma menssagem de error.

Como resolver o problema?

Ao que tudo indica o prolema esta no keyExtracor da flatList utilizada no component Meals da Dashboard, para resolver esse problemas será necessário:

  • Otimizar a transformação que ocorre no Meal context que ocorre quando fazemos um "load" da tabela de Meals
  • Revisar árvore de componentes da page Dashboard

Detalhes

Stack trace do warning
Warning: Each child in a list should have a unique "key" prop.

Check the render method of VirtualizedList. See https://fb.me/react-warning-keys for more information.
in CellRenderer (at VirtualizedList.js:900)
in VirtualizedList (at FlatList.js:624)
in FlatList (created by Context.Consumer)
in StyledNativeComponent (created by Styled(FlatList))
in Styled(FlatList) (at Meals/index.tsx:20)
in RCTView (at View.js:34)
in View (created by Context.Consumer)
in StyledNativeComponent (created by Styled(View))
in Styled(View) (at Meals/index.tsx:19)
in Meals (at Dashboard/index.tsx:10)
in RCTView (at View.js:34)
in View (created by Context.Consumer)
in StyledNativeComponent (created by Styled(View))
in Styled(View) (at Dashboard/index.tsx:8)
in Dashboard (at SceneView.tsx:122)
in StaticContainer
in StaticContainer (at SceneView.tsx:115)
in EnsureSingleNavigator (at SceneView.tsx:114)
in SceneView (at useDescriptors.tsx:150)
in RCTView (at View.js:34)
in View (at BottomTabView.tsx:41)
in SceneContent (at BottomTabView.tsx:117)
in RCTView (at View.js:34)
in View (at ResourceSavingScene.tsx:43)
in RCTView (at View.js:34)
in View (at ResourceSavingScene.tsx:26)
in ResourceSavingScene (at BottomTabView.tsx:112)
in RCTView (at View.js:34)
in View (at src/index.native.js:139)
in ScreenContainer (at BottomTabView.tsx:96)
in RCTView (at View.js:34)
in View (at BottomTabView.tsx:95)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:74)
in SafeAreaProvider (at SafeAreaProviderCompat.tsx:42)
in SafeAreaProviderCompat (at BottomTabView.tsx:94)
in BottomTabView (at createBottomTabNavigator.tsx:41)
in BottomTabNavigator (at app.routes.tsx:15)
in AppRoutes (at routes/index.tsx:4)
in routes (at src/index.tsx:10)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:390)
in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
in ThemeProvider (at NavigationContainer.tsx:90)
in ForwardRef(NavigationContainer) (at hooks/index.tsx:13)
in NewMealProvider (at hooks/index.tsx:12)
in MealsProvider (at hooks/index.tsx:11)
in DatabaseProvider (at hooks/index.tsx:10)
in AppProvider (at src/index.tsx:8)
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)

stack trace do error
A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

VirtualizedList trace:
Child (vertical):
listKey: rootList
cellKey: rootList
Parent (vertical):
listKey: rootList
cellKey: rootList
VirtualizedList@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:61599:22
FlatList@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:61087:36
StyledNativeComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:165035:36
RCTView
StyledNativeComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:165035:36
RCTView
CellRenderer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:62816:22
RCTView
RCTScrollView
ScrollView@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:63697:36
ScrollView
VirtualizedList@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:61599:22
FlatList@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:61087:36
StyledNativeComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:165035:36
RCTView
StyledNativeComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:165035:36
Meals@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:175255:41
RCTView
StyledNativeComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:165035:36
Dashboard
StaticContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:128467:17
EnsureSingleNavigator@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:127130:24
SceneView@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:128358:22
RCTView
SceneContent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:153947:25
RCTView
RCTView
ResourceSavingScene@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:154855:36
RCTView
ScreenContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:154315:36
RCTView
RNCSafeAreaProvider
SafeAreaProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:154603:24
SafeAreaProviderCompat@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:154491:24
BottomTabView@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:153976:36
BottomTabNavigator@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:153861:32
AppRoutes
routes
EnsureSingleNavigator@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:127130:24
BaseNavigationContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:126799:28
ThemeProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:130843:21
NavigationContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:130749:26
NewMealProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:153516:24
MealsProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:134190:24
DatabaseProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:102313:24
AppProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:102248:24
App
RCTView
RCTView
AppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:68318:22

Registrar imagem da refeição

No momento já é possível tirar uma foto no processo de criação da nova refeição, entretanto temos que ver a melhor maneira de armazena-la, para ser utilizado no restante da aplicação

Sugestão

Usar o config de base64 e registrar com o watermelonDB

relacionado

#6 #3 #7

registrar uma nova refeição

A ideia é criar um novo context para segmentar os contextos. Hoje já existe um context para as refeições (Meals), reponsável por dentre outras coisas manter as informações com o watermelonDB.
Esse novo context será muito semelhante a um cache, assim que o usuário salvar a refeição as informações do cache serão enviadas para o context Meals para que este armazene em nosso banco de dados.

  • context NewMeal - sem conexão com watermelonDB
  • usar context Meals para armazenar no watermelonDB

persistência de dados com WatermelonDB

Com o desenvolvimento da issue #3 , surgiu a necessidade de implementar a persistência das informação.

Neste app será feito o uso do WatermelonDB.

destaques do watermelonDB

  • Offiline-first
  • Lazy loaded
  • facil integração com react-native
  • suporta typescript

documentação

  • É válido ressaltar que esta lib ainda não possui suporte ao auto-linking, portanto a instalação deve ser feita manualmente.
    android-react-native
    ios-react-native

  • Além das configuração no tsconfig devemos adicionar o @babel/plugin-proposal-decorators

habilitar no arquivo tsconfig.json

    "experimentalDecorators": true,    
    "emitDecoratorMetadata": true,   

react-native-setup

Construção das telas da aplicação

neste momento está sendo feito a construção com o mínimo de estilização. A ideia é termos a estrutura necessária para validar o app

  • Dashboard
  • NewMeal
  • Progress
  • Settings
  • Profile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.