Skip to content

Commit

Permalink
feat: Fixing menu to look like wireframe. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
LuchoTurtle committed Feb 15, 2023
1 parent 41555ed commit 88266cd
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 43 deletions.
38 changes: 1 addition & 37 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ class App extends StatelessWidget {
primarySwatch: Colors.blue,
),
debugShowCheckedModeBanner: false,
builder: (context, child) => BaseWidget(child: child),
initialRoute: '/',
routes: {
'/': (context) => FirstRoute(),
'/second': (context) => SecondRoute(),
},
home: const HomePage()
);
}
}
Expand Down Expand Up @@ -126,37 +121,6 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
}
}

class BaseWidget extends StatelessWidget {
final Widget? child;
const BaseWidget({super.key, this.child});

List<Widget> _showChild() {
if (child != null) {
return [
Expanded(child: child!),
];
} else {
return [];
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(
'some menu',
style: TextStyle(
color: Colors.white,
),
)),
body: Column(
children: _showChild(),
),
);
}
}

class FirstRoute extends StatelessWidget {
const FirstRoute({super.key});

Expand Down
70 changes: 64 additions & 6 deletions lib/sliding_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,69 @@ class _SlidingMenuState extends State<SlidingMenu> {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black,
child: Center(
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: const <Widget>[
Text('This is the menu', style: TextStyle(color: Colors.white)),
])),
);
color: Colors.black,
child: ListView(padding: EdgeInsets.only(top: 32), children: [
Container(
padding: const EdgeInsets.only(top: 15, bottom: 15),
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.white), top: BorderSide(color: Colors.white))),
child: ListTile(
leading: const Icon(
Icons.check_outlined,
color: Colors.white,
size: 50,
),
title: const Text('Todo List (Personal)',
style: TextStyle(
fontSize: 30,
color: Colors.white,
)),
onTap: () {
// Update the state of the app.
// ...
},
),
),
Container(
margin: const EdgeInsets.only(top: 100),
padding: const EdgeInsets.only(top: 15, bottom: 15),
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.white))),
child: ListTile(
leading: const Icon(
Icons.flag_outlined,
color: Colors.white,
size: 40,
),
title: const Text('Feature Tour',
style: TextStyle(
fontSize: 25,
color: Colors.white,
)),
onTap: () {
// Update the state of the app.
// ...
},
),
),
Container(
padding: const EdgeInsets.only(top: 15, bottom: 15),
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.white))),
child: ListTile(
leading: const Icon(
Icons.settings,
color: Colors.white,
size: 40,
),
title: const Text('Settings',
style: TextStyle(
fontSize: 25,
color: Colors.white,
)),
onTap: () {
// Update the state of the app.
// ...
},
),
),
]));
}
}

0 comments on commit 88266cd

Please sign in to comment.