Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ins_note",
"cwd": "ins_note",
"request": "launch",
"type": "dart"
},
{
"name": "ins_note (profile mode)",
"cwd": "ins_note",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "ins_note (release mode)",
"cwd": "ins_note",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
9 changes: 9 additions & 0 deletions ins_note/lib/feed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

class Feed {
final String title;
final String content;
final String location;
// final String icon_location = "/image/location.png";

Feed(this.title, this.content, this.location);
}
87 changes: 87 additions & 0 deletions ins_note/lib/feed_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import 'package:flutter/material.dart';
import '/feed.dart';

class FeedPage extends StatefulWidget {
const FeedPage({Key? key}) : super(key: key);

@override
State<FeedPage> createState() => _FeedPageState();
}

class _FeedPageState extends State<FeedPage> {

static List<String> feedTitle = [
'영감일기',
'김치 장사',
'일기 앱',
'취미 앱',
'번뜩이는 감각',
'구린 음악으로',
'더부룩한 체기를'
];

static List<String> feedContent = [
'홀홀홀',
'이건 대박이다',
'꼭 만들어야지',
'취미 공유 앱',
'돈 되는 장사',
'더부룩한 체기를',
'탄산 right'
];

static List<String> feedLocation = [
'images/location.png',
'images/location.png',
'images/location.png',
'images/location.png',
'images/location.png',
'images/location.png',
'images/location.png',
];

final List<Feed> feedData = List.generate(feedLocation.length, (index) =>
Feed(feedTitle[index], feedContent[index], feedLocation[index]));

@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView.builder(
itemCount: feedData.length,
itemBuilder: (context, index) {
return Card(
child: ListTile(
title: Text(
feedData[index].title
),
subtitle: Text(
feedData[index].content
),
// leading: SizedBox(
// height: 50,
// width: 50,
// child: Image.asset(feedData[index].location)
// ),
),
);
}
)
);
}

// _getListData() {
// List<Widget> widgets = [];
// for (int i = 0; i < 100; i++) {
// widgets.add(GestureDetector(
// child: Padding(
// padding: EdgeInsets.all(10.0),
// child: Text("Row $i")
// ),
// onTap: () {
// // print("row $i tapped");
// }
// ));
// }
// return widgets;
// }
}
41 changes: 21 additions & 20 deletions ins_note/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:flutter/material.dart';
import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
import 'my_page.dart';
import 'feed_page.dart';

void main() => runApp(const BaseExample());
void main() => runApp(const MyApp());

class BaseExample extends StatelessWidget {
const BaseExample({Key? key}) : super(key: key);
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -40,6 +42,19 @@ class _MyHomePageState extends State<MyHomePage>{
super.initState();
}

int _selectedIndex = 0;

final List<Widget> _widgetOptions = <Widget>[
FeedPage(),
MyPage(),
];

void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -66,20 +81,8 @@ class _MyHomePageState extends State<MyHomePage>{
],
),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text(
"Place for your content",
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w900,
),
),
],
),
body: SafeArea(
child: _widgetOptions.elementAt(_selectedIndex),
),
bottomNavigationBar: BottomBarWithSheet(
controller: _bottomBarController,
Expand All @@ -99,7 +102,7 @@ class _MyHomePageState extends State<MyHomePage>{
fontSize: 10.0,
),
),
onSelectItem: (index) => debugPrint('$index'),
onSelectItem: (index) => _onItemTapped(index),
sheetChild: Column(
children: <Widget>[
Padding(
Expand Down Expand Up @@ -162,8 +165,6 @@ class _MyHomePageState extends State<MyHomePage>{
),
items: const [
BottomBarWithSheetItem(icon: Icons.people),
//BottomBarWithSheetItem(icon: Icons.shopping_cart),
//BottomBarWithSheetItem(icon: Icons.settings),
BottomBarWithSheetItem(icon: Icons.favorite),
],
),
Expand Down
20 changes: 20 additions & 0 deletions ins_note/lib/my_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';

class MyPage extends StatelessWidget {
const MyPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: <Widget>[
Text('MyPage'),
Text('MyPage'),
Text('MyPage')
]
)
)
);
}
}