Compare commits
No commits in common. "d77e732551639d92b1bd4b1996c4f6830b15ac44" and "f5635d6120cce8a29021aa094af1f716e32ddd58" have entirely different histories.
d77e732551
...
f5635d6120
@ -7,7 +7,10 @@ import 'package:path/path.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Local
|
||||
import '/models/frequency.dart';
|
||||
import '/models/expense.dart';
|
||||
|
||||
// Leaned on this example:
|
||||
|
@ -1,6 +1,5 @@
|
||||
// Flutter
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
|
||||
// Local
|
||||
import '/pages/expense.dart';
|
||||
@ -68,7 +67,12 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget navigation = NavigationRail(
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Expense Tracker"),
|
||||
),
|
||||
drawer: NavigationRail(
|
||||
extended: true,
|
||||
destinations: [
|
||||
NavigationRailDestination(
|
||||
@ -100,39 +104,14 @@ class _HomePageState extends State<HomePage> {
|
||||
onDestinationSelected: (value) {
|
||||
setState(() {
|
||||
pageSelected = value;
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
Widget main = Container(
|
||||
),
|
||||
body: Container(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
child: Center(child: page),
|
||||
);
|
||||
|
||||
Widget? drawer, body;
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
drawer = navigation;
|
||||
body = main;
|
||||
} else {
|
||||
drawer = null;
|
||||
body = Row(
|
||||
children: [
|
||||
SafeArea(child: navigation),
|
||||
Expanded(child: main),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Expense Tracker"),
|
||||
),
|
||||
drawer: drawer,
|
||||
body: body,
|
||||
floatingActionButton: floatingButton,
|
||||
);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user