Skip to content

Commit

Permalink
add panels
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmeireles committed Jan 10, 2022
1 parent 7580217 commit f1c6996
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
21 changes: 18 additions & 3 deletions lib/features/home/desktop/desktop.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'package:flutter/material.dart';

import '../../../core/api/database/sql/sql.dart' as sql;
import '../home.dart';

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

Expand All @@ -8,9 +11,21 @@ class Desktop extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text('coluna 1'),
const Text('coluna 2'),
const Text('coluna 2'),
// Text('coluna 1'),
Flexible(
child: Todos(
todos: [
sql.Todo(
createDate: DateTime.now(),
finishedDate: DateTime.now(),
isFinished: false,
task: 'Qalquer coisa',
uuid: '22aa',
),
],
),
),
// Text('coluna 2'),
],
);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/features/home/home.dart
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export 'home_view.dart';
export 'home_view.dart';
export 'widget/todos.dart';
25 changes: 25 additions & 0 deletions lib/features/home/widget/todos.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';

import '../../../core/api/database/sql/sql.dart';

class Todos extends StatelessWidget {
final List<Todo> todos;

const Todos({Key? key, required this.todos}) : super(key: key);

@override
Widget build(BuildContext context) {
return ListView.builder(
itemBuilder: (context, index) {
final todo = todos[index];

return ListTile(
leading: Text(todo.isFinished ? 'finalizado' : 'em aberto'),
title: Text(todo.task),
subtitle: Text('criado em ${todo.createDate}'),
);
},
itemCount: todos.length,
);
}
}
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.8.2"
bloc:
dependency: transitive
dependency: "direct main"
description:
name: bloc
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.1"
version: "8.0.2"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -112,7 +112,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -236,7 +236,7 @@ packages:
name: flutter_bloc
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.0"
version: "8.0.1"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -325,7 +325,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -561,7 +561,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.3"
timing:
dependency: transitive
description:
Expand All @@ -582,7 +582,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
watcher:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^8.0.0
flutter_bloc: ^8.0.1
cupertino_icons: ^1.0.2
drift: ^1.0.1
sqlite3_flutter_libs: ^0.5.1
path_provider: ^2.0.7
path: ^1.8.0
bloc: ^8.0.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit f1c6996

Please sign in to comment.