forked from luiscib3r/todo
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Luis Ciber
committed
Sep 5, 2021
1 parent
bf79ef9
commit 50329c2
Showing
15 changed files
with
194 additions
and
22 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,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppBarTitle extends StatelessWidget { | ||
const AppBarTitle( | ||
this.title, { | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
final String title; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Text( | ||
title, | ||
style: const TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
); | ||
} | ||
} |
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,69 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:todo/app/app.dart'; | ||
import 'package:todo/gen/assets.gen.dart'; | ||
import 'package:todo/l10n/l10n.dart'; | ||
|
||
class AppDrawer extends StatelessWidget { | ||
const AppDrawer({ | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = context.l10n; | ||
|
||
return SafeArea( | ||
child: Drawer( | ||
child: Stack( | ||
children: [ | ||
ListView( | ||
children: [ | ||
DrawerHeader( | ||
child: Center( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Container( | ||
margin: const EdgeInsets.all(10), | ||
child: Assets.images.logo.image( | ||
width: 75, | ||
height: 75, | ||
), | ||
), | ||
Text( | ||
l10n.appName, | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 20, | ||
color: | ||
Theme.of(context).brightness == Brightness.dark | ||
? Colors.white | ||
: Colors.blue, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
AppDrawerTile( | ||
title: 'Cuentas', | ||
icon: Icons.account_circle_outlined, | ||
onTap: () {}, | ||
), | ||
AppDrawerTile( | ||
title: 'Ajustes', | ||
icon: Icons.settings_outlined, | ||
onTap: () {}, | ||
), | ||
], | ||
), | ||
const Align( | ||
alignment: Alignment.topRight, | ||
child: ThemeIconButton(), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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,37 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppDrawerTile extends StatelessWidget { | ||
const AppDrawerTile({ | ||
Key? key, | ||
required this.title, | ||
required this.icon, | ||
required this.onTap, | ||
}) : super(key: key); | ||
|
||
final String title; | ||
final IconData icon; | ||
final VoidCallback onTap; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only( | ||
left: 10, | ||
right: 10, | ||
), | ||
child: ListTile( | ||
leading: Icon( | ||
icon, | ||
size: 32, | ||
), | ||
title: Text( | ||
title, | ||
style: const TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
onTap: onTap, | ||
), | ||
); | ||
} | ||
} |
File renamed without changes.
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,29 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:todo/app/app.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class ThemeIconButton extends StatelessWidget { | ||
const ThemeIconButton({ | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final bloc = context.read<ThemeBloc>(); | ||
|
||
return BlocBuilder<ThemeBloc, ThemeState>( | ||
builder: (context, state) { | ||
return IconButton( | ||
icon: const Icon(Icons.wb_sunny), | ||
onPressed: () { | ||
if (state.themeMode == ThemeMode.dark) { | ||
bloc.add(const ThemeEvent.setLight()); | ||
} else { | ||
bloc.add(const ThemeEvent.setDark()); | ||
} | ||
}, | ||
); | ||
}, | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export 'app_drawer.dart'; | ||
export 'app_drawer_tile.dart'; | ||
export 'app_tab_bar.dart'; | ||
export 'loading.dart'; | ||
export 'theme_icon_button.dart'; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export 'app_tab_bar.dart'; | ||
|
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