Skip to content

Instantly share code, notes, and snippets.

@mhmzdev
Created April 3, 2020 11:21
Show Gist options
  • Save mhmzdev/874083eaeeaea3d189750bc006d0cdfe to your computer and use it in GitHub Desktop.
Save mhmzdev/874083eaeeaea3d189750bc006d0cdfe to your computer and use it in GitHub Desktop.
darkApplied
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool darkTheme = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
home: homePage(context),
);
}
Widget homePage(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 50),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'To-Do List',
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontWeight: FontWeight.bold),
),
Switch(
value: false,
onChanged: (switchTheme) {
setState(() {
});
},
),
],
),
),
SizedBox(
height: 50,
),
Container(
height: 500,
margin: EdgeInsets.symmetric(horizontal: 10),
child: Center(child: Text('Tasks Will be placed here!')),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.black),
boxShadow: [
BoxShadow(
color: Colors.black,
blurRadius: 8,
)
]),
)
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(
Icons.add,
size: 25,
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment