Skip to content

Commit

Permalink
DB update and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Yustas committed Jan 16, 2025
1 parent a679de2 commit d101e58
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#DB
DB_VERSION=73
DB_VERSION=131
Binary file modified assets/db/mova.db
Binary file not shown.
66 changes: 46 additions & 20 deletions lib/themes/markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@ stylesheet(BuildContext context) {
h1: ThemeData()
.textTheme
.titleLarge!
.copyWith(fontSize: 24, color: Colors.blue),
.copyWith(
fontSize: 24,
fontWeight: FontWeight.w600,
decoration: TextDecoration.underline,
decorationThickness: 0.5,
decorationStyle: TextDecorationStyle.solid
),
h1Padding: EdgeInsets.only(top: 20, bottom: 10),
h2: ThemeData()
.textTheme
.headlineMedium!
.copyWith(
fontSize: 21,
fontWeight: FontWeight.w600
),
h2Padding: EdgeInsets.only(top: 10, bottom: 10),
h3: ThemeData()
.textTheme
.headlineSmall!
.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600
),
h6: ThemeData().textTheme.bodyLarge!.copyWith(),
h6Padding: EdgeInsets.all(0),
h6Align: WrapAlignment.start,
Expand All @@ -18,15 +40,13 @@ stylesheet(BuildContext context) {
p: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
strong: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 20,
fontWeight: FontWeight.w600,
),
em: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w100,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
strong: const TextStyle(
fontWeight: FontWeight.w600,
),
em: TextStyle(
fontWeight: FontWeight.w100,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
code: Theme.of(context)
.textTheme
.bodyLarge!
Expand All @@ -38,7 +58,8 @@ stylesheet(BuildContext context) {
left: BorderSide(
color: Theme.of(context).colorScheme.surfaceContainer,
width: 3))),
//listIndent: 0,
listIndent: 26,
//listBulletPadding: EdgeInsets.only(right: 10),
orderedListAlign: WrapAlignment.start,
//p: ThemeData().textTheme.bodyMedium!.copyWith(),
// pPadding: const EdgeInsets.only(bottom: 15),
Expand All @@ -56,22 +77,27 @@ stylesheet(BuildContext context) {
// right: BorderSide(color: Theme.of(context).colorScheme.shadow)
// )
),
tableBorder: TableBorder(
verticalInside: BorderSide(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
tableBorder: TableBorder.all(
color: Theme.of(context).colorScheme.onSurfaceVariant,
width: 1,
borderRadius: BorderRadius.circular(10)
),
),
// tableBorder: TableBorder(
// verticalInside: BorderSide(
// color: Theme.of(context).colorScheme.surfaceContainerHigh,
// width: 1,
// ),
// ),
tableCellsPadding: const EdgeInsets.fromLTRB(10, 5, 5, 5),
tableHead: TextStyle(
fontSize: Theme.of(context).textTheme.bodySmall!.fontSize,
tableHead: Theme.of(context).textTheme.bodySmall!.copyWith(
fontWeight: FontWeight.w600
),
tableBody: TextStyle(
fontSize: Theme.of(context).textTheme.bodySmall!.fontSize,
tableBody: Theme.of(context).textTheme.bodySmall!.copyWith(
fontStyle: FontStyle.normal
),
tableColumnWidth: IntrinsicColumnWidth(),
tableCellsDecoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
),
textAlign: WrapAlignment.start
);
Expand Down
11 changes: 7 additions & 4 deletions lib/themes/material.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ class MaterialTheme {
fontWeight: FontWeight.w800,
color: colorScheme.onSurface
),
// # Heading 3
headlineSmall:
ThemeData().textTheme.headlineSmall!.copyWith(fontSize: 24),

ThemeData().textTheme.headlineSmall!.copyWith(
fontSize: 16,
color: colorScheme.onSurface
),
bodyLarge: GoogleFonts.roboto(textStyle: ThemeData().textTheme.bodyMedium!.copyWith(
fontSize: 18,
color: colorScheme.onSurfaceVariant,
Expand All @@ -89,8 +92,8 @@ class MaterialTheme {
fontSize: 18,
color: colorScheme.onSurfaceVariant,
)),
bodySmall: GoogleFonts.lato(textStyle: ThemeData().textTheme.bodyMedium!.copyWith(
fontSize: 18,
bodySmall: GoogleFonts.roboto(textStyle: ThemeData().textTheme.bodyMedium!.copyWith(
fontSize: 15,
color: colorScheme.onSurfaceVariant,
)),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Future<Database> openDatabase() async {
Future<void> deleteDatabase() async {
var path = await getDatabasePath();
log.info("Delete database: $path");
sql.deleteDatabase(path);
await sql.deleteDatabase(path);
}

Future<Database> initDb() async {
Expand Down
24 changes: 14 additions & 10 deletions lib/widgets/content_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ class ContentList extends StatelessWidget {
scrollDirection: Axis.vertical,
itemCount: content.length,
itemBuilder: (context, index) {
Widget numeration = content[index].numeration.toString().isNotEmpty
? Text(content[index].numeration, style: Theme.of(context).textTheme.titleLarge)
: Text('•', style: Theme.of(context).textTheme.titleLarge);
// Widget numeration = content[index].numeration.toString().isNotEmpty
// ? Text(content[index].numeration, style: Theme.of(context).textTheme.titleLarge)
// : Text('•', style: Theme.of(context).textTheme.titleLarge);

String numerationText = content[index].numeration.toString().isNotEmpty
? content[index].numeration + ' '
: '';

return InkWell(
onTap: () {
Expand All @@ -57,17 +61,17 @@ class ContentList extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
numeration,
const SizedBox(width: 25)
],
),
// Column(
// children: [
// numeration,
// const SizedBox(width: 25)
// ],
// ),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(content[index].data,
Text('$numerationText${content[index].data}',
style: Theme.of(context).textTheme.titleLarge)
],
),
Expand Down

0 comments on commit d101e58

Please sign in to comment.