Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
475 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:adaptive_breakpoints/adaptive_breakpoints.dart'; | ||
|
||
bool isDesktop(BuildContext context) => | ||
getWindowType(context) >= AdaptiveWindowType.medium; | ||
|
||
bool isTablet(BuildContext context) { | ||
return getWindowType(context) == AdaptiveWindowType.medium; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SideDrawer extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Drawer( | ||
child: Column( | ||
children: <Widget>[ | ||
DrawerHeader( | ||
child: Center( | ||
child: Text( | ||
'Side menu FlutterCorner', | ||
textAlign: TextAlign.center, | ||
style: TextStyle(color: Colors.white, fontSize: 25), | ||
), | ||
), | ||
decoration: BoxDecoration( | ||
color: Colors.black, | ||
), | ||
), | ||
ListTile( | ||
leading: Icon(Icons.home), | ||
title: Text('Home'), | ||
onTap: () => {}, | ||
), | ||
ListTile( | ||
leading: Icon(Icons.shopping_cart), | ||
title: Text('Cart'), | ||
onTap: () => {Navigator.of(context).pop()}, | ||
), | ||
ListTile( | ||
leading: Icon(Icons.border_color), | ||
title: Text('Feedback'), | ||
onTap: () => {Navigator.of(context).pop()}, | ||
), | ||
ListTile( | ||
leading: Icon(Icons.exit_to_app), | ||
title: Text('Logout'), | ||
onTap: () => {Navigator.of(context).pop()}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:index/api.dart' as api; | ||
import 'package:index/layout/table.dart'; | ||
|
||
class TabPage extends StatefulWidget { | ||
final int id; | ||
|
||
const TabPage({Key? key, required this.id}) : super(key: key); | ||
|
||
@override | ||
_TabPageState createState() => _TabPageState(); | ||
} | ||
|
||
class _TabPageState extends State<TabPage> { | ||
api.Tab? _tab; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
margin: const EdgeInsets.all(10), | ||
child: FutureBuilder<api.Tab>( | ||
future: api.Tab.fetch(widget.id), | ||
builder: (BuildContext context, AsyncSnapshot<api.Tab> snapshot) { | ||
if (snapshot.hasData) { | ||
_tab = snapshot.data!; | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Card( | ||
child: Container( | ||
padding: const EdgeInsets.all(10), | ||
child: Column( | ||
children: <Widget>[ | ||
Text("Tab-id: ${_tab!.id}"), | ||
Text("Tab-name: ${_tab!.name}"), | ||
Text("Tab-description: ${_tab!.description}"), | ||
], | ||
), | ||
), | ||
), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: _tab!.tables! | ||
.map((table) => TablePage(id: table)) | ||
.toList(), | ||
), | ||
], | ||
); | ||
} else if (snapshot.hasError) { | ||
return Center( | ||
child: Text("Tab: ${widget.id} errored: ${snapshot.error}")); | ||
} else { | ||
return Center(child: Text("Tab: ${widget.id} is loading...")); | ||
} | ||
}, | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.