-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from leoelstin/master
15 updates on master repo
- Loading branch information
Showing
20 changed files
with
614 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-43 KB
(55%)
images/Simulator Screen Shot - iPhone XR - 2019-02-16 at 19.40.34.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-180 Bytes
(98%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:fancy_bar/fancy_bar.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AnimatedBottomBar extends StatefulWidget { | ||
static String tag = 'animatedBottomBar'; | ||
|
||
@override | ||
_AnimatedBottomBarState createState() => _AnimatedBottomBarState(); | ||
} | ||
|
||
class _AnimatedBottomBarState extends State<AnimatedBottomBar> { | ||
int pos = 0; | ||
|
||
void setItem(int _pos) { | ||
setState(() { | ||
pos = _pos; | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
// Here we take the value from the MyHomePage object that was created by | ||
// the App.build method, and use it to set our appbar title. | ||
title: Text(''), | ||
), | ||
bottomNavigationBar: FancyBottomBar( | ||
type: FancyType.FancyV2, | ||
items: [ | ||
FancyItem( | ||
textColor: Colors.orange, | ||
title: 'Home', | ||
icon: Icon(Icons.home), | ||
), | ||
FancyItem( | ||
textColor: Colors.red, | ||
title: 'Trending', | ||
icon: Icon(Icons.trending_up), | ||
), | ||
FancyItem( | ||
textColor: Colors.green, | ||
title: 'Search', | ||
icon: Icon(Icons.search), | ||
), | ||
FancyItem( | ||
textColor: Colors.brown, | ||
title: 'Settings', | ||
icon: Icon(Icons.settings), | ||
), | ||
], | ||
onItemSelected: (index) { | ||
print(index); | ||
}, | ||
), | ||
body: Center( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
'You have pushed the button this many times:', | ||
), | ||
], | ||
), | ||
), // This trailing comma makes auto-formatting nicer for build methods. | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_widgets/note_app/dto/notes_dto.dart'; | ||
import 'package:flutter_widgets/note_app/service/notes_service.dart'; | ||
|
||
class NotesController { | ||
NotesService _notesService; | ||
|
||
static final NotesController _singleton = NotesController._internal(); | ||
|
||
factory NotesController() { | ||
return _singleton; | ||
} | ||
|
||
NotesController._internal() { | ||
_notesService = NotesService(); | ||
} | ||
|
||
Future<List<NotesDto>> getNotes() async { | ||
try { | ||
String response = await _notesService.getNotes(); | ||
debugPrint(response); | ||
return notesDtoFromJson(response); | ||
} catch (e) { | ||
throw e; | ||
} | ||
} | ||
|
||
Future<String> deleteNote(String noteID) async { | ||
try { | ||
String response = await _notesService.deleteNote(noteID); | ||
debugPrint(response); | ||
return ''; | ||
} catch (e) { | ||
throw e; | ||
} | ||
} | ||
|
||
Future<String> createNotes(String title, String content) async { | ||
try { | ||
Map<String, dynamic> map = { | ||
'title': title, | ||
'content': content, | ||
}; | ||
String response = await _notesService.createNote(map); | ||
debugPrint(response); | ||
return ''; | ||
} catch (e) { | ||
throw e; | ||
} | ||
} | ||
|
||
Future<String> updateNote(String id, String title, String content) async { | ||
try { | ||
Map<String, dynamic> map = { | ||
'title': title, | ||
'content': content, | ||
}; | ||
String response = await _notesService.updateNote(id, map); | ||
debugPrint(response); | ||
return ''; | ||
} catch (e) { | ||
throw e; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// To parse this JSON data, do | ||
// | ||
// final notesDto = notesDtoFromJson(jsonString); | ||
|
||
import 'dart:convert'; | ||
|
||
List<NotesDto> notesDtoFromJson(String str) => | ||
List<NotesDto>.from(json.decode(str).map((x) => NotesDto.fromJson(x))); | ||
|
||
String notesDtoToJson(List<NotesDto> data) => | ||
json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); | ||
|
||
class NotesDto { | ||
String id; | ||
String title; | ||
String content; | ||
DateTime createdAt; | ||
DateTime updatedAt; | ||
int v; | ||
|
||
NotesDto({ | ||
this.id, | ||
this.title, | ||
this.content, | ||
this.createdAt, | ||
this.updatedAt, | ||
this.v, | ||
}); | ||
|
||
factory NotesDto.fromJson(Map<String, dynamic> json) => NotesDto( | ||
id: json["_id"] == null ? null : json["_id"], | ||
title: json["title"] == null ? null : json["title"], | ||
content: json["content"] == null ? null : json["content"], | ||
createdAt: json["createdAt"] == null | ||
? null | ||
: DateTime.parse(json["createdAt"]), | ||
updatedAt: json["updatedAt"] == null | ||
? null | ||
: DateTime.parse(json["updatedAt"]), | ||
v: json["__v"] == null ? null : json["__v"], | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
"_id": id == null ? null : id, | ||
"title": title == null ? null : title, | ||
"content": content == null ? null : content, | ||
"createdAt": createdAt == null ? null : createdAt.toIso8601String(), | ||
"updatedAt": updatedAt == null ? null : updatedAt.toIso8601String(), | ||
"__v": v == null ? null : v, | ||
}; | ||
} |
Oops, something went wrong.