Created
July 30, 2022 15:21
-
-
Save Pregum/736d9d0001efccb4670dfff00a48f570 to your computer and use it in GitHub Desktop.
gantt_chart_ui_challenge_an_hour
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: const MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
const MyHomePage({Key? key, required this.title}) : super(key: key); | |
final String title; | |
@override | |
State<MyHomePage> createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
int _counter = 0; | |
void _incrementCounter() { | |
setState(() { | |
_counter++; | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Row( | |
children: const [ | |
MenuWidget(), | |
Expanded( | |
child: PlannerWidget(), | |
), | |
], | |
), | |
); | |
} | |
} | |
class PlannerWidget extends StatelessWidget { | |
const PlannerWidget({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
mainAxisAlignment: MainAxisAlignment.start, | |
children: <Widget>[ | |
Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: const [ | |
Text( | |
'Planner', | |
style: TextStyle(fontSize: 24), | |
), | |
SizedBox( | |
width: 250, | |
child: TextField( | |
decoration: InputDecoration( | |
icon: Icon(Icons.search), hintText: 'Search plannner...'), | |
), | |
), | |
], | |
), | |
), | |
const Divider( | |
color: Colors.grey, | |
), | |
SizedBox( | |
height: 80, | |
child: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Row( | |
children: [ | |
Row( | |
children: [ | |
TextButton(onPressed: () {}, child: const Text('Today')), | |
const Icon(Icons.arrow_back_ios), | |
const Icon(Icons.arrow_forward_ios) | |
], | |
), | |
], | |
), | |
), | |
), | |
const Divider( | |
color: Colors.grey, | |
), | |
Expanded( | |
child: Row(children: [ | |
SizedBox( | |
width: 220, | |
child: ListView( | |
children: const [ | |
ListTile( | |
leading: Text('Purcharse Order'), | |
), | |
Divider(), | |
ListTile( | |
leading: Icon(Icons.add), | |
title: Text('タスク1'), | |
), | |
ListTile( | |
leading: Icon(Icons.add), | |
title: Text('タスク2'), | |
), | |
ListTile( | |
leading: Icon(Icons.add), | |
title: Text('タスク3'), | |
), | |
ListTile( | |
leading: Icon(Icons.add), | |
title: Text('タスク4'), | |
), | |
], | |
), | |
), | |
Expanded(child: Container()), | |
]), | |
), | |
], | |
); | |
} | |
} | |
class MenuWidget extends StatelessWidget { | |
const MenuWidget({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
color: Colors.lime[100], | |
width: 240, | |
child: ListView( | |
children: [ | |
const Padding( | |
padding: EdgeInsets.all(16.0), | |
child: Text( | |
'PreLand', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
), | |
SizedBox( | |
height: 70, | |
child: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: TextButton( | |
style: TextButton.styleFrom( | |
side: BorderSide( | |
color: Theme.of(context).primaryColor, | |
), | |
), | |
onPressed: () {}, | |
child: Row( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: const [ | |
Icon(Icons.add), | |
Text('Create'), | |
], | |
), | |
), | |
), | |
), | |
TextButton.icon( | |
style: TextButton.styleFrom( | |
alignment: Alignment.centerLeft, | |
padding: const EdgeInsets.all(16.0), | |
), | |
onPressed: () {}, | |
icon: const Icon(Icons.home), | |
label: const Text('Home'), | |
), | |
TextButton.icon( | |
style: TextButton.styleFrom( | |
alignment: Alignment.centerLeft, | |
padding: const EdgeInsets.all(16.0), | |
), | |
onPressed: () {}, | |
icon: const Icon(Icons.money_outlined), | |
label: const Text('Quotes'), | |
), | |
const Padding( | |
padding: EdgeInsets.all(16.0), | |
child: Text('Jobs'), | |
), | |
TextButton.icon( | |
style: TextButton.styleFrom( | |
alignment: Alignment.centerLeft, | |
padding: const EdgeInsets.all(16.0), | |
), | |
onPressed: () {}, | |
icon: const Icon(Icons.shopping_bag), | |
label: const Text('Orders'), | |
), | |
TextButton.icon( | |
style: TextButton.styleFrom( | |
alignment: Alignment.centerLeft, | |
padding: const EdgeInsets.all(16.0), | |
), | |
onPressed: () {}, | |
icon: const Icon(Icons.edit_calendar), | |
label: const Text('Planner'), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment