Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Refactored to not lose its state on scroll #6

Merged
merged 21 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Couple improvements
  • Loading branch information
baumths committed Nov 14, 2020
commit c086095a21e55c2a280762e8c6aab102ccf55a6e
24 changes: 22 additions & 2 deletions lib/src/app/app_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import 'package:hive_flutter/hive_flutter.dart';
import '../database/hive_database.dart';
import '../edit/edit.dart';
import '../home/home.dart';
import 'components/components.dart';

class ElPCDApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: HiveDatabase.settingsBox.listenable(),
valueListenable: HiveDatabase.settingsBox.listenable(keys: ['darkMode']),
builder: (_, settingsBox, __) {
var darkMode = settingsBox.get('darkMode', defaultValue: true);
return MaterialApp(
Expand All @@ -28,3 +27,24 @@ class ElPCDApp extends StatelessWidget {
);
}
}

abstract class AppTheme {
static ThemeData themeData(bool darkMode) {
return ThemeData(
primarySwatch: Colors.blue,
primaryColor: Colors.blue.shade900,
accentColor: Colors.orange,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: darkMode ? Brightness.dark : Brightness.light,
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(width: 2),
),
),
hoverColor: darkMode
? Colors.white.withOpacity(0.15)
: Colors.grey.withOpacity(0.5),
);
}
}
24 changes: 0 additions & 24 deletions lib/src/app/components/app_theme.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/src/app/components/components.dart

This file was deleted.

34 changes: 16 additions & 18 deletions lib/src/edit/widgets/classe_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@ class ClasseInfo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scrollbar(
child: Padding(
child: ListView(
padding: const EdgeInsets.fromLTRB(12, 0, 12, 0),
child: ListView(
children: [
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
],
),
children: [
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
_ClasseEntry(),
const Divider(),
],
),
);
}
Expand Down
38 changes: 19 additions & 19 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.2"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
version: "2.1.0-nullsafety.1"
build:
dependency: transitive
description:
Expand Down Expand Up @@ -98,14 +98,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.4"
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.1"
checked_yaml:
dependency: transitive
description:
Expand All @@ -126,7 +126,7 @@ packages:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
version: "1.1.0-nullsafety.1"
code_builder:
dependency: transitive
description:
Expand All @@ -140,7 +140,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.4"
version: "1.15.0-nullsafety.3"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -196,7 +196,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.1"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -332,14 +332,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.2"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -381,7 +381,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.0-nullsafety.1"
path_provider:
dependency: transitive
description:
Expand Down Expand Up @@ -512,21 +512,21 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.5"
version: "1.10.0-nullsafety.2"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
version: "2.1.0-nullsafety.1"
stream_transform:
dependency: transitive
description:
Expand All @@ -540,21 +540,21 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.2"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.4"
version: "0.2.19-nullsafety.2"
time:
dependency: transitive
description:
Expand All @@ -575,7 +575,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
universal_html:
dependency: "direct main"
description:
Expand All @@ -596,7 +596,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.4"
version: "2.1.0-nullsafety.3"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -640,5 +640,5 @@ packages:
source: hosted
version: "0.1.2"
sdks:
dart: ">=2.11.0-0.0 <2.12.0"
dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
flutter: ">=1.16.0 <2.0.0"