-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
5a6796b
commit 7b2fa41
Showing
27 changed files
with
324 additions
and
437 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# dionniebee | ||
|
||
flutter clean && flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs | ||
flutter run -d chrome --web-port 8000 --web-renderer html | ||
flutter run -d chrome --web-port 8000 --web-renderer html | ||
|
||
# STACKED COMMANDS |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,35 @@ | ||
import 'package:dionniebee/ui/common/colors.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
|
||
class AppTheme { | ||
static ThemeData lightTheme = ThemeData( | ||
fontFamily: GoogleFonts.varelaRound().fontFamily, | ||
useMaterial3: false, | ||
appBarTheme: AppBarTheme( | ||
backgroundColor: kcPrimaryColor, | ||
foregroundColor: Colors.white, | ||
titleTextStyle: TextStyle( | ||
color: Colors.white, | ||
fontFamily: GoogleFonts.varelaRound().fontFamily, | ||
fontWeight: FontWeight.bold, | ||
fontSize: 18)), | ||
brightness: Brightness.light, | ||
colorSchemeSeed: kcPrimaryColor, | ||
); | ||
|
||
static ThemeData darkTheme = ThemeData( | ||
fontFamily: GoogleFonts.varelaRound().fontFamily, | ||
useMaterial3: false, | ||
appBarTheme: AppBarTheme( | ||
backgroundColor: kcPrimaryColor, | ||
foregroundColor: Colors.white, | ||
titleTextStyle: TextStyle( | ||
color: Colors.white, | ||
fontFamily: GoogleFonts.varelaRound().fontFamily, | ||
fontWeight: FontWeight.bold, | ||
fontSize: 18)), | ||
brightness: Brightness.dark, | ||
colorSchemeSeed: kcPrimaryColor, | ||
); | ||
} |
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
Empty file.
88 changes: 88 additions & 0 deletions
88
lib/services/fluttertoast_contextless/fluttertoast_manager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import 'package:dionniebee/app/app.locator.dart'; | ||
import 'package:dionniebee/services/fluttertoast_contextless/fluttertoast_service.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:fluttertoast/fluttertoast.dart'; | ||
|
||
class FlutterToastManager extends StatefulWidget { | ||
final Widget child; | ||
const FlutterToastManager({super.key, required this.child}); | ||
|
||
@override | ||
State<FlutterToastManager> createState() => _FlutterToastManagerState(); | ||
} | ||
|
||
class _FlutterToastManagerState extends State<FlutterToastManager> { | ||
final FlutterToastService _toastService = locator<FlutterToastService>(); | ||
late FToast fToast; | ||
|
||
@override | ||
void initState() { | ||
fToast = FToast(); | ||
fToast.init(context); | ||
|
||
showToast(String? message) { | ||
fToast.showToast( | ||
child: Container( | ||
padding: | ||
const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0), | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(25.0), | ||
color: Colors.black.withOpacity(0.8), | ||
), | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
const Icon(Icons.check, color: Colors.white), | ||
const SizedBox( | ||
width: 12.0, | ||
), | ||
Text( | ||
message.toString(), | ||
style: const TextStyle(color: Colors.white), | ||
), | ||
], | ||
), | ||
), | ||
fadeDuration: const Duration(milliseconds: 500), | ||
gravity: ToastGravity.BOTTOM, | ||
toastDuration: const Duration(seconds: 2)); | ||
} | ||
|
||
welcomeToast() { | ||
fToast.showToast( | ||
child: Container( | ||
padding: | ||
const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0), | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(25.0), | ||
color: Colors.black.withOpacity(0.8), | ||
), | ||
child: const Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Icon(Icons.check, color: Colors.white), | ||
SizedBox( | ||
width: 12.0, | ||
), | ||
Text( | ||
"Welcome", | ||
style: TextStyle(color: Colors.white), | ||
), | ||
], | ||
), | ||
), | ||
fadeDuration: const Duration(milliseconds: 500), | ||
gravity: ToastGravity.BOTTOM, | ||
toastDuration: const Duration(seconds: 2)); | ||
} | ||
|
||
_toastService.welcomeToast = welcomeToast; | ||
_toastService.showToast = showToast; | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return widget.child; | ||
} | ||
} |
15 changes: 10 additions & 5 deletions
15
lib/services/toast_service.dart → ...ast_contextless/fluttertoast_service.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import 'package:dionniebee/services/loader_service.dart'; | ||
|
||
enum ToastType { | ||
welcome, | ||
} | ||
|
||
typedef ToastBuilder = Function(); | ||
|
||
class ToastService { | ||
class FlutterToastService { | ||
var _toastCustomBuilders = <ToastType, ToastBuilder>{}; | ||
|
||
ToastBuilder? welcomeToast; | ||
Function(String? message)? showToast; | ||
Map<ToastType, ToastBuilder> _toastBuilders = <ToastType, ToastBuilder>{}; | ||
|
||
void registerCustomToastBuilders(Map<ToastType, ToastBuilder> builders) { | ||
_toastBuilders = builders; | ||
_toastCustomBuilders = builders; | ||
} | ||
|
||
show(String message) { | ||
return showToast != null ? showToast!(message) : null; | ||
} | ||
|
||
welcome(ToastType type) { | ||
return _toastCustomBuilders[ToastType.welcome]?.call(); | ||
} | ||
} |
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
Oops, something went wrong.