leo-tavares / log-alimentar-mobile Goto Github PK
View Code? Open in Web Editor NEWApp para log de rotinas alimentares feito com react-native
License: MIT License
App para log de rotinas alimentares feito com react-native
License: MIT License
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
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.
É 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,
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.
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.
Ao que tudo indica o prolema esta no keyExtracor da flatList utilizada no component Meals da Dashboard, para resolver esse problemas será necessário:
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)
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
A ideia é simplificar o gerenciamento do estado do app. Em um próximo momento sera integrado o watermelonDB.
ReactJS.org - Context
the-elegant-context-pattern-in-react
how-to-use-react-context-effectively
toptal
A ideia deste componente é permite que o usuário registre uma foto da sua refeição
react-native-image-crop-picker
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.