-
Notifications
You must be signed in to change notification settings - Fork 1
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
28 changed files
with
545 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
#vim | ||
*~ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
|
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
This file was deleted.
Oops, something went wrong.
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'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:todo/language/cubit/language_cubit.dart'; | ||
import 'package:todo/language/ui/language_page.dart'; | ||
import 'package:todo/util/string_extension.dart'; | ||
|
||
class LanguageListTileSelect extends StatelessWidget { | ||
final LanguageItem language; | ||
const LanguageListTileSelect({required this.language, super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
bool selected = false; | ||
if (context.read<LanguageCubit>().state == Locale(language.code.name)) { | ||
selected = true; | ||
} | ||
return Theme( | ||
data: ThemeData( | ||
splashColor: Colors.transparent, | ||
), | ||
child: ListTile( | ||
trailing: selected | ||
? Icon(Icons.check, color: Theme.of(context).colorScheme.secondary) | ||
: null, | ||
title: Padding( | ||
padding: const EdgeInsets.only(left: 16), | ||
child: Text( | ||
language.name.toString().capitalize(), | ||
style: TextStyle( | ||
fontWeight: FontWeight.w600, | ||
color: Theme.of(context) | ||
.textTheme | ||
.bodyText1! | ||
.color! | ||
.withOpacity(0.9), | ||
), | ||
), | ||
), | ||
onTap: () { | ||
context.read<LanguageCubit>().change(language.code); | ||
}, | ||
), | ||
); | ||
} | ||
} |
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,54 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:todo/app_localizations.dart'; | ||
import 'package:todo/theme/cubit/theme_cubit.dart'; | ||
import 'package:todo/theme/model/app_theme.dart'; | ||
import 'package:todo/theme/ui/theme_page.dart'; | ||
import 'package:todo/util/string_extension.dart'; | ||
|
||
class ThemeListTile extends StatelessWidget { | ||
const ThemeListTile({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
leading: const Icon(Icons.brightness_6), | ||
title: Text( | ||
AppLocalizations.of(context).translate("theme").capitalize(), | ||
), | ||
subtitle: const SubtitleTheme(), | ||
onTap: () { | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute(builder: (context) => const ThemePage()), | ||
); | ||
}, | ||
trailing: const Icon(Icons.arrow_forward_ios_rounded), | ||
); | ||
} | ||
} | ||
|
||
class SubtitleTheme extends StatelessWidget { | ||
const SubtitleTheme({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<ThemeCubit, AppTheme>( | ||
builder: (context, state) { | ||
String text; | ||
switch (state) { | ||
case AppTheme.light: | ||
text = AppLocalizations.of(context).translate("light"); | ||
break; | ||
case AppTheme.dark: | ||
text = AppLocalizations.of(context).translate("dark"); | ||
break; | ||
case AppTheme.system: | ||
text = AppLocalizations.of(context).translate("system"); | ||
break; | ||
} | ||
return Text(text.capitalize()); | ||
}, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.