repo_id
stringlengths
21
168
file_path
stringlengths
36
210
content
stringlengths
1
9.98M
__index_level_0__
int64
0
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/select_theme_dialog.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/core/view_model/global/global_viewmodel.dart'; import 'package:flutter_mockup_bloc/provider/data_provider_widget.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/gaps.dart'; import 'package:provider/provider.dart'; class SelectThemeDialog extends StatelessWidget { final VoidCallback goBack; const SelectThemeDialog({ required this.goBack, Key? key, }) : super(key: key); @override Widget build(BuildContext context) { final globalViewModel = Provider.of<GlobalViewModel>(context); return DataProviderWidget( childBuilderLocalization: (context, localization) => AlertDialog( title: Text(localization.debugLocaleSelector), content: SizedBox( height: 150, width: MediaQuery.of(context).size.width / 1.2, child: ListView( shrinkWrap: true, children: [ SelectorItem( title: 'Sáng', selected: globalViewModel.themeMode == ThemeMode.light, onClick: () { globalViewModel.updateThemeMode(ThemeMode.light); goBack(); }, ), SelectorItem( title: 'Tối', selected: globalViewModel.themeMode == ThemeMode.dark, onClick: () { globalViewModel.updateThemeMode(ThemeMode.dark); goBack(); }, ), ], ), ), ), ); } } class SelectorItem extends StatelessWidget { final VoidCallback onClick; final String title; final bool selected; const SelectorItem({ required this.onClick, required this.title, required this.selected, Key? key, }) : super(key: key); @override Widget build(BuildContext context) { return DataProviderWidget( childBuilderTheme: (context, theme) => GestureDetector( child: Padding( padding: EdgeInsets.all(16), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(title), Gaps.hGap10, Opacity( opacity: selected ? 1 : 0, child: Icon(Icons.check_circle, color: AppColors.primary), ), ], ), ), onTap: onClick, ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/input_dialog.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/theme/app_border_and_radius.dart'; import 'package:flutter_mockup_bloc/common/theme/app_padding.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/button/pill_button.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/common_widget.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/outline_text_form_field.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/scafold/will_unfocus_form_scope.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/dialog/app_dialogs.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; import 'package:flutter_mockup_bloc/resource/app_text_styles.dart'; class InputDialog extends StatelessWidget { const InputDialog({ Key? key, required this.data, required this.onSaveBtnPressed, }) : super(key: key); final String data; final void Function() onSaveBtnPressed; @override Widget build(BuildContext context) { return Dialog( elevation: 0, shape: RoundedRectangleBorder( borderRadius: AppBorderAndRadius.defaultBorderRadius, ), backgroundColor: Colors.transparent, child: WillUnfocusFormScope( child: SingleChildScrollView( child: DecoratedBox( decoration: BoxDecoration( color: Colors.white, borderRadius: AppBorderAndRadius.defaultBorderRadius, ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ DecoratedBox( decoration: BoxDecoration( color: AppColors.primary, borderRadius: BorderRadius.only( topLeft: AppBorderAndRadius.defaultRadius, topRight: AppBorderAndRadius.defaultRadius, ), ), child: Padding( padding: const EdgeInsets.only(top: 6, bottom: 5, left: 20), child: Text( 'Ghi chú cho nhà tuyển dụng', style: AppTextStyles.dialogTitle, ), ), ), // Padding( padding: AppPad.a20, child: OutlineTextFormField( data: data, hintText: 'Nhập ghi chú', maxLines: 8, multiline: true, ), ), SizedBoxExt.h10, Row( mainAxisAlignment: MainAxisAlignment.center, children: [ PillButton( type: ButtonType.OUTLINED_PRIMARY, text: AppConstants.cancel, width: 100, onPressed: () => AppDialogs.hideDialog(context), ), SizedBoxExt.w20, PillButton( type: ButtonType.CTA, text: AppConstants.agree, width: 100, onPressed: onSaveBtnPressed, ), ], ), SizedBoxExt.h20, ], ), ), ), ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/select_language_dialog.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/core/view_model/global/global_viewmodel.dart'; import 'package:flutter_mockup_bloc/provider/data_provider_widget.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/gaps.dart'; import 'package:provider/provider.dart'; class SelectLanguageDialog extends StatelessWidget { final VoidCallback goBack; const SelectLanguageDialog({ required this.goBack, Key? key, }) : super(key: key); @override Widget build(BuildContext context) { final globalViewModel = Provider.of<GlobalViewModel>(context); return DataProviderWidget( childBuilderLocalization: (context, localization) => AlertDialog( title: Text(localization.debugLocaleSelector), content: SizedBox( height: 150, width: MediaQuery.of(context).size.width / 1.2, child: ListView( shrinkWrap: true, children: [ SelectorItem( title: 'English', selected: globalViewModel.isLanguageSelected('en'), onClick: () { globalViewModel.onSwitchToEnglish(); goBack(); }, ), SelectorItem( title: 'Vietnam', selected: globalViewModel.isLanguageSelected('vi'), onClick: () { globalViewModel.onSwitchToVietnam(); goBack(); }, ), ], ), ), ), ); } } class SelectorItem extends StatelessWidget { final VoidCallback onClick; final String title; final bool selected; const SelectorItem({ required this.onClick, required this.title, required this.selected, Key? key, }) : super(key: key); @override Widget build(BuildContext context) { return DataProviderWidget( childBuilderTheme: (context, theme) => GestureDetector( child: Padding( padding: EdgeInsets.all(16), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(title), Gaps.hGap10, Opacity( opacity: selected ? 1 : 0, child: Icon(Icons.check_circle, color: AppColors.primary), ), ], ), ), onTap: onClick, ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/progress_dialog.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/resource/gaps.dart'; /// 加载中的弹框 class ProgressDialog extends Dialog { const ProgressDialog({ Key? key, this.hintText = '', }):super(key: key); final String hintText; @override Widget build(BuildContext context) { final Widget progress = Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Theme( data: ThemeData( cupertinoOverrideTheme: const CupertinoThemeData( brightness: Brightness.dark, // 局部指定夜间模式,加载圈颜色会设置为白色 ), ), child: const CupertinoActivityIndicator(radius: 14.0), ), Gaps.vGap8, Text(hintText, style: const TextStyle(color: Colors.white),) ], ); return Material( type: MaterialType.transparency, child: Center( child: Container( height: 88.0, width: 120.0, decoration: const ShapeDecoration( color: Color(0xFF3A3A3A), shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(8.0)), ), ), child: progress, ), ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/custom_dialog.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/theme/app_border_and_radius.dart'; import 'package:flutter_mockup_bloc/common/theme/app_padding.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/button/pill_button.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/widget_utils.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; import 'package:flutter_mockup_bloc/resource/app_text_styles.dart'; class CustomDialog extends StatelessWidget { const CustomDialog({ Key? key, this.isMessageDialog = false, this.placeButtonsInColumn = false, this.switchButtonsPositionAndStyle = false, required this.icon, this.affirmativeText = 'Đóng', this.additionalWidget, required this.description, required this.onAffirmativeBtnPressed, required this.onCancel, }) : super(key: key); final bool isMessageDialog; final bool placeButtonsInColumn; final bool switchButtonsPositionAndStyle; final Widget icon; final String affirmativeText; final String description; final void Function() onAffirmativeBtnPressed; final void Function() onCancel; /// available if switchButtonsPositionAndStyle == false final Widget? additionalWidget; @override Widget build(BuildContext context) { final EdgeInsets containerPadding = isMessageDialog ? const EdgeInsets.symmetric(horizontal: 22, vertical: 20) : const EdgeInsets.symmetric(horizontal: 22, vertical: 40); final SizedBox spacingBetweenDescription = isMessageDialog ? SizedBoxExt.h20 : SizedBoxExt.h30; late final Widget buttonsSeperator = placeButtonsInColumn ? SizedBoxExt.h12 : SizedBoxExt.w20; late final EdgeInsets affirmativeBtnPadding = affirmativeText != AppConstants.agree ? const EdgeInsets.symmetric(horizontal: 20, vertical: 10) : const EdgeInsets.symmetric(horizontal: 15, vertical: 10); List<Widget> buttons = [ if (isMessageDialog) PillButton( type: ButtonType.CTA, text: affirmativeText, width: null, onPressed: onAffirmativeBtnPressed, padding: const EdgeInsets.symmetric( horizontal: 30, vertical: 10, ), ) else if (switchButtonsPositionAndStyle == false) ...[ PillButton( type: ButtonType.OUTLINED_PRIMARY, text: affirmativeText, onPressed: onAffirmativeBtnPressed, padding: affirmativeBtnPadding, ), if (additionalWidget != null) ...[ buttonsSeperator, additionalWidget!, ], buttonsSeperator, PillButton( type: ButtonType.CTA, text: AppConstants.cancel, onPressed: onCancel, ), ] else ...[ PillButton( type: ButtonType.OUTLINED_PRIMARY, text: AppConstants.cancel, onPressed: onCancel, ), buttonsSeperator, PillButton( type: ButtonType.CTA, text: affirmativeText, onPressed: onAffirmativeBtnPressed, padding: affirmativeBtnPadding, ) ], ]; if (!placeButtonsInColumn) buttons = WidgetUtils.uniformWidth(buttons); return Dialog( elevation: 0, shape: RoundedRectangleBorder( borderRadius: AppBorderAndRadius.defaultBorderRadius, ), backgroundColor: Colors.transparent, // insetPadding: AppPadding.paddingAll20, child: SingleChildScrollView( child: Container( padding: containerPadding, decoration: BoxDecoration( color: Colors.white, borderRadius: AppBorderAndRadius.defaultBorderRadius, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ icon, // spacingBetweenDescription, Text( description, style: AppTextStyles.dialogDescription, textAlign: TextAlign.center, maxLines: 5, ), spacingBetweenDescription, // if (placeButtonsInColumn) Padding( padding: const EdgeInsets.symmetric(horizontal: 40), child: Column( mainAxisSize: MainAxisSize.min, children: buttons, ), ) else Padding( padding: AppPad.horiz20, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: buttons, ), ), ], ), ), ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets
mirrored_repositories/flutter_mockup_bloc/lib/presentation/widgets/dialog/app_dialogs.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_pages.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_router.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/button/pill_button.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/dialog/custom_dialog.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/dialog/input_dialog.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; import 'package:flutter_mockup_bloc/utils/ui/icon_utils.dart'; _navigateBack(BuildContext context) => AppRouter.back(context, result: false); class AppDialogs { static Future<void> showLoginDialog( BuildContext context, String description) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( icon: IconUtils.login_icon, description: description, affirmativeText: AppConstants.login, placeButtonsInColumn: true, additionalWidget: false ? null : PillButton( type: ButtonType.OUTLINED_PRIMARY, text: AppConstants.signUp, onPressed: () => AppRouter.toPage( context, AppPages.Auth_Login, arguments: { 'replaceAllByLoginPageAfterSuccess': true, }, ), ), onAffirmativeBtnPressed: () => AppRouter.toPage( context, AppPages.Auth_Login, arguments: { // 'onSuccess': () => AppRouter.back(context, result: true), 'canNavigateBack': true, }, ), onCancel: () => hideDialog(context), ), routeSettings: const RouteSettings(name: 'login'), ); static Future<void> showConfirmSignOutDialog( BuildContext context, { required void Function() onConfirm, }) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( icon: IconUtils.dialog_power_icon, description: 'Bạn có chắc chắn muốn đăng xuất?', affirmativeText: AppConstants.signOut, placeButtonsInColumn: true, switchButtonsPositionAndStyle: true, onAffirmativeBtnPressed: onConfirm, onCancel: () => hideDialog(context), ), routeSettings: const RouteSettings(name: 'confirm_sign_out'), ); static Future<void> showInfoDialog(BuildContext context, String message, [void Function()? onAffirmativeBtnPressed]) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( icon: IconUtils.dialog_info_icon, description: message, isMessageDialog: true, onAffirmativeBtnPressed: onAffirmativeBtnPressed ?? () => hideDialog(context), onCancel: () => hideDialog(context), ), routeSettings: RouteSettings(name: 'infomation', arguments: message), ); static Future<void> _showReqestUseOrBuyPointDialog( BuildContext context, { required int points, required String action, required void Function() onAgreeUsingPointBtnPressed, void Function()? onCancelBtnPressed, required String routeNameWhenPointIsGreaterThanZero, required String routeNameWhenPointIsEqualZero, }) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => points > 0 ? CustomDialog( icon: IconUtils.dialog_info_icon, description: "Hiện bạn còn $points điểm. " "$action ứng viên này bạn phải mất 1 điểm.", affirmativeText: AppConstants.agree, switchButtonsPositionAndStyle: true, onAffirmativeBtnPressed: () { hideDialog(context); onAgreeUsingPointBtnPressed(); }, onCancel: onCancelBtnPressed ?? () => hideDialog(context), ) : CustomDialog( icon: IconUtils.dialog_info_icon, description: 'Hiện bạn còn 0 điểm. ' "$action ứng viên này bạn phải mất 1 điểm, " 'hãy liên lạc với chuyên viên tư vấn của timviec365 để mua điểm.', affirmativeText: 'Mua điểm', switchButtonsPositionAndStyle: true, placeButtonsInColumn: true, onAffirmativeBtnPressed: () async { // await SystemUtils.openUrlInBrowser( // WebPageUri.servicesPricingPage, // ); hideDialog(context); }, onCancel: onCancelBtnPressed ?? () => hideDialog(context), ), routeSettings: RouteSettings( name: points > 0 ? routeNameWhenPointIsGreaterThanZero : routeNameWhenPointIsEqualZero, ), ); static Future<void> showReqestUseOrBuyPointDialog( BuildContext context, { required int points, required void Function() onAgreeUsingPointBtnPressed, }) => _showReqestUseOrBuyPointDialog( context, points: points, action: 'Để xem và chat với', onAgreeUsingPointBtnPressed: onAgreeUsingPointBtnPressed, routeNameWhenPointIsGreaterThanZero: 'request_use_point', routeNameWhenPointIsEqualZero: 'request_buy_point', ); static Future<void> showRequestUseOrBuyPointToChatDialog( BuildContext context, { required int points, required void Function() onAgreeUsingPointBtnPressed, required void Function() onBuyPointBtnPressed, }) => _showReqestUseOrBuyPointDialog( context, points: points, action: 'Để tiếp tục chat với', onAgreeUsingPointBtnPressed: onAgreeUsingPointBtnPressed, routeNameWhenPointIsGreaterThanZero: 'request_use_point_to_chat', routeNameWhenPointIsEqualZero: 'request_buy_point_to_chat', ); static Future<void> showRequestUseOrBuyPointToViewCvDialog( BuildContext context, { required int points, required void Function() onAgreeUsingPointBtnPressed, required void Function() onCancelBtnPressed, }) => _showReqestUseOrBuyPointDialog( context, points: points, action: 'Để xem hồ sơ của', onAgreeUsingPointBtnPressed: onAgreeUsingPointBtnPressed, onCancelBtnPressed: onCancelBtnPressed, routeNameWhenPointIsGreaterThanZero: 'request_use_point_to_chat', routeNameWhenPointIsEqualZero: 'request_buy_point_to_chat', ); static Future<void> showConfirmDeleteDialog( BuildContext context, { required String target, required void Function() onConfirm, }) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( icon: IconUtils.dialog_trash_icon, description: "Bạn có chắc chắn muốn xóa $target này?", affirmativeText: AppConstants.agree, switchButtonsPositionAndStyle: true, onAffirmativeBtnPressed: onConfirm, onCancel: () => hideDialog(context), ), routeSettings: const RouteSettings(name: 'confirm_delete'), ); static Future<void> showInputNoteDialog( BuildContext context, { required String data, required void Function() onSave, }) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => InputDialog( data: data, onSaveBtnPressed: onSave, ), routeSettings: const RouteSettings(name: 'input_note'), ); static Future<void> showRequestPermissionDialog( BuildContext context, { required String message, String affirmativeText = AppConstants.agree, bool? placeButtonsInColumn, required void Function() onAgreeBtnPressed, void Function()? onCancelBtnPressed, String? routeName, }) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( icon: IconUtils.dialog_info_icon, description: message, affirmativeText: affirmativeText, placeButtonsInColumn: placeButtonsInColumn ?? false, onAffirmativeBtnPressed: () { hideDialog(context); onAgreeBtnPressed(); }, onCancel: onCancelBtnPressed ?? () => hideDialog(context), ), routeSettings: RouteSettings(name: routeName), ); static Future<void> showDialogFeatureInDevelopment(BuildContext context) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (context) => CustomDialog( isMessageDialog: true, icon: IconUtils.dialog_info_icon, description: AppConstants.featureInDevelopment, onAffirmativeBtnPressed: () => hideDialog(context), onCancel: () => hideDialog(context), ), routeSettings: const RouteSettings(name: 'confirm_delete'), ); static Future<void> showSuccessDialog(BuildContext context, String msg, [void Function()? onAffirmativeBtnPressed]) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (_) => CustomDialog( isMessageDialog: true, icon: IconUtils.dialog_check_icon, description: msg, onAffirmativeBtnPressed: onAffirmativeBtnPressed ?? () => hideDialog(context), onCancel: () => hideDialog(context), ), routeSettings: RouteSettings(name: 'success', arguments: msg), ); static Future<void> showErrorDialog(BuildContext context, String msg, [void Function()? onAffirmativeBtnPressed]) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (_) => CustomDialog( isMessageDialog: true, icon: IconUtils.dialog_x_icon, description: msg, onAffirmativeBtnPressed: onAffirmativeBtnPressed ?? () => hideDialog(context), onCancel: () => hideDialog(context), ), routeSettings: RouteSettings(name: 'error', arguments: msg), ); static hideDialog(BuildContext context) => _navigateBack(context); static showLoadingCircle(BuildContext context) => showDialog( context: context, barrierDismissible: false, barrierColor: AppColors.dialogBarrier, builder: (_) => WillPopScope( onWillPop: () async => false, child: SizedBox.expand( child: Center( child: CircularProgressIndicator(color: Colors.white), ), ), ), routeSettings: const RouteSettings(name: 'loading'), ); static hideLoadingCircle(BuildContext context) => _navigateBack(context); static resolveSuccessState(BuildContext context, String message, [void Function()? affirmativeBtnPressedCallback]) => showSuccessDialog(context, message, () { // hide this dialog hideDialog(context); hideLoadingCircle(context); affirmativeBtnPressedCallback?.call(); }); static resolveFailedState(BuildContext context, String error) => showErrorDialog(context, error, () { // hide this dialog hideDialog(context); hideLoadingCircle(context); }); static Future<bool?> showToast(BuildContext context, String msg) => showDialog( context: context, barrierDismissible: false, barrierColor: Colors.transparent, builder: (BuildContext context) { Future.delayed( Duration(milliseconds: 1500), () => Navigator.pop(context, false), ); return WillPopScope( onWillPop: () async { Navigator.pop(context, true); return false; }, child: IgnorePointer( child: Material( type: MaterialType.transparency, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.end, children: [ Chip( label: Text( msg, style: TextStyle(color: Colors.white), ), backgroundColor: Colors.black.withOpacity(0.8), labelPadding: const EdgeInsets.symmetric( horizontal: 16, vertical: 10, ), ), SizedBox(height: 100), ], ), ), ), ); }, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/router/page_config.dart
import 'package:flutter/material.dart'; import 'app_router.dart'; typedef PageBuilder = Widget Function(); class PageConfig { late PageBuilder pageBuilder; Transition? transition; Duration? transitionDuration; bool preventDuplicates = true; Curve? curve; bool opaque = true; bool fullscreenDialog = false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/router/app_route_observer.dart
import 'package:flutter/material.dart'; class AppRouteObserver extends RouteObserver<ModalRoute<Object?>> {}
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/router/route_logging_observer.dart
import 'dart:developer' show log; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class RouteLoggingObserver extends RouteObserver<PageRoute<dynamic>> { String _resolveArguments(Object? args) { if (args == null) return ''; if (args is Map) // ignore: prefer_interpolation_to_compose_strings return '?' + args.entries .map( (e) => [ e.key.toString(), if (e.value is Function) objectRuntimeType(e.value, '') else e.value.toString(), ].join('='), ) .join('&'); return "?${args.toString()}"; } void _log( String action, RouteSettings settings, { bool seperateArgumentsToNewLine = false, }) { String arguments = _resolveArguments(settings.arguments); if (seperateArgumentsToNewLine) { final int numWhiteSpace = (settings.name?.length ?? 0) > 9 ? settings.name!.length - 9 : 0; arguments = "\n${' ' * numWhiteSpace}message: " + (settings.arguments is String && (settings.arguments as String).isNotEmpty ? settings.arguments as String : arguments); } log( "$action: ${settings.name}$arguments", name: 'Navigator', ); } bool _isModalBottomSheetRoute(Route<dynamic> route) => objectRuntimeType(route, '').contains('_ModalBottomSheetRoute'); @override void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) { super.didPop(route, previousRoute); if (route is DialogRoute) _log( 'CLOSE DIALOG', route.settings, seperateArgumentsToNewLine: true, ); else if (_isModalBottomSheetRoute(route)) _log('CLOSE MODEL BOTTOM SHEET', route.settings); else if (route.settings.name != null) _log('POP ROUTE', route.settings); } @override void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) { super.didPush(route, previousRoute); if (route is DialogRoute) _log( 'SHOW DIALOG', route.settings, seperateArgumentsToNewLine: true, ); else if (_isModalBottomSheetRoute(route)) _log('SHOW MODEL BOTTOM SHEET', route.settings); else if (route.settings.name != null) _log('PUSH ROUTE', route.settings); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/router/app_pages.dart
import 'package:flutter_mockup_bloc/presentation/modules/navigation/navigation_screen.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_router.dart' as trans show Transition; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_mockup_bloc/presentation/modules/auth/login/login_screen.dart'; import 'package:flutter_mockup_bloc/presentation/router/page_config.dart'; import 'package:flutter_mockup_bloc/presentation/screens/splash_screen.dart'; import 'package:flutter_mockup_bloc/repository/auth/user_info_repository.dart'; import 'package:flutter_mockup_bloc/utils/device/system_utils.dart'; enum AppPages { Splash, Initial, // Auth_Login, // Navigation, // } String _getPageArgumentErrorString(List<String> args) => args.join(', '); Never _areRequired(List<String> properties) { throw ArgumentError.notNull(_getPageArgumentErrorString(properties)); } void _checkMissingRequiredArgumentsAndAssureError( Map<String, dynamic>? arguments, List<String> argNames, ) { try { if (arguments == null) _areRequired(argNames); final List<String> missingArgNames = argNames.where((e) => arguments.containsKey(e) == false).toList(); if (missingArgNames.isNotEmpty) _areRequired(missingArgNames); } catch (e) { SystemUtils.debugLog('AppRouter', e.toString()); rethrow; } } final RegExp _keyPattern = RegExp('(?<=[a-z])[A-Z]'); extension AppPagesExtension on AppPages { String get key => this .toString() .split('.') .last .replaceAll(r'_', '.') .replaceAllMapped( _keyPattern, (Match m) => "_${m.group(0) ?? ''}", ) .toLowerCase(); String get path => "/${this.key.replaceAll(r'.', '/')}"; String get name => path; static PageConfig getPageConfig( AppPages page, Map<String, dynamic>? arguments, ) { switch (page) { case AppPages.Splash: return PageConfig()..pageBuilder = () => SplashScreen(); // TODO: Handle this case. case AppPages.Initial: case AppPages.Auth_Login: final VoidCallback? onSuccess = arguments?['onSuccess']; final bool? canNavigateBack = arguments?['canNavigateBack']; return PageConfig() ..pageBuilder = () => LoginScreen( ); case AppPages.Navigation: // _checkMissingRequiredArgumentsAndAssureError( // arguments, // ['userRepository'], // ); final UserInfoRepository userRepository = arguments!['userRepository']; return PageConfig()..pageBuilder = () => RepositoryProvider( create: (_) => userRepository, child: NavigationScreen(), ); default: throw StateError( "Missing page: ${page.toString()} in AppPagesExtension.getPageConfig()"); } } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/router/app_router.dart
import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; // ignore: implementation_imports import 'package:flutter_bloc/src/bloc_provider.dart' show BlocProviderSingleChildWidget; import 'package:flutter_mockup_bloc/presentation/router/page_config.dart'; import 'app_pages.dart'; import 'app_route_observer.dart'; enum Transition { fadeIn, rightToLeft, downToUp, rightToLeftWithFade, } extension _TransitionExtension on Transition { Offset? get beginOffset { switch (this) { case Transition.rightToLeft: case Transition.rightToLeftWithFade: return const Offset(1.0, 0.0); case Transition.downToUp: return const Offset(0.0, 1.0); default: return null; } } Offset? get endOffset { if (this == Transition.rightToLeftWithFade) return const Offset(-1.0, 0.0); } static Widget builder( BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Transition transition, Curve? curve, Widget child, ) { const zeroOffset = Offset.zero; if (transition == Transition.fadeIn) return FadeTransition(opacity: animation, child: child); if (transition == Transition.rightToLeftWithFade) { return SlideTransition( position: Tween<Offset>( begin: transition.beginOffset, end: zeroOffset, ).animate(animation), child: FadeTransition( opacity: animation, child: SlideTransition( position: Tween<Offset>( begin: zeroOffset, end: transition.endOffset, ).animate(secondaryAnimation), child: child, ), ), ); } final tween = Tween(begin: transition.beginOffset, end: zeroOffset); final curvedAnimation = CurvedAnimation( parent: animation, curve: curve ?? _defaultTransitionCurve, ); return SlideTransition( position: tween.animate(curvedAnimation), child: child, ); } } const Transition _defaultTransition = Transition.rightToLeft; const Curve _defaultTransitionCurve = Curves.easeOutQuad; const Duration _defaultTransitionDuration = Duration(milliseconds: 320); Never _routeObserverIsRequired() { throw '[RouteObserver] from [AppRouter] has not been initialized'; } class AppRouter { static final String _initialPageName = AppPages.Initial.name; static AppRouteObserver? _routeObserver; static AppRouteObserver createRouteObserver() => _routeObserver ??= AppRouteObserver(); static void subscribe(RouteAware routeAware, BuildContext context) { if (_routeObserver == null) _routeObserverIsRequired(); _routeObserver?.subscribe(routeAware, ModalRoute.of(context)!); } static void unsubscribe<R extends Route<dynamic>>(RouteAware routeAware) { if (_routeObserver == null) _routeObserverIsRequired(); _routeObserver?.unsubscribe(routeAware); } static String _duplicatedPage(String name) => "Duplicated Page: $name"; static PageRouteBuilder<T> _createRoute<T>({ required PageBuilder pageBuilder, required RouteSettings settings, Transition? transition, Duration? transitionDuration, Curve? curve, bool opaque = true, bool fullscreenDialog = false, }) => PageRouteBuilder<T>( pageBuilder: (_, __, ___) => pageBuilder(), settings: settings, transitionsBuilder: (context, animation, secondaryAnimation, child) => _TransitionExtension.builder( context, animation, secondaryAnimation, transition ?? _defaultTransition, curve, child, ), transitionDuration: transitionDuration ?? _defaultTransitionDuration, opaque: opaque, fullscreenDialog: fullscreenDialog, ); /// [duration] /// The duration the transition going forwards. /// /// [opaque] /// /// {@macro flutter.widgets.TransitionRoute.opaque} /// /// [fullscreenDialog] /// /// {@macro flutter.widgets.PageRoute.fullscreenDialog} static Future<T?> toPage<T extends Object?, B extends BlocBase<Object?>>( BuildContext context, AppPages page, { Map<String, dynamic>? arguments, B? blocValue, List<BlocProviderSingleChildWidget>? blocProviders, Transition? transition, Curve? curve, Duration? duration, bool? opaque, bool? fullscreenDialog, }) { final NavigatorState navState = Navigator.of(context); final PageConfig pageConfig = AppPagesExtension.getPageConfig(page, arguments); if (pageConfig.preventDuplicates && navState.widget.pages.isNotEmpty && navState.widget.pages.last.name == page.name) throw StateError(_duplicatedPage(page.name)); late PageBuilder pageBuilder; if (blocValue != null) pageBuilder = () => BlocProvider.value( value: blocValue, child: (() => pageConfig.pageBuilder())(), ); else if (blocProviders != null) pageBuilder = () => MultiBlocProvider( providers: blocProviders, child: (() => pageConfig.pageBuilder())(), ); else pageBuilder = pageConfig.pageBuilder; return navState.push<T>( _createRoute( pageBuilder: pageBuilder, settings: RouteSettings(name: page.name, arguments: arguments), transition: transition ?? pageConfig.transition, transitionDuration: duration ?? pageConfig.transitionDuration, curve: curve ?? pageConfig.curve, opaque: opaque ?? pageConfig.opaque, fullscreenDialog: fullscreenDialog ?? pageConfig.fullscreenDialog, ), ); } /// [duration] /// The duration the transition going forwards. static Future<T?>? replaceAllWithPage<T>( BuildContext context, AppPages page, { bool Function(Route<dynamic>)? predicate, Map<String, dynamic>? arguments, Transition? transition, Curve? curve, Duration? duration, }) { final PageConfig pageConfig = AppPagesExtension.getPageConfig(page, arguments); return Navigator.of(context).pushAndRemoveUntil( _createRoute( pageBuilder: pageConfig.pageBuilder, settings: RouteSettings(name: page.name, arguments: arguments), transition: transition ?? pageConfig.transition, transitionDuration: duration ?? pageConfig.transitionDuration, curve: curve ?? pageConfig.curve, opaque: pageConfig.opaque, fullscreenDialog: pageConfig.fullscreenDialog, ), predicate ?? (Route<dynamic> _) => false, ); } static void back<T>( BuildContext context, { T? result, }) => Navigator.pop(context, result); static void backToPageName(BuildContext context, String name) => Navigator.of(context).popUntil((route) { if (route is DialogRoute) return false; String? routeName; if (route is MaterialPageRoute || route is PageRouteBuilder) routeName = route.settings.name; return routeName == name || routeName == _initialPageName; }); static void backToPage(BuildContext context, AppPages page) => backToPageName(context, page.name); /// Trick explained here: https://github.com/flutter/flutter/issues/20451 /// Note `ModalRoute.of(context).settings.name` doesn't always work. static Route? getCurrentNavigatorRoute(BuildContext context) { Route? currentRoute; Navigator.of(context).popUntil((route) { currentRoute = route; return true; }); return currentRoute; } /// Trick explained here: https://github.com/flutter/flutter/issues/20451 /// Note `ModalRoute.of(context).settings.name` doesn't always work. static String? getCurrentNavigatorRouteName(BuildContext context) => getCurrentNavigatorRoute(context)!.settings.name; }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/modules
mirrored_repositories/flutter_mockup_bloc/lib/presentation/modules/navigation/navigation_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/presentation/screens/home_screen.dart'; import 'package:flutter_mockup_bloc/presentation/screens/profile_screen.dart'; import 'package:flutter_mockup_bloc/provider/data_provider_widget.dart'; class NavigationScreen extends StatefulWidget { const NavigationScreen({Key? key}) : super(key: key); @override _NavigationScreenState createState() => _NavigationScreenState(); } class _NavigationScreenState extends State<NavigationScreen> { var _currentIndex = 0; @override Widget build(BuildContext context) { return DataProviderWidget( childBuilderLocalization: (context, localization) => Scaffold( body: IndexedStack( children: const [ HomeScreen(), ProfileScreen(), ], index: _currentIndex, ), bottomNavigationBar: BottomNavigationBar( onTap: _onTap, currentIndex: _currentIndex, items: [ BottomNavigationBarItem( icon: const Icon(Icons.home_filled), label: localization.home, ), BottomNavigationBarItem( icon: const Icon(Icons.person_pin), label: localization.profile, ), ], ), ), ); } void _onTap(int newIndex) { setState(() => _currentIndex = newIndex); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation/modules/auth
mirrored_repositories/flutter_mockup_bloc/lib/presentation/modules/auth/login/login_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_page.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_state_view.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_pages.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_router.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/custom_text_field.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/load_image.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/loading_button.dart'; import 'package:flutter_mockup_bloc/presenters/login_presenter.dart'; import 'package:flutter_mockup_bloc/repository/auth/user_info_repository.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; import 'package:flutter_mockup_bloc/resource/gaps.dart'; class LoginScreen extends StatefulWidget { const LoginScreen({Key? key}) : super(key: key); @override State<LoginScreen> createState() => _LoginScreenState(); } class _LoginScreenState extends State<LoginScreen> with BasePageMixin<LoginScreen, LoginPresenter> implements LoginView{ final TextEditingController username = TextEditingController(); final TextEditingController password = TextEditingController(); final usernameNode = FocusNode(); final passwordNode = FocusNode(); @override void dispose() async { username.dispose(); password.dispose(); usernameNode.dispose(); passwordNode.dispose(); super.dispose(); } @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return SafeArea( child: Scaffold( body: BlocProvider( create: (_) => presenter!.cubit, child: BlocBuilder<LoginCubit, BaseState>( builder: (context, state){ print("state: ${state}"); return SingleChildScrollView( padding: EdgeInsets.symmetric(horizontal: 30), child: Container( alignment: Alignment.center, width: screenSize.width / (2 / (screenSize.height / screenSize.width)), constraints: const BoxConstraints(maxWidth: 700), child: AutofillGroup( child: Column( children: <Widget>[ const SizedBox(height: 60), Column( children: <Widget>[ Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ SizedBox( height: 60, child: LoadImage( AppConstants.logo_app, fit: BoxFit.fitHeight, ), ), ], ), ], ), Gaps.vGap80, CustomTextField( key: const Key('loginEmailField'), controller: username, autofillHints: const [AutofillHints.email], showCancelIcon: true, autocorrect: false, enableSuggestions: false, textInputAction: TextInputAction.next, keyboardType: TextInputType.emailAddress, nextNode: passwordNode, decoration: InputDecoration( labelText: AppConstants.user_name_input, hintText: AppConstants.user_name_input_hint, ), ), CustomTextField( key: const Key('loginPasswordField'), autofillHints: const [AutofillHints.password], obscureText: true, showEyeIcon: true, textInputAction: TextInputAction.done, controller: password, focusNode: passwordNode, decoration: InputDecoration( labelText: AppConstants.password_input, hintText: AppConstants.password_input_hint, ), ), Gaps.vGap24, LoadingButton( title: "Đăng nhập", isLoading: state is LoadingState, onSubmit: (){ _login(); }, ) ], ), ), ), ); } ), ), ) ); } void _login() async { if (username.text.isEmpty || password.text.isEmpty) { showToast("Vui lòng nhập đầy đủ thông tin"); } else { presenter!.loginUser(username.text, password.text); } } @override LoginPresenter createPresenter() => LoginPresenter(); @override void initViewDone() { // TODO: implement initViewDone } @override void gotoHome(UserInfoRepository userInfoRepo) { // TODO: implement gotoHome AppRouter.toPage(context, AppPages.Navigation, arguments: {'userRepository': userInfoRepo},); } @override void tryAgain() { // TODO: implement tryAgain } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/profile_screen.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_page.dart'; import 'package:flutter_mockup_bloc/core/view_model/global/global_viewmodel.dart'; import 'package:flutter_mockup_bloc/model/UserItem.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_pages.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_router.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/load_image.dart'; import 'package:flutter_mockup_bloc/presenters/profile_presenter.dart'; import 'package:flutter_mockup_bloc/provider/provider_widget.dart'; import 'package:flutter_mockup_bloc/repository/auth/user_info_repository.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; import 'package:flutter_mockup_bloc/resource/gaps.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization.dart'; import 'package:get_it/get_it.dart'; import 'package:provider/provider.dart'; import 'package:sp_util/sp_util.dart'; class ProfileScreen extends StatefulWidget { const ProfileScreen(); @override _ProfileScreenState createState() => _ProfileScreenState(); } class _ProfileScreenState extends State<ProfileScreen> with BasePageMixin<ProfileScreen, ProfilePresenter> implements ProfileView{ @override Widget build(BuildContext context) { final user = context.read<UserInfoRepository>().userInfo; return ProviderWidget<GlobalViewModel>( create: () => GetIt.I()..init(), consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => Consumer<GlobalViewModel>( builder: (context, viewModel, child) => Scaffold( backgroundColor: theme.colorsTheme.background, appBar: buildAppBar(context, localization), body: ListView( physics: BouncingScrollPhysics(), children: [ ProfileWidget( imagePath: user.userImage!, onClicked: () async {}, ), const SizedBox(height: 24), buildName(user), const SizedBox(height: 24), Center(child: buildUpgradeButton(localization)), const SizedBox(height: 24), NumbersWidget(localization), const SizedBox(height: 48), buildAbout(user, localization), ], ), ), ), ); } Widget buildName(UserInfo user) => Column( children: [ Text( user.userName!, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24), ), const SizedBox(height: 4), Text( user.userEmail!, style: TextStyle(color: Colors.grey), ) ], ); Widget buildUpgradeButton(Localization localization) => ButtonWidget( text: localization.upToPro, onClicked: () {}, ); Widget buildAbout(UserInfo user, Localization localization) => Container( padding: EdgeInsets.symmetric(horizontal: 48), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( localization.about, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), ), const SizedBox(height: 16), Text( localization.detailAbout, style: TextStyle(fontSize: 16, height: 1.4), ), ], ), ); @override ProfilePresenter createPresenter() => ProfilePresenter(); @override void initViewDone() { // TODO: implement initViewDone } } AppBar buildAppBar(BuildContext context, Localization localization) { final iconMoon = CupertinoIcons.moon_stars; final iconSignOut = CupertinoIcons.arrow_up_right_circle_fill; return AppBar( leading: IconButton( icon: Icon(iconMoon, color: AppColors.primary,), onPressed: () {}, ), backgroundColor: Colors.transparent, elevation: 0, actions: [ GestureDetector( onTap: (){ AppRouter.replaceAllWithPage(context, AppPages.Auth_Login); SpUtil.putString(AppConstants.accessToken, ""); SpUtil.putString(AppConstants.refreshToken, ""); }, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: Row( children: [ Text(localization.logOut, style: TextStyle(color: AppColors.primary),), Gaps.hGap5, Icon(iconSignOut, color: AppColors.primary) ], ), ), ) ], ); } class ButtonWidget extends StatelessWidget { final String text; final VoidCallback onClicked; const ButtonWidget({ Key? key, required this.text, required this.onClicked, }) : super(key: key); @override Widget build(BuildContext context) => ElevatedButton( style: ElevatedButton.styleFrom( shape: StadiumBorder(), onPrimary: Colors.white, padding: EdgeInsets.symmetric(horizontal: 32, vertical: 12), ), child: Text(text), onPressed: onClicked, ); } class NumbersWidget extends StatelessWidget { final Localization localization; NumbersWidget(this.localization); @override Widget build(BuildContext context) => Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ buildButton(context, '4.8', localization.ranking), buildDivider(), buildButton(context, '35', localization.following), buildDivider(), buildButton(context, '50', localization.followers), ], ); Widget buildDivider() => Container( height: 24, child: VerticalDivider(), ); Widget buildButton(BuildContext context, String value, String text) => MaterialButton( padding: EdgeInsets.symmetric(vertical: 4), onPressed: () {}, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ Text( value, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24), ), SizedBox(height: 2), Text( text, style: TextStyle(fontWeight: FontWeight.bold), ), ], ), ); } class ProfileWidget extends StatelessWidget { final String imagePath; final VoidCallback onClicked; const ProfileWidget({ Key? key, required this.imagePath, required this.onClicked, }) : super(key: key); @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.primary; return Center( child: Stack( children: [ buildImage(), Positioned( bottom: 0, right: 4, child: buildEditIcon(color), ), ], ), ); } Widget buildImage() { return ClipOval( child: Material( color: Colors.transparent, child: LoadImage(imagePath, width: 128, height: 128, fit: BoxFit.cover,), ), ); } Widget buildEditIcon(Color color) => buildCircle( color: Colors.white, all: 3, child: buildCircle( color: color, all: 8, child: Icon( Icons.edit, color: Colors.white, size: 20, ), ), ); Widget buildCircle({ required Widget child, required double all, required Color color, }) => ClipOval( child: Container( padding: EdgeInsets.all(all), color: color, child: child, ), ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/home_screen.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_mockup_bloc/common/theme/app_border_and_radius.dart'; import 'package:flutter_mockup_bloc/common/theme/app_padding.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_page.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_state_view.dart'; import 'package:flutter_mockup_bloc/presentation/screens/list_online_screen.dart'; import 'package:flutter_mockup_bloc/presentation/screens/say_hi_screen.dart'; import 'package:flutter_mockup_bloc/presentation/screens/list_offline_screen.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/custom_tab_bar.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/scafold/custom_scaffold.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/widget_utils.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/dialog/select_language_dialog.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/dialog/select_theme_dialog.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/drawer/custom_drawer.dart'; import 'package:flutter_mockup_bloc/presenters/home_presenter.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_text_styles.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({Key? key}) : super(key: key); @override State<HomeScreen> createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> with BasePageMixin<HomeScreen, HomePresenter> implements HomeView{ final ListOnlineHandleDataFromNetwork controller = new ListOnlineHandleDataFromNetwork(); final RefreshController _refreshController = RefreshController(initialRefresh: false); @override void initState() { // TODO: implement initState super.initState(); } @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( // toolbarHeight: height, leading: null, centerTitle: true, title: Text( "Mockup Bloc", style: AppTextStyles.appbarTitle, overflow: TextOverflow.ellipsis, ), // bottom: bottomAppBar, shape: AppBorderAndRadius.defaultAppBarBorder, elevation: 4, shadowColor: AppColors.appBarShadow, ), drawer: CustomDrawer( onTapChangeLanguage: (action){ switch (action){ case Action_Drawer.theme: Navigator.pop(context); showCupertinoDialog( context: context, builder: (context){ return SelectThemeDialog( goBack: (){ Navigator.pop(context); }, ); } ); break; default: Navigator.pop(context); showCupertinoDialog( context: context, builder: (context){ return SelectLanguageDialog( goBack: (){ Navigator.pop(context); }, ); } ); } }, ), body: BlocProvider( create: (_) => presenter!.cubit, child: BlocBuilder<HomeCubit, BaseState>( builder: (context, state){ if (state is LoadSuccessState){ controller.notifyLoadDone(); } return DefaultTabController( length: 2, child: Column( mainAxisSize: MainAxisSize.min, children: [ // Center( // child: WidgetUtils.getCustomTabBar([ // 'DS online', // 'DS Tỉnh/TP từ local', // ]), // ), // SizedBoxExt.h20, // // // Flexible( // child: FlexibleTabBarView( // children: [ // ListOnlineScreen(), // ListOnlineScreen(), // ].map((e) => Padding( // padding: AppPad.horiz20, // child: e, // )).toList(), // ), // ), Container( padding: const EdgeInsets.only( top: 10, ), decoration: BoxDecoration( color: Colors.white, boxShadow: [ BoxShadow( offset: Offset(0, 1), blurRadius: 4, color: AppColors.shadow10, ), ], ), child: Material( type: MaterialType.transparency, child: TabBar( indicatorWeight: 2, indicatorColor: AppColors.primary, unselectedLabelColor: Color(0xFF7B7B7B), labelColor: AppColors.text, tabs: [ Tab(text: 'DS online'), Tab(text: 'DS Tỉnh/TP từ local'), ], ), ), ), SizedBoxExt.h20, Expanded( child: TabBarView( children: [ ListOnlineScreen(handle: this.controller, refreshController: this._refreshController, loadMoreCallback: (){ presenter!.getListAuthor(); },), ListOfflineScreen(presenter!.cubit.listCity), ].map((e) => Padding( padding: AppPad.horiz20, child: e, )).toList(), ), ) ], ), ); }, ), ) ) ); } @override HomePresenter createPresenter() => HomePresenter(); @override void initViewDone() { // TODO: implement initViewDone presenter!.getListCity(context); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/list_online_screen.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_mockup_bloc/model/AuthorResponse.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/author/author_item.dart'; import 'package:flutter_mockup_bloc/presenters/home_presenter.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; class ListOnlineHandleDataFromNetwork { late void Function() notifyLoadDone; } class ListOnlineScreen extends StatelessWidget { final Function()? loadMoreCallback; final ListOnlineHandleDataFromNetwork handle; final RefreshController refreshController; // final HomePresenter presenter; ListOnlineScreen({Key? key, required this.handle, required this.refreshController, this.loadMoreCallback}) : super(key: key){ // print("controller"); // print(this.controller); this.handle.notifyLoadDone = _onLoadFromServerDone; refreshController.footerMode!.addListener(_handleRefreshController); } void _handleRefreshController(){ // print("_refreshController: ${refreshController.footerMode!.value}"); } void _onRefresh() async{ // monitor network fetch await Future.delayed(Duration(milliseconds: 1000)); // if failed,use refreshFailed() refreshController.refreshCompleted(); } void _onLoading() async { // monitor network fetch loadMoreCallback!(); } void _onLoadFromServerDone(){ refreshController.loadComplete(); } @override Widget build(BuildContext context) { return SmartRefresher( enablePullDown: true, enablePullUp: true, header: WaterDropHeader(), footer: CustomFooter( builder: (BuildContext context, LoadStatus? mode){ Widget body ; if(mode==LoadStatus.idle){ body = Text("pull up load"); } else if(mode==LoadStatus.loading){ body = CupertinoActivityIndicator(); } else if(mode == LoadStatus.failed){ body = Text("Load Failed!Click retry!"); } else if(mode == LoadStatus.canLoading){ body = Text("release to load more"); } else{ body = Text("No more Data"); } return Container( height: 55.0, child: Center(child:body), ); }, ), controller: refreshController, onRefresh: _onRefresh, onLoading: _onLoading, child: ListView.builder( // shrinkWrap: true, itemBuilder: (c, i) { ItemsAuthorResponse authorItem = context.read<HomeCubit>().listAuthorsItem[i]; return AuthorItem( model: authorItem, margin: const EdgeInsets.only(bottom: 10), ); }, itemCount: context.read<HomeCubit>().listAuthorsItem.length, ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/splash_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_page.dart'; import 'package:flutter_mockup_bloc/core/mvp/base_state_view.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_pages.dart'; import 'package:flutter_mockup_bloc/presentation/router/app_router.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/common_widget.dart'; import 'package:flutter_mockup_bloc/presenters/splash_presenter.dart'; import 'package:flutter_mockup_bloc/repository/auth/user_info_repository.dart'; import 'package:flutter_mockup_bloc/repository/common_data_repo.dart'; class SplashScreen extends StatefulWidget { const SplashScreen({ Key? key, }) : super(key: key); @override SplashScreenState createState() => SplashScreenState(); } class SplashScreenState extends State<SplashScreen> with BasePageMixin<SplashScreen, SplashPresenter> implements SplashView { @override void initState() { // TODO: implement initState super.initState(); } @override Widget build(BuildContext context) { return Scaffold( // backgroundColor: theme.colorsTheme.primary, body: BlocProvider( create: (_) => presenter!.cubit, child: BlocBuilder<SplashCubit, BaseState>( builder: (context, state) { if (state is LoadSuccessState){ int a = state.model as int; showToast("model: $a"); } print("state: ${state}"); // return const Center( // child: CommonWidget.centerLoadingCircle, // ); return SizedBox(); }, ), ) ); } @override SplashPresenter createPresenter() => new SplashPresenter(); @override void gotoHome(UserInfoRepository userInfoRepository) { // TODO: implement gotoHome AppRouter.toPage( context, AppPages.Navigation, arguments: {'userRepository': userInfoRepository}, ); } @override void gotoLogin() { // TODO: implement gotoLogin AppRouter.toPage( context, AppPages.Auth_Login, arguments: {'canNavigateBack': true}, ); } @override void initViewDone() { // TODO: implement initViewDone WidgetsBinding.instance?.addPostFrameCallback((_) { context.read<CommonDataRepo>().loadCommonData(); }); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/say_hi_screen.dart
import 'package:flutter/material.dart'; class SayHiScreen extends StatefulWidget { const SayHiScreen({Key? key}) : super(key: key); @override State<SayHiScreen> createState() => _SayHiScreenState(); } class _SayHiScreenState extends State<SayHiScreen> { @override Widget build(BuildContext context) { return Container(); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/presentation
mirrored_repositories/flutter_mockup_bloc/lib/presentation/screens/list_offline_screen.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/model/selectable_item.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; class ListOfflineScreen extends StatelessWidget { final List<SelectableItem> items; ListOfflineScreen(this.items); final RefreshController _refreshController = RefreshController(initialRefresh: false); void _onRefresh() async{ // monitor network fetch await Future.delayed(Duration(milliseconds: 1000)); // if failed,use refreshFailed() _refreshController.refreshCompleted(); } void _onLoading() async{ // monitor network fetch await Future.delayed(Duration(milliseconds: 1000)); // if failed,use loadFailed(),if no data return,use LoadNodata() _refreshController.loadComplete(); } @override Widget build(BuildContext context) { return Scaffold( body: SmartRefresher( enablePullDown: true, // enablePullUp: true, header: WaterDropHeader(), footer: CustomFooter( builder: (BuildContext context,LoadStatus? mode){ Widget body ; if(mode==LoadStatus.idle){ body = Text("pull up load"); } else if(mode==LoadStatus.loading){ body = CupertinoActivityIndicator(); } else if(mode == LoadStatus.failed){ body = Text("Load Failed!Click retry!"); } else if(mode == LoadStatus.canLoading){ body = Text("release to load more"); } else{ body = Text("No more Data"); } return Container( height: 55.0, child: Center(child:body), ); }, ), controller: _refreshController, onRefresh: _onRefresh, // onLoading: _onLoading, child: ListView.builder( itemBuilder: (c, i) => Card(child: Center(child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(items[i].id), Text(items[i].name), ], ))), itemExtent: 100.0, itemCount: items.length, ), ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/di/injectable.dart
import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_mockup_bloc/di/injectable.config.dart'; import 'package:flutter_mockup_bloc/repository/secure_storage/secure_storage.dart'; import 'package:flutter_mockup_bloc/utils/env/flavor_config.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:get_it/get_it.dart'; import 'package:injectable/injectable.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_mockup_bloc/common/common_export.dart'; final getIt = GetIt.instance; @InjectableInit( initializerName: r'$initGetIt', generateForDir: ['lib'], ) Future<void> configureDependencies(String environment) async { // ignore: avoid_print print('Using environment: $environment'); await $initGetIt(getIt, environment: environment); await getIt.allReady(); } @module abstract class RegisterModule { @singleton @preResolve Future<SharedPreferences> prefs() { if (FlavorConfig.isInTest()) { // ignore: invalid_use_of_visible_for_testing_member SharedPreferences.setMockInitialValues(<String, Object>{}); } return SharedPreferences.getInstance(); } @lazySingleton SharedPreferenceStorage sharedPreferences(SharedPreferences preferences) => SharedPreferenceStorage(preferences); @singleton ConnectivityHelper connectivityHelper() => ConnectivityHelper(); @lazySingleton FlutterSecureStorage storage() => const FlutterSecureStorage(); @lazySingleton SimpleKeyValueStorage keyValueStorage(SharedPreferenceStorage preferences, SecureStorage secure) { if (kIsWeb) return preferences; return secure; } } dynamic _parseAndDecode(String response) => jsonDecode(response); dynamic parseJson(String text) => compute<String, dynamic>(_parseAndDecode, text);
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/di/environments.dart
import 'package:injectable/injectable.dart'; class Environments { static const String prod = 'prod'; static const String dev = 'dev'; static const String dummy = 'dummy'; static const String test = 'test'; } const dummy = Environment(Environments.dummy); // Dev, prod and test are defined in injectable
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/di/injectable.config.dart
// GENERATED CODE - DO NOT MODIFY BY HAND // ************************************************************************** // InjectableConfigGenerator // ************************************************************************** import 'package:dio/dio.dart' as _i20; import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i6; import 'package:get_it/get_it.dart' as _i1; import 'package:injectable/injectable.dart' as _i2; import 'package:shared_preferences/shared_preferences.dart' as _i10; import '../common/common_export.dart' as _i3; import '../core/view_model/global/global_viewmodel.dart' as _i17; import '../repository/debug/debug_repository.dart' as _i4; import '../repository/locale/locale_repository.dart' as _i13; import '../repository/refresh/refresh_repository.dart' as _i16; import '../repository/secure_storage/auth/auth_storage.dart' as _i11; import '../repository/secure_storage/secure_storage.dart' as _i9; import '../repository/shared_prefs/local/local_storage.dart' as _i12; import '../utils/preferences/preferences_storage.dart' as _i5; import 'injectable.dart' as _i21; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars /// initializes the registration of provided dependencies inside of [GetIt] Future<_i1.GetIt> $initGetIt(_i1.GetIt get, {String? environment, _i2.EnvironmentFilter? environmentFilter}) async { final gh = _i2.GetItHelper(get, environment, environmentFilter); final registerModule = _$RegisterModule(); gh.singleton<_i3.ConnectivityHelper>(registerModule.connectivityHelper()); gh.lazySingleton<_i4.DebugRepository>( () => _i4.DebugRepository(get<_i5.SharedPreferenceStorage>())); gh.lazySingleton<_i6.FlutterSecureStorage>(() => registerModule.storage()); gh.lazySingleton<_i9.SecureStorage>( () => _i9.SecureStorage(get<_i6.FlutterSecureStorage>())); await gh.singletonAsync<_i10.SharedPreferences>(() => registerModule.prefs(), preResolve: true); gh.lazySingleton<_i3.SharedPreferenceStorage>( () => registerModule.sharedPreferences(get<_i10.SharedPreferences>())); gh.lazySingleton<_i3.SimpleKeyValueStorage>(() => registerModule.keyValueStorage( get<_i3.SharedPreferenceStorage>(), get<_i9.SecureStorage>())); gh.lazySingleton<_i11.AuthStorage>( () => _i11.AuthStorage(get<_i3.SimpleKeyValueStorage>())); gh.lazySingleton<_i12.LocalStorage>(() => _i12.LocalStorage( get<_i11.AuthStorage>(), get<_i3.SharedPreferenceStorage>())); gh.lazySingleton<_i13.LocaleRepository>( () => _i13.LocaleRepository(get<_i3.SharedPreferenceStorage>())); gh.lazySingleton<_i16.RefreshRepository>( () => _i16.RefreshRepository(get<_i11.AuthStorage>())); gh.factory<_i17.GlobalViewModel>(() => _i17.GlobalViewModel( get<_i13.LocaleRepository>(), get<_i4.DebugRepository>(), get<_i12.LocalStorage>())); return get; } class _$RegisterModule extends _i21.RegisterModule {}
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/common/common_export.dart
library common_export; export '../utils/logging/logging.dart'; export '../utils/env/environment_util.dart'; export '../utils/env/os_info.dart'; export '../utils/preferences/preferences_storage.dart'; export '../utils/restorable/bundle.dart'; export '../utils/restorable/restorable.dart'; export '../utils/storage/simple_key_value_storage.dart'; export '../utils/connectivity/connectivity.dart';
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/constants/app_uris.dart
import 'package:flutter/foundation.dart'; import 'package:flutter_mockup_bloc/utils/extension/string_extension.dart'; abstract class _AppIds { const _AppIds(); String? get androidId => null; String? get iosId => null; } mixin AppStoreUri on _AppIds { String? get nativeAndroid => androidId == null ? null : "market://details?id=$androidId"; String? get androidWeb => androidId == null ? null : "https://play.google.com/store/apps/details?id=$androidId"; String? get nativeIos => iosId == null ? null : "itms-apps://itunes.apple.com/app/apple-store/id$iosId?l=vi"; String? get iosWeb => iosId == null ? null : "https://apps.apple.com/app/apple-store/id$iosId?l=vi"; } /////////////////////////////////////////////////////////////////////////////// class _SkypeApp extends _AppIds with AppStoreUri { const _SkypeApp(); @override String? get androidId => 'com.skype.raider'; @override String? get iosId => '304878510'; } class _HourJobsApp extends _AppIds with AppStoreUri { const _HourJobsApp(); @override String? get androidId => 'vn.timviec365.myapplication'; @override String? get iosId => '1439750359'; } class _BoardingHouseApp extends _AppIds with AppStoreUri { const _BoardingHouseApp(); @override String? get androidId => 'com.nhatro365vn'; } class _TutorHouseApp extends _AppIds with AppStoreUri { const _TutorHouseApp(); @override String? get androidId => 'vn.timviec365.giasu'; } /////////////////////////////////////////////////////////////////////////////// abstract class Hotline { const Hotline(); String get phoneNumber; String get display; @nonVirtual String get urlScheme => phoneNumber.toPhoneLaunchUri; } /////////////////////////////////////////////////////////////////////////////// class _Hotline1 extends Hotline { const _Hotline1(); @override String get phoneNumber => '1900633682'; @override String get display => '1900633682 - phím 1'; } class _Hotline2 extends Hotline { const _Hotline2(); @override String get phoneNumber => '0982079209'; @override String get display => '0982.079.209'; } /////////////////////////////////////////////////////////////////////////////// class AppUris { static const _SkypeApp skypeApp = _SkypeApp(); static const _HourJobsApp hourJobsApp = _HourJobsApp(); static const _BoardingHouseApp boardingHouseApp = _BoardingHouseApp(); static const _TutorHouseApp tutorHouseApp = _TutorHouseApp(); static const _Hotline1 hotline1 = _Hotline1(); static const _Hotline2 hotline2 = _Hotline2(); }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/rive_loading.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/loading/loading_config.dart'; import 'package:rive/rive.dart'; class RiveLoading extends StatelessWidget { final LoadingConfig loadingConfig; const RiveLoading(this.loadingConfig); @override Widget build(BuildContext context) { if (loadingConfig.path?.isEmpty ?? true) return const SizedBox(); var name = loadingConfig.path!; if (name.startsWith('http')) { return Center( child: RiveAnimation.network( name, ), ); } return Center( child: RiveAnimation.asset( name, ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/loading.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/config/configuration.dart'; import 'package:flutter_mockup_bloc/common/loading/image_loading.dart'; import 'package:flutter_mockup_bloc/common/loading/loading_config.dart'; import 'package:flutter_mockup_bloc/common/loading/lottie_loading.dart'; import 'package:flutter_mockup_bloc/common/loading/rive_loading.dart'; /// For Loading Widget Widget kLoadingWidget() { var loadingConfig = LoadingConfig.fromJson(Configurations.lottieLoadingIcon); switch (loadingConfig.layout) { case LoadingLayout.image: return ImageLoading(loadingConfig); case LoadingLayout.rive: return RiveLoading(loadingConfig); case LoadingLayout.lottie: return LottieLoading(loadingConfig); default: return ImageLoading(loadingConfig); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/index.dart
export 'image_loading.dart'; export 'lottie_loading.dart'; export 'rive_loading.dart';
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/lottie_loading.dart
import 'package:flutter/material.dart'; import 'package:lottie/lottie.dart'; import 'loading_config.dart'; class LottieLoading extends StatelessWidget { final LoadingConfig loadingConfig; const LottieLoading(this.loadingConfig); @override Widget build(BuildContext context) { if (loadingConfig.path?.isEmpty ?? true) return const SizedBox(); var name = loadingConfig.path!; if (name.startsWith('http')) { return Center( child: Lottie.network( name, errorBuilder: (_, __, ___) { return const SizedBox(); }, ), ); } return Center( child: Lottie.asset( name, errorBuilder: (_, __, ___) { return const SizedBox(); }, ), ); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/loading_config.dart
enum LoadingLayout { rive, image, lottie } class LoadingConfig { LoadingLayout layout = LoadingLayout.lottie; String? type; num? size; String? path; LoadingConfig({ this.layout = LoadingLayout.lottie, this.type, this.size, this.path, }); LoadingConfig.fromJson(dynamic json) { layout = LoadingLayout.values.firstWhere( (element) => element.toString().split('.').last == json['layout'], orElse: () => LoadingLayout.lottie, ); type = json['type']; size = json['size']; path = json['path']; } Map toJson() { var map = <String, dynamic>{}; map['layout'] = layout.toString().split('.').last; map['type'] = type; map['size'] = size; map['path'] = path; map.removeWhere((key, value) => value == null); return map; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/loading/image_loading.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/loading/loading_config.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/common/load_image.dart'; class ImageLoading extends StatelessWidget { final LoadingConfig loadingConfig; const ImageLoading(this.loadingConfig); @override Widget build(BuildContext context) { if (loadingConfig.path?.isEmpty ?? true) return const SizedBox(); return LoadImage(loadingConfig.path!); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/config/index.dart
import 'package:flutter_mockup_bloc/common/loading/loading_config.dart'; Map<String, dynamic> config = { "loadingIcon": {"size": 30.0, "type": "fadingCube"}, "lottieLoadingIcon": {"path": "https://assets4.lottiefiles.com/packages/lf20_a2chheio.json", "size": 30.0 , "layout": LoadingLayout.lottie}, "lottieLoadingFetch": {"path": "https://assets4.lottiefiles.com/private_files/lf30_fup2uejx.json", "size": 30.0 , "layout": LoadingLayout.lottie}, };
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/config/configuration.dart
import 'package:flutter_mockup_bloc/common/config/default_config.dart'; class Configurations { static Map? _loadingIcon = DefaultConfig.loadingIcon; static Map? _lottieLoadingIcon = DefaultConfig.lottieLoadingIcon; static Map get loadingIcon => _loadingIcon!; static Map get lottieLoadingIcon => _lottieLoadingIcon!; void setConfigurationValues(Map<String, dynamic> value) { _loadingIcon = value['loadingIcon'] ?? DefaultConfig.loadingIcon; _lottieLoadingIcon = value['lottieLoadingIcon'] ?? DefaultConfig.lottieLoadingIcon; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/config/default_config.dart
class DefaultConfig { static Map? loadingIcon; static Map? lottieLoadingIcon; }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/app_border_and_radius.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'ouline_shadow_input_border.dart'; import 'app_decoration.dart'; class AppBorderAndRadius { static final uniformBorder = Border.fromBorderSide(BorderSide( color: AppColors.border, width: 0.5, )); static final tabBarBorder = Border.fromBorderSide(BorderSide( color: AppColors.tabBarBorder, width: 0.5, )); static final Radius defaultRadius = Radius.circular(20); static final Radius formRadius = Radius.circular(48); static final Radius multilineFormRadius = Radius.circular(20); // static final Border defaultBorder = Border.all(color: AppColors.lightGray, width: 0.5); static final BorderRadius defaultBorderRadius = BorderRadius.all(defaultRadius); static final BorderRadius formBorderRadius = BorderRadius.all(formRadius); static final BorderRadius multilineFormBorderRadius = BorderRadius.all(multilineFormRadius); static final BorderRadius mbsBorderRadius = BorderRadius.vertical(top: defaultRadius); static final BorderRadius chatInputFieldBorderRadius = BorderRadius.vertical(top: defaultRadius); static final RoundedRectangleBorder roundedRectangleBorder = RoundedRectangleBorder(borderRadius: defaultBorderRadius); static final RoundedRectangleBorder defaultAppBarBorder = RoundedRectangleBorder( borderRadius: BorderRadius.only( bottomLeft: Radius.circular(30), bottomRight: Radius.circular(30), ), ); static final OutlineInputBorder outlineInputBorder = OutlineInputBorder( borderSide: BorderSide( color: AppColors.lightGray, width: 0.5, ), borderRadius: formBorderRadius, ); static final OutlineShadowInputBorder outlineShadowInputBorder = OutlineShadowInputBorder( borderSide: BorderSide( color: AppColors.lightGray, width: 0.5, ), borderRadius: formBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineShadowInputBorder outlineMultilineInputBorder = OutlineShadowInputBorder( borderSide: BorderSide( color: AppColors.lightGray, width: 0.5, ), borderRadius: multilineFormBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineShadowInputBorder outlineShadowInputDisabledBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.inactive), borderRadius: formBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineInputBorder outlineInputDisabledBorder = OutlineInputBorder( borderSide: BorderSide(color: AppColors.inactive), borderRadius: formBorderRadius, ); static final OutlineShadowInputBorder outlineMultilineInputDisabledBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.inactive), borderRadius: multilineFormBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineShadowInputBorder outlineShadowInputFocusedBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.active), borderRadius: formBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineInputBorder outlineInputFocusedBorder = OutlineInputBorder( borderSide: BorderSide(color: AppColors.active), borderRadius: formBorderRadius, ); static final OutlineShadowInputBorder outlineMultilineInputFocusedBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.active), borderRadius: multilineFormBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineShadowInputBorder outlineShadowInputErrorBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.error), borderRadius: formBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineInputBorder outlineInputErrorBorder = OutlineInputBorder( borderSide: BorderSide(color: AppColors.error), borderRadius: formBorderRadius, ); static final OutlineShadowInputBorder outlineMultilineInputErrorBorder = OutlineShadowInputBorder( borderSide: BorderSide(color: AppColors.error), borderRadius: multilineFormBorderRadius, boxShadow: AppDecoration.formShadow, ); static final OutlineInputBorder chatOutlineInputBorder = OutlineInputBorder( borderSide: BorderSide( color: AppColors.suvaGrey, width: 0.5, ), borderRadius: formBorderRadius, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/app_decoration.dart
import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'app_border_and_radius.dart'; class AppDecoration { static const defaultGradient = LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, stops: const [0, 1], colors: const [ AppColors.primary, Color(0xFF978ECF), ], ); static ui.Gradient getIconGradientShader(Size size) => ui.Gradient.linear( Offset(size.width * 7.443397e-7, size.height * 0.4972973), Offset(size.width, size.height * 0.4972973), const [Color(0xff4C5BD4), Color(0xff978ECF)], const [0, 1], ); static const defaultShadow = [ BoxShadow( offset: Offset(0, 3), blurRadius: 4, color: AppColors.shadow20, ) ]; static const formShadow = [ BoxShadow( offset: Offset(0, 3), blurRadius: 4, color: AppColors.shadow25, ) ]; static const buttonShadow = formShadow; static final BoxDecoration cardBox = BoxDecoration( color: Colors.white, border: AppBorderAndRadius.uniformBorder, boxShadow: defaultShadow, ); static final BoxDecoration tabBar = BoxDecoration( border: AppBorderAndRadius.tabBarBorder, borderRadius: AppBorderAndRadius.defaultBorderRadius, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/app_padding.dart
import 'package:flutter/material.dart'; class AppPad { static const a10 = EdgeInsets.all(10); static const a16 = EdgeInsets.all(16); static const a20 = EdgeInsets.all(20); static const horiz16 = EdgeInsets.symmetric(horizontal: 16); static const vert16 = EdgeInsets.symmetric(vertical: 16); static const horiz20 = EdgeInsets.symmetric(horizontal: 20); static const vert20 = EdgeInsets.symmetric(vertical: 20); static const horiz16Vert10 = EdgeInsets.symmetric(horizontal: 16, vertical: 10); static const horiz16Vert4 = EdgeInsets.symmetric(horizontal: 16, vertical: 4); static const scaffoldListView = EdgeInsets.only( top: 74, // 44 + 30 right: 16, bottom: 16, left: 16, ); static const formFieldContent = EdgeInsets.symmetric( horizontal: 20, vertical: 10, ); static const formFieldPrefixIcon = EdgeInsets.only( top: 8, left: 18, bottom: 8, right: 8, ); static const formFieldSuffixIcon = EdgeInsets.only( top: 8, left: 8, bottom: 8, right: 18, ); static const customTabBarLabel = EdgeInsets.only( top: 8, bottom: 5, left: 16, right: 16 ); static const inputButton = EdgeInsets.symmetric(horizontal: 20); static const inputButtonSuffixIcon = EdgeInsets.symmetric(vertical: 10); }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/theme_data.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/theme/base_theme.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_fonts.dart'; import 'package:flutter_mockup_bloc/utils/env/environment_util.dart'; import 'package:flutter_mockup_bloc/utils/env/flavor_config.dart'; import '../../utils/env/os_info.dart'; class FlutterTemplateThemeData { FlutterTemplateThemeData._(); static final _darkThemeData = ThemeData( fontFamily: AppFonts.body, primaryColor: AppColors.primary, colorScheme: const ColorScheme( primary: AppColors.primary, primaryContainer: AppColors.primaryDark, onPrimary: AppColors.white, secondary: AppColors.accent, secondaryContainer: AppColors.accent, onSecondary: AppColors.white, surface: AppColors.backgroundGrey, onBackground: AppColors.primary, onSurface: AppColors.primary, background: AppColors.backgroundGrey, onError: AppColors.primaryDark, brightness: Brightness.light, error: AppColors.error, ), textSelectionTheme: TextSelectionThemeData( cursorColor: AppColors.accent, selectionHandleColor: AppColors.accent, selectionColor: AppColors.accent.withOpacity(0.4), ), pageTransitionsTheme: PageTransitionsTheme( builders: { TargetPlatform.iOS: const CupertinoPageTransitionsBuilder(), TargetPlatform.android: isInTest ? const FadeUpwardsPageTransitionsBuilder() : BaseThemeData.getCorrectPageTransitionBuilder(OsInfo.instance), }, ), ); static final _lightThemeData = _darkThemeData.copyWith(); static ThemeData darkTheme(TargetPlatform? targetPlatform) { return _darkThemeData.copyWith(platform: targetPlatform); } static ThemeData lightTheme(TargetPlatform? targetPlatform) { return _lightThemeData.copyWith(platform: targetPlatform); } } class FlutterTemplateTextTheme { final TextStyle titleHuge; final TextStyle titleBig; final TextStyle titleNormal; final TextStyle titleSmall; final TextStyle titleListItem; final TextStyle labelButtonBig; final TextStyle labelButtonBigDisabled; final TextStyle labelButtonSmall; final TextStyle labelButtonSmallDisabled; final TextStyle bodyNormal; final TextStyle bodySmall; final TextStyle bodyUltraSmall; final TextStyle infoBodySubHeader; final TextStyle bodyBig; const FlutterTemplateTextTheme({ required this.titleHuge, required this.titleBig, required this.titleNormal, required this.titleSmall, required this.titleListItem, required this.labelButtonBig, required this.labelButtonBigDisabled, required this.labelButtonSmall, required this.labelButtonSmallDisabled, required this.bodyNormal, required this.bodySmall, required this.bodyUltraSmall, required this.infoBodySubHeader, required this.bodyBig, }); } class FlutterTemplateTextThemeExceptions { const FlutterTemplateTextThemeExceptions(); } class FlutterTemplateColorsTheme { final Color text; final Color inverseText; final Color disabledButtonText; final Color primary; final Color secondary; final Color accent; final Color background; final Color inverseBackground; final Color inputFieldFill; final Color disabled; final Color icon; final Color inverseIcon; final Color inverseProgressIndicator; final Color progressIndicator; const FlutterTemplateColorsTheme({ required this.text, required this.inverseText, required this.disabledButtonText, required this.primary, required this.secondary, required this.accent, required this.background, required this.inverseBackground, required this.inputFieldFill, required this.disabled, required this.icon, required this.inverseIcon, required this.inverseProgressIndicator, required this.progressIndicator, }); } class FlutterTemplateTheme { final FlutterTemplateTextTheme coreTextTheme; final FlutterTemplateTextTheme inverseCoreTextTheme; final FlutterTemplateTextTheme accentTextTheme; final FlutterTemplateTextThemeExceptions exceptionsTextTheme; final FlutterTemplateColorsTheme colorsTheme; static final _instanceDark = _fromColorTheme( colorTheme: const FlutterTemplateColorsTheme( text: AppColors.white, inverseText: AppColors.black, disabledButtonText: AppColors.lightGrey, primary: AppColors.primary, accent: AppColors.accent, secondary: AppColors.white, background: AppColors.primary, inverseBackground: AppColors.white, inputFieldFill: AppColors.white, disabled: AppColors.disabledGrey, icon: AppColors.white, inverseIcon: AppColors.black, progressIndicator: AppColors.primary, inverseProgressIndicator: AppColors.white, ), ); static final _instanceLight = _fromColorTheme( colorTheme: const FlutterTemplateColorsTheme( text: AppColors.black, inverseText: AppColors.white, disabledButtonText: AppColors.lightGrey, primary: AppColors.primary, accent: AppColors.accent, secondary: AppColors.black, background: AppColors.white, inverseBackground: AppColors.white, inputFieldFill: AppColors.white, disabled: AppColors.disabledGrey, icon: AppColors.white, inverseIcon: AppColors.black, progressIndicator: AppColors.primary, inverseProgressIndicator: AppColors.white, ), ); static FlutterTemplateTheme _fromColorTheme({required FlutterTemplateColorsTheme colorTheme}) => FlutterTemplateTheme._( colorsTheme: colorTheme, coreTextTheme: FlutterTemplateTextTheme( titleHuge: TextStyle(fontSize: 40, color: colorTheme.text, fontFamily: AppFonts.title, height: 1.2), titleBig: TextStyle(fontSize: 30, color: colorTheme.text, fontFamily: AppFonts.title, height: 1.2), titleNormal: TextStyle(fontSize: 24, color: colorTheme.text, fontFamily: AppFonts.title), titleSmall: TextStyle(fontSize: 18, color: colorTheme.text, fontFamily: AppFonts.title), titleListItem: TextStyle(fontSize: 18, color: colorTheme.text, fontFamily: AppFonts.title, fontWeight: FontWeight.bold), labelButtonBig: TextStyle(fontSize: 16, color: colorTheme.text, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonBigDisabled: TextStyle(fontSize: 16, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmall: TextStyle(fontSize: 14, color: colorTheme.text, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmallDisabled: TextStyle(fontSize: 14, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), bodyBig: TextStyle(fontSize: 18, color: colorTheme.text, fontFamily: AppFonts.body), bodyNormal: TextStyle(fontSize: 16, color: colorTheme.text, fontFamily: AppFonts.body), bodySmall: TextStyle(fontSize: 14, color: colorTheme.text, fontFamily: AppFonts.body), bodyUltraSmall: TextStyle(fontSize: 12, color: colorTheme.text, fontFamily: AppFonts.body), infoBodySubHeader: TextStyle(fontSize: 14, color: colorTheme.text, fontFamily: AppFonts.body, fontWeight: FontWeight.w600), ), inverseCoreTextTheme: FlutterTemplateTextTheme( titleHuge: TextStyle(fontSize: 40, color: colorTheme.inverseText, fontFamily: AppFonts.title, height: 1.2), titleBig: TextStyle(fontSize: 30, color: colorTheme.inverseText, fontFamily: AppFonts.title, height: 1.2), titleNormal: TextStyle(fontSize: 24, color: colorTheme.inverseText, fontFamily: AppFonts.title), titleSmall: TextStyle(fontSize: 18, color: colorTheme.inverseText, fontFamily: AppFonts.title), titleListItem: TextStyle(fontSize: 18, color: colorTheme.inverseText, fontFamily: AppFonts.title, fontWeight: FontWeight.bold), labelButtonBig: TextStyle(fontSize: 16, color: colorTheme.inverseText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonBigDisabled: TextStyle(fontSize: 16, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmall: TextStyle(fontSize: 14, color: colorTheme.inverseText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmallDisabled: TextStyle(fontSize: 14, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), bodyBig: TextStyle(fontSize: 18, color: colorTheme.inverseText, fontFamily: AppFonts.body), bodyNormal: TextStyle(fontSize: 16, color: colorTheme.inverseText, fontFamily: AppFonts.body), bodySmall: TextStyle(fontSize: 14, color: colorTheme.inverseText, fontFamily: AppFonts.body), bodyUltraSmall: TextStyle(fontSize: 12, color: colorTheme.inverseText, fontFamily: AppFonts.body), infoBodySubHeader: TextStyle(fontSize: 14, color: colorTheme.inverseText, fontFamily: AppFonts.body, fontWeight: FontWeight.w600), ), accentTextTheme: FlutterTemplateTextTheme( titleHuge: TextStyle(fontSize: 40, color: colorTheme.accent, fontFamily: AppFonts.title, height: 1.2), titleBig: TextStyle(fontSize: 30, color: colorTheme.accent, fontFamily: AppFonts.title, height: 1.2), titleNormal: TextStyle(fontSize: 24, color: colorTheme.accent, fontFamily: AppFonts.title), titleSmall: TextStyle(fontSize: 18, color: colorTheme.accent, fontFamily: AppFonts.title), titleListItem: TextStyle(fontSize: 18, color: colorTheme.accent, fontFamily: AppFonts.title, fontWeight: FontWeight.bold), labelButtonBig: TextStyle(fontSize: 16, color: colorTheme.accent, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonBigDisabled: TextStyle(fontSize: 16, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmall: TextStyle(fontSize: 14, color: colorTheme.accent, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), labelButtonSmallDisabled: TextStyle(fontSize: 14, color: colorTheme.disabledButtonText, fontFamily: AppFonts.button, fontWeight: FontWeight.bold), bodyBig: TextStyle(fontSize: 18, color: colorTheme.accent, fontFamily: AppFonts.body), bodyNormal: TextStyle(fontSize: 16, color: colorTheme.accent, fontFamily: AppFonts.body), bodySmall: TextStyle(fontSize: 14, color: colorTheme.accent, fontFamily: AppFonts.body), bodyUltraSmall: TextStyle(fontSize: 12, color: colorTheme.accent, fontFamily: AppFonts.body), infoBodySubHeader: TextStyle(fontSize: 14, color: colorTheme.accent, fontFamily: AppFonts.body, fontWeight: FontWeight.w600), ), exceptionsTextTheme: const FlutterTemplateTextThemeExceptions(), ); const FlutterTemplateTheme._({ required this.coreTextTheme, required this.inverseCoreTextTheme, required this.accentTextTheme, required this.exceptionsTextTheme, required this.colorsTheme, }); static FlutterTemplateTheme of(BuildContext context, {bool forceDark = false, bool forceLight = false}) { if (forceDark) return _instanceDark; if (forceLight) return _instanceLight; final theme = FlavorConfig.instance.themeMode; if (theme == ThemeMode.dark) { return _instanceDark; } else if (theme == ThemeMode.light) { return _instanceLight; } final brightness = MediaQuery.of(context).platformBrightness; if (brightness == Brightness.dark) return _instanceDark; return _instanceLight; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/app_form_field.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/common/theme/app_border_and_radius.dart'; import 'package:flutter_mockup_bloc/common/theme/app_decoration.dart'; import 'package:flutter_mockup_bloc/common/theme/app_padding.dart'; import 'package:flutter_mockup_bloc/resource/app_text_styles.dart'; class AppFormField { static final InputDecorationTheme inputDecorationTheme = InputDecorationTheme( hintStyle: AppTextStyles.hintText, errorMaxLines: 2, contentPadding: AppPad.formFieldContent, enabledBorder: AppBorderAndRadius.outlineShadowInputBorder, disabledBorder: AppBorderAndRadius.outlineShadowInputDisabledBorder, focusedBorder: AppBorderAndRadius.outlineShadowInputFocusedBorder, errorBorder: AppBorderAndRadius.outlineShadowInputErrorBorder, focusedErrorBorder: AppBorderAndRadius.outlineShadowInputErrorBorder, filled: true, fillColor: Colors.white, floatingLabelBehavior: FloatingLabelBehavior.never, ); static final InputDecoration shadowInputDecoration = InputDecoration( hintStyle: AppTextStyles.hintText, hintMaxLines: 2, errorMaxLines: 2, helperMaxLines: 2, contentPadding: AppPad.formFieldContent, enabledBorder: AppBorderAndRadius.outlineShadowInputBorder, disabledBorder: AppBorderAndRadius.outlineShadowInputDisabledBorder, focusedBorder: AppBorderAndRadius.outlineShadowInputFocusedBorder, errorBorder: AppBorderAndRadius.outlineShadowInputErrorBorder, focusedErrorBorder: AppBorderAndRadius.outlineShadowInputErrorBorder, filled: true, fillColor: Colors.white, floatingLabelBehavior: FloatingLabelBehavior.never, ); static final InputDecoration outlineInputDecoration = InputDecoration( hintStyle: AppTextStyles.hintText, hintMaxLines: 2, errorMaxLines: 2, helperMaxLines: 2, contentPadding: AppPad.formFieldContent, enabledBorder: AppBorderAndRadius.outlineInputBorder, disabledBorder: AppBorderAndRadius.outlineInputDisabledBorder, focusedBorder: AppBorderAndRadius.outlineInputFocusedBorder, errorBorder: AppBorderAndRadius.outlineInputErrorBorder, focusedErrorBorder: AppBorderAndRadius.outlineInputErrorBorder, filled: true, fillColor: Colors.white, floatingLabelBehavior: FloatingLabelBehavior.never, ); static final InputDecoration multilineShadowInputDecoration = InputDecoration( hintStyle: AppTextStyles.hintText, hintMaxLines: 2, errorMaxLines: 2, contentPadding: AppPad.formFieldContent, enabledBorder: AppBorderAndRadius.outlineMultilineInputBorder, disabledBorder: AppBorderAndRadius.outlineMultilineInputDisabledBorder, focusedBorder: AppBorderAndRadius.outlineMultilineInputFocusedBorder, errorBorder: AppBorderAndRadius.outlineMultilineInputErrorBorder, focusedErrorBorder: AppBorderAndRadius.outlineMultilineInputErrorBorder, filled: true, fillColor: Colors.white, floatingLabelBehavior: FloatingLabelBehavior.never, ); static final BoxDecoration dropdownButton = BoxDecoration( color: Colors.white, border: AppBorderAndRadius.uniformBorder, borderRadius: AppBorderAndRadius.formBorderRadius, boxShadow: AppDecoration.formShadow, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/base_theme.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/utils/env/os_info.dart'; /// Holder class for the theme base. Fills in basic shared properties @immutable class BaseThemeData { /// Gets the base theme to use to build new themes on static ThemeData get baseTheme { return ThemeData( pageTransitionsTheme: PageTransitionsTheme( builders: { TargetPlatform.iOS: const CupertinoPageTransitionsBuilder(), TargetPlatform.android: getCorrectPageTransitionBuilder(OsInfo.instance), }, ), ); } /// Builds the correct page transition based on the current OS static PageTransitionsBuilder getCorrectPageTransitionBuilder(OsInfo info) { if (info.isIOS) return const CupertinoPageTransitionsBuilder(); if (!info.isAndroid) return const ZoomPageTransitionsBuilder(); if (info.isAtLeastAndroid10) { return const ZoomPageTransitionsBuilder(); } else if (info.isAtLeastPie) { return const OpenUpwardsPageTransitionsBuilder(); } return const FadeUpwardsPageTransitionsBuilder(); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/common
mirrored_repositories/flutter_mockup_bloc/lib/common/theme/ouline_shadow_input_border.dart
import 'package:flutter/material.dart'; class OutlineShadowInputBorder extends OutlineInputBorder { /// Creates a rounded rectangle outline border for an [InputDecorator]. /// /// If the [borderSide] parameter is [BorderSide.none], it will not draw a /// border. However, it will still define a shape (which you can see if /// [InputDecoration.filled] is true). /// /// If an application does not specify a [borderSide] parameter of /// value [BorderSide.none], the input decorator substitutes its own, using /// [copyWith], based on the current theme and [InputDecorator.isFocused]. /// /// The [borderRadius] parameter defaults to a value where all four /// corners have a circular radius of 4.0. The [borderRadius] parameter /// must not be null and the corner radii must be circular, i.e. their /// [Radius.x] and [Radius.y] values must be the same. const OutlineShadowInputBorder({ BorderSide borderSide = const BorderSide(), BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)), double gapPadding = 4.0, this.backgroundColor = Colors.white, required this.boxShadow, }) : super( borderSide: borderSide, borderRadius: borderRadius, gapPadding: gapPadding, ); final Color backgroundColor; final List<BoxShadow> boxShadow; /// Draw a rounded rectangle around [rect] using [borderRadius]. /// /// The [borderSide] defines the line's color and weight. @override void paint( Canvas canvas, Rect rect, { double? gapStart, double gapExtent = 0.0, double gapPercentage = 0.0, TextDirection? textDirection, }) { for (final BoxShadow bs in boxShadow) { final Paint paint = bs.toPaint(); final Rect bounds = rect.shift(bs.offset).inflate(bs.spreadRadius); canvas.drawRRect(borderRadius.toRRect(bounds), paint); } final RRect outer = borderRadius.toRRect(rect); final RRect center = outer.deflate(borderSide.width / 2.0); // canvas.drawShadow(Path()..addRRect(center), Colors.black, 4, true); final Paint backgroundPaint = Paint() ..strokeWidth = 0 ..color = backgroundColor ..style = PaintingStyle.fill; canvas.drawRRect(center, backgroundPaint); final Paint borderPaint = borderSide.toPaint(); canvas.drawRRect(center, borderPaint); } @override bool operator ==(Object other) { if (identical(this, other)) return true; if (other.runtimeType != runtimeType) return false; return other is OutlineShadowInputBorder && other.borderSide == borderSide && other.borderRadius == borderRadius && other.gapPadding == gapPadding && other.backgroundColor == backgroundColor && other.boxShadow == boxShadow; } @override int get hashCode => hashValues( borderSide, borderRadius, gapPadding, backgroundColor, boxShadow, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/provider/data_provider_widget.dart
import 'package:flutter/widgets.dart'; import 'package:flutter_mockup_bloc/common/theme/theme_data.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization.dart'; import 'package:flutter_mockup_bloc/provider/theme_provider_widget.dart'; class DataProviderWidget extends BaseThemeProviderWidget<FlutterTemplateTheme, Localization> { const DataProviderWidget({ Widget Function(BuildContext context, FlutterTemplateTheme theme)? childBuilderTheme, Widget Function(BuildContext context, Localization localization)? childBuilderLocalization, Widget Function(BuildContext context, FlutterTemplateTheme theme, Localization localization)? childBuilder, }) : super( childBuilderTheme: childBuilderTheme, childBuilderLocalization: childBuilderLocalization, childBuilder: childBuilder, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/provider/base_provider_widget.dart
import 'package:flutter/widgets.dart'; import 'package:flutter_mockup_bloc/provider/theme_provider_widget.dart'; import 'package:provider/provider.dart'; class BaseProviderWidget<T extends ChangeNotifier, Theme, Localization> extends StatelessWidget { final T? value; final T Function() create; final Widget? child; final Widget Function( BuildContext context, Theme theme, Localization localization)? childBuilder; final Widget Function(BuildContext context, T viewModel, Theme theme, Localization localization)? childBuilderWithViewModel; final Widget? consumerChild; final Widget Function(BuildContext context, T viewModel, Widget? child)? consumer; final Widget Function(BuildContext context, T viewModel, Widget? child, Theme theme, Localization localization)? consumerWithThemeAndLocalization; final bool lazy; const BaseProviderWidget({ required this.create, this.child, this.childBuilder, this.consumer, this.consumerWithThemeAndLocalization, this.consumerChild, this.childBuilderWithViewModel, this.lazy = true, }) : this.value = null; const BaseProviderWidget.value({ required this.value, this.child, this.childBuilder, this.consumer, this.consumerWithThemeAndLocalization, this.consumerChild, this.childBuilderWithViewModel, }) : this.lazy = false, this.create = _notImplemented; @override Widget build(BuildContext context) { final consumerCreator = Builder( builder: (context) { if (consumerWithThemeAndLocalization != null || consumer != null) { return Consumer<T>( child: consumerChild ?? Container(), builder: consumer ?? (context, t, widget) => consumerWithThemeAndLocalization!( context, t, widget, themeLookup(context), localizationLookup(context)), ); } else if (child != null) { return child!; } else if (childBuilder != null) { return childBuilder!( context, themeLookup(context), localizationLookup(context)); } else if (childBuilderWithViewModel != null) { return childBuilderWithViewModel!(context, Provider.of<T>(context), themeLookup(context), localizationLookup(context)); } throw ArgumentError( 'child, childBuilder, childBuilderWithViewModel, consumer or consumerWithThemeAndLocalization should be passed'); }, ); if (value != null) { return ChangeNotifierProvider.value( value: value, child: consumerCreator, ); } return ChangeNotifierProvider<T>( lazy: lazy, child: consumerCreator, create: (context) => create(), ); } static T _notImplemented<T>() { throw UnimplementedError(); } }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/provider/provider_widget.dart
import 'package:flutter/widgets.dart'; import 'package:flutter_mockup_bloc/common/theme/theme_data.dart'; import 'package:flutter_mockup_bloc/provider/base_provider_widget.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization.dart'; class ProviderWidget<T extends ChangeNotifier> extends BaseProviderWidget<T, FlutterTemplateTheme, Localization> { const ProviderWidget({ required T Function() create, Widget? child, Widget Function(BuildContext context, FlutterTemplateTheme theme, Localization localization)? childBuilder, Widget Function(BuildContext context, T viewModel, FlutterTemplateTheme theme, Localization localization)? childBuilderWithViewModel, Widget? consumerChild, Widget Function(BuildContext context, T viewModel, Widget? child)? consumer, Widget Function(BuildContext context, T viewModel, Widget? child, FlutterTemplateTheme theme, Localization localization)? consumerWithThemeAndLocalization, bool lazy = true, }) : super( create: create, child: child, childBuilder: childBuilder, childBuilderWithViewModel: childBuilderWithViewModel, consumerChild: consumerChild, consumer: consumer, consumerWithThemeAndLocalization: consumerWithThemeAndLocalization, lazy: lazy, ); }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/provider/change_notifier_ex.dart
import 'dart:async'; import 'dart:collection'; import 'package:flutter/foundation.dart'; /// Extended version of the foundation's [ChangeNotifier]. /// /// Has helper methods to determine if it has been disposed ([disposed]) and /// convenience methods to register listeners that will be cleaned up when the /// change notifier is disposed [registerDispose()] and [registerDisposeStream()] mixin ChangeNotifierEx implements ChangeNotifier { LinkedList<_ListenerEntry>? _listeners = LinkedList<_ListenerEntry>(); var _disposed = false; final _cleanupList = <DisposeAware>[]; /// Returns `true` if this change notifier has been disposed @protected bool get disposed => _disposed; @override @mustCallSuper void dispose() { assert(_debugAssertNotDisposed()); _listeners = null; _disposed = true; _cleanupList ..forEach((element) => element.dispose()) ..clear(); } @protected bool get hasListeners { assert(_debugAssertNotDisposed()); return _listeners!.isNotEmpty; } @override void addListener(VoidCallback listener) { assert(_debugAssertNotDisposed()); _listeners!.add(_ListenerEntry(listener)); } @override void removeListener(VoidCallback listener) { assert(_debugAssertNotDisposed()); for (final _ListenerEntry entry in _listeners!) { if (entry.listener == listener) { entry.unlink(); return; } } } /// Registers an item for automatic cleanup when this item is [disposed] /// /// If this ChangeNotifier has already been [disposed], [DisposeAware.dispose()] /// will be called immediately before returning from this method void registerDispose(DisposeAware toDispose) { if (_disposed) { toDispose.dispose(); return; } _cleanupList.add(toDispose); } /// Registers a stream for automatic cleanup when this item is [disposed]. /// /// In this case, cleanup refers to calling [StreamSubscription.cancel()] /// /// If this ChangeNotifier has already been [disposed], [StreamSubscription.cancel()] /// will be called immediately before returning from this method void registerDisposeStream<T>(StreamSubscription<T> subscription) { registerDispose(_StreamDisposer(subscription)); } @override @protected @visibleForTesting void notifyListeners() { assert(_debugAssertNotDisposed()); if (_listeners!.isEmpty) return; final List<_ListenerEntry> localListeners = List<_ListenerEntry>.from(_listeners!); for (final _ListenerEntry entry in localListeners) { try { if (entry.list != null) entry.listener(); } catch (exception, stack) { FlutterError.reportError(FlutterErrorDetails( exception: exception, stack: stack, library: 'foundation library', context: ErrorDescription( 'while dispatching notifications for $runtimeType'), informationCollector: () sync* { yield DiagnosticsProperty<ChangeNotifier>( 'The $runtimeType sending notification was', this, style: DiagnosticsTreeStyle.errorProperty, ); }, )); } } } bool _debugAssertNotDisposed() { assert(() { if (_listeners == null) { throw FlutterError('A $runtimeType was used after being disposed.\n' 'Once you have called dispose() on a $runtimeType, it can no longer be used.'); } return true; }()); return true; } } class _ListenerEntry extends LinkedListEntry<_ListenerEntry> { _ListenerEntry(this.listener); final VoidCallback listener; } abstract class DisposeAware { void dispose(); } class _StreamDisposer implements DisposeAware { final StreamSubscription _toDispose; _StreamDisposer(this._toDispose); @override void dispose() { _toDispose.cancel(); } }
0
mirrored_repositories/flutter_mockup_bloc/lib
mirrored_repositories/flutter_mockup_bloc/lib/provider/theme_provider_widget.dart
import 'package:flutter/widgets.dart'; late Theme Function<Theme>(BuildContext context) themeLookup; late Localization Function<Localization>(BuildContext context) localizationLookup; class BaseThemeProviderWidget<Theme, Localization> extends StatelessWidget { final Widget Function(BuildContext context, Theme theme)? childBuilderTheme; final Widget Function(BuildContext context, Localization localization)? childBuilderLocalization; final Widget Function( BuildContext context, Theme theme, Localization localization)? childBuilder; const BaseThemeProviderWidget({ this.childBuilderTheme, this.childBuilderLocalization, this.childBuilder, }); @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, constraints) { if (childBuilderTheme != null) { return childBuilderTheme!(context, themeLookup(context)); } else if (childBuilderLocalization != null) { return childBuilderLocalization!(context, localizationLookup(context)); } else if (childBuilder != null) { return childBuilder!( context, themeLookup(context), localizationLookup(context)); } throw ArgumentError( 'childBuilderTheme, childBuilderLocalization or childBuilder should be passed'); }); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/system_utils.dart
import 'dart:async'; import 'dart:developer' show log; import 'dart:io'; import 'dart:typed_data'; import 'package:flutter/foundation.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_mockup_bloc/common/constants/app_uris.dart'; import 'package:flutter_mockup_bloc/core/error_handling/errors.dart'; import 'package:open_file/open_file.dart'; import 'package:path_provider/path_provider.dart'; import 'package:url_launcher/url_launcher.dart'; class SystemUtils { static Future<void> _launchUrl(String url) async { if (await canLaunch(url)) await launch(url); } static Future<void> openUrlInBrowser(String url) => _launchUrl(url); static Future<void> openUri({ required AppStoreUri appStoreUri, String? url, }) async { if (Platform.isAndroid && appStoreUri.androidId != null) { if (await canLaunch(appStoreUri.nativeAndroid!)) await launch(appStoreUri.nativeAndroid!); else openUrlInBrowser(appStoreUri.androidWeb!); } else if (Platform.isIOS && appStoreUri.iosId != null) { if (await canLaunch(appStoreUri.nativeIos!)) await launch(appStoreUri.nativeIos!); else openUrlInBrowser(appStoreUri.iosWeb!); } else if (url != null) await SystemUtils.openUrlInBrowser(url); } static Future<void> openFile(FutureOr<String> filePath) async { final OpenResult result = await OpenFile.open(await filePath); switch (result.type) { case ResultType.noAppToOpen: // throw UnsupportedError('Không có ứng dụng khả dụng để mở file này!'); throw 'Không có ứng dụng khả dụng để mở file này!'; case ResultType.fileNotFound: // throw FileSystemException( // 'Đã có lỗi xảy ra, không tìm thấy file được yêu cầu!'); // throw 'Đã có lỗi xảy ra, không tìm thấy file được yêu cầu!'; // throw 'Không tìm thấy file!'; throw FileNotFound(); case ResultType.permissionDenied: throw PermissionDenied('Vui lòng cấp quyền truy cập!'); default: break; } } static Future<void> launchPhoneUrlScheme(String url) => _launchUrl(url); static Future<Uint8List?> getCachedImageAsByte(String url) async { var cached = await DefaultCacheManager().getFileFromCache(url); if (cached == null) return null; return await cached.file.readAsBytes(); } /* static bool _hasAndroidSdkNumberLoaded = false; static int? _androidSdkInt; static int get _androidSdkNumber => _androidSdkInt ?? 29; static String _externalStoragePublicPathToDownloadDirectory = '/storage/emulated/0/Download'; static Future<String?> getFirstAvailablePathToDownloadDirectory() async { if (Platform.isAndroid) { if (_hasAndroidSdkNumberLoaded == false) { AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; _androidSdkInt = androidInfo.version.sdkInt; _hasAndroidSdkNumberLoaded = true; } if (_androidSdkNumber < 29) return _externalStoragePublicPathToDownloadDirectory; return (await getExternalStorageDirectories( type: StorageDirectory.downloads))?[0] .path; } return null; } */ static Future<String> getAppDirectory() async { if (Platform.isAndroid) return (await getExternalStorageDirectory() ?? await getApplicationSupportDirectory()) .path; else return (await getApplicationSupportDirectory()).path; } static Future<String> getDeviceTemporaryDirectory() async { return (await getTemporaryDirectory()).path; } static Future<String> getPathToDownloadFolder() async => await getAppDirectory(); static Future<String> getPathToDownloadedCvFolder(String folder) async => await getPathToDownloadFolder() + "/downloaded_cv/$folder"; static Future<String> getChatFilePath(String fileName) async => await getPathToDownloadFolder() + "/chat/$fileName"; static debugLog(String source, String message) { if (kDebugMode) log(message, name: source); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/device_utils.dart
import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_mockup_bloc/resource/app_colors.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; /// https://medium.com/gskinner-team/flutter-simplify-platform-screen-size-detection-4cb6fc4f7ed1 class Device { static bool get isDesktop => !isWeb && (isWindows || isLinux || isMacOS); static bool get isMobile => isAndroid || isIOS; static bool get isWeb => kIsWeb; static bool get isWindows => !isWeb && Platform.isWindows; static bool get isLinux => !isWeb && Platform.isLinux; static bool get isMacOS => !isWeb && Platform.isMacOS; static bool get isAndroid => !isWeb && Platform.isAndroid; static bool get isFuchsia => !isWeb && Platform.isFuchsia; static bool get isIOS => !isWeb && Platform.isIOS; static late AndroidDeviceInfo _androidInfo; static Future<void> initDeviceInfo() async { if (isAndroid) { final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); _androidInfo = await deviceInfo.androidInfo; } } /// 使用前记得初始化 static int getAndroidSdkInt() { if (AppConstants.isDriverTest) { return -1; } if (isAndroid) { return _androidInfo.version.sdkInt ?? -1; } else { return -1; } } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/api_data_resolver.dart
import 'package:flutter_mockup_bloc/model/selectable_item.dart'; class ApiDataResolver { /// Trường hơp tỉnh/thành phố là: Toàn quốc static final SelectableItem nationalSelectableItem = SelectableItem(id: '0', name: 'Toàn quốc'); static final SelectableItem allCareerSelectableItem = SelectableItem(id: '0', name: 'Tất cả'); /// Xử lý trường hợp tỉnh/thành phố là: Toàn quốc static bool isNational(String? cityId) => cityId == nationalSelectableItem.id; /// Xử lý trường hợp tỉnh/thành phố là: Toàn quốc static String resolveCityName({ required String cityId, required String? cityName, }) => isNational(cityId) ? nationalSelectableItem.name : cityName!; /// Xử lý trường hợp tỉnh/thành phố là: Toàn quốc static String resolveDistrictName({ required String cityId, required String districtName, }) => isNational(cityId) ? '' : districtName; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/other_utils.dart
import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:sp_util/sp_util.dart'; class Utils { } /// String 空安全处理 extension StringExtension on String? { String get nullSafe => this ?? ''; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/image_utils.dart
import 'package:cached_network_image/cached_network_image.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; class ImageUtils { static ImageProvider getAssetImage(String name, {ImageFormat format = ImageFormat.png}) { return AssetImage(getImgPath(name, format: format)); } static String getImgPath(String name, {ImageFormat format = ImageFormat.png}) { return 'assets/images/$name.${format.value}'; } static ImageProvider getImageProvider(String? imageUrl, {String holderImg = 'none'}) { if (TextUtil.isEmpty(imageUrl)) { return AssetImage(getImgPath(holderImg)); } return CachedNetworkImageProvider(imageUrl!); } } enum ImageFormat { png, jpg, gif, webp } extension ImageFormatExtension on ImageFormat { String get value => ['png', 'jpg', 'gif', 'webp'][index]; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/device/toast_utils.dart
import 'package:oktoast/oktoast.dart'; /// Toast工具类 class Toast { static void show(String? msg, {int duration = 2000}) { if (msg == null) { return; } showToast( msg, duration: Duration(milliseconds: duration), dismissOtherToast: true ); } static void cancelToast() { dismissAllToast(); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/future/future_helper.dart
import 'package:tuple/tuple.dart'; /// Waits for both futures and returns a future containing a [Tuple2] with the /// results of both futures Future<Tuple2<A, B>> await2<A, B>(Future<A> a, Future<B> b) { return Future.wait([a, b]).then((values) => Tuple2.fromList(values)); } /// Waits for all futures and returns a future containing a [Tuple3] with the /// results of all futures Future<Tuple3<A, B, C>> await3<A, B, C>( Future<A> a, Future<B> b, Future<C> c, ) { return Future.wait([a, b, c]).then((values) => Tuple3.fromList(values)); } /// Waits for all futures and returns a future containing a [Tuple4] with the /// results of all futures Future<Tuple4<A, B, C, D>> await4<A, B, C, D>( Future<A> a, Future<B> b, Future<C> c, Future<D> d, ) { return Future.wait([a, b, c, d]).then((values) => Tuple4.fromList(values)); } /// Waits for all futures and returns a future containing a [Tuple5] with the /// results of all futures Future<Tuple5<A, B, C, D, E>> await5<A, B, C, D, E>( Future<A> a, Future<B> b, Future<C> c, Future<D> d, Future<E> e, ) { return Future.wait([a, b, c, d, e]).then((values) => Tuple5.fromList(values)); } /// Waits for all futures and returns a future containing a [Tuple6] with the /// results of all futures Future<Tuple6<A, B, C, D, E, F>> await6<A, B, C, D, E, F>(Future<A> a, Future<B> b, Future<C> c, Future<D> d, Future<E> e, Future<F> f) { return Future.wait([a, b, c, d, e, f]) .then((values) => Tuple6.fromList(values)); } /// Waits for all futures and returns a future containing a [Tuple7] with the /// results of all futures Future<Tuple7<A, B, C, D, E, F, G>> await7<A, B, C, D, E, F, G>( Future<A> a, Future<B> b, Future<C> c, Future<D> d, Future<E> e, Future<F> f, Future<G> g, ) { return Future.wait([a, b, c, d, e, f, g]) .then((values) => Tuple7.fromList(values)); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/locale/localization_fallback_cupertino_delegate.dart
import 'package:flutter/cupertino.dart'; class FallbackCupertinoLocalisationsDelegate extends LocalizationsDelegate<CupertinoLocalizations> { const FallbackCupertinoLocalisationsDelegate(); static const FallbackCupertinoLocalisationsDelegate delegate = FallbackCupertinoLocalisationsDelegate(); @override bool isSupported(Locale locale) => true; @override Future<CupertinoLocalizations> load(Locale locale) => DefaultCupertinoLocalizations.load(locale); @override bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => true; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/locale/localization_delegate.dart
import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_overrides.dart'; //============================================================// //THIS FILE IS AUTO GENERATED. DO NOT EDIT// //============================================================// typedef LocaleFilter = bool Function(String languageCode); class LocalizationDelegate extends LocalizationsDelegate<Localization> { static LocaleFilter? localeFilter; static const defaultLocale = Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: null); static const _supportedLocales = [ Locale.fromSubtags(languageCode: 'vi', scriptCode: null, countryCode: null), Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: null), ]; static List<String> get supportedLanguages { final supportedLanguageTags = _supportedLocales.map((e) => e.toLanguageTag()).toList(growable: false); if (localeFilter == null) return supportedLanguageTags; return supportedLanguageTags.where((element) => localeFilter?.call(element) ?? true).toList(); } static List<Locale> get supportedLocales { if (localeFilter == null) return _supportedLocales; return _supportedLocales.where((element) => localeFilter?.call(element.toLanguageTag()) ?? true).toList(); } LocalizationOverrides? localizationOverrides; Locale? newLocale; Locale? activeLocale; final bool useCaching; bool showLocalizationKeys; LocalizationDelegate({ this.newLocale, this.localizationOverrides, this.showLocalizationKeys = false, this.useCaching = !kDebugMode, }) { if (newLocale != null) { activeLocale = newLocale; } } @override bool isSupported(Locale locale) => supportedLanguages.contains(locale.toLanguageTag()); @override Future<Localization> load(Locale locale) async { final newActiveLocale = newLocale ?? locale; activeLocale = newActiveLocale; return Localization.load( newActiveLocale, localizationOverrides: localizationOverrides, showLocalizationKeys: showLocalizationKeys, useCaching: useCaching, ); } @override bool shouldReload(LocalizationsDelegate<Localization> old) => true; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/locale/localization.dart
import 'dart:convert'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_overrides.dart'; //============================================================// //THIS FILE IS AUTO GENERATED. DO NOT EDIT// //============================================================// class Localization { var _localisedValues = <String, dynamic>{}; var _localisedOverrideValues = <String, dynamic>{}; static Localization of(BuildContext context) => Localizations.of<Localization>(context, Localization)!; /// The locale is used to get the correct json locale. /// It can later be used to check what the locale is that was used to load this Localization instance. final Locale locale; Localization({required this.locale}); static Future<Localization> load(Locale locale, { LocalizationOverrides? localizationOverrides, bool showLocalizationKeys = false, bool useCaching = true, }) async { final localizations = Localization(locale: locale); if (showLocalizationKeys) { return localizations; } if (localizationOverrides != null) { final overrideLocalizations = await localizationOverrides.getOverriddenLocalizations(locale); localizations._localisedOverrideValues = overrideLocalizations; } final jsonContent = await rootBundle.loadString('assets/locale/${locale.toLanguageTag()}.json', cache: useCaching); localizations._localisedValues = json.decode(jsonContent) as Map<String, dynamic>; // ignore: avoid_as return localizations; } String _t(String key, {List<dynamic>? args}) { try { final value = (_localisedOverrideValues[key] ?? _localisedValues[key]) as String?; if (value == null) return key; if (args == null || args.isEmpty) return value; var newValue = value; // ignore: avoid_annotating_with_dynamic args.asMap().forEach((index, dynamic arg) => newValue = _replaceWith(newValue, arg, index + 1)); return newValue; } catch (e) { return '⚠$key⚠'; } } String _replaceWith(String value, Object? arg, int argIndex) { if (arg == null) return value; if (arg is String) { return value.replaceAll('%$argIndex\$s', arg); } else if (arg is num) { return value.replaceAll('%$argIndex\$d', '$arg'); } return value; } /// Translations: /// /// nl: **'Animaties'** /// /// en: **'Animations'** String get debugAnimationsTitle => _t(LocalizationKeys.debugAnimationsTitle); /// Translations: /// /// nl: **'Database'** /// /// en: **'Database'** String get debugDatabase => _t(LocalizationKeys.debugDatabase); /// Translations: /// /// nl: **'Bekijk de licenties'** /// /// en: **'View licenses'** String get debugLicensesGoTo => _t(LocalizationKeys.debugLicensesGoTo); /// Translations: /// /// nl: **'Licenties'** /// /// en: **'Licenses'** String get debugLicensesTitle => _t(LocalizationKeys.debugLicensesTitle); /// Translations: /// /// nl: **'Huidige taal: [arg1 string]'** /// /// en: **'Current language: [arg1 string]'** String debugLocaleCurrentLanguage(String arg1) => _t(LocalizationKeys.debugLocaleCurrentLanguage, args: <dynamic>[arg1]); /// Translations: /// /// nl: **'Selecteer uw taal'** /// /// en: **'Select your language'** String get debugLocaleSelector => _t(LocalizationKeys.debugLocaleSelector); /// Translations: /// /// nl: **'Taal'** /// /// en: **'Language'** String get debugLocaleTitle => _t(LocalizationKeys.debugLocaleTitle); /// Translations: /// /// nl: **'Native brug'** /// /// en: **'Native bridge'** String get debugNativeBridge => _t(LocalizationKeys.debugNativeBridge); /// Translations: /// /// nl: **'Stuur native log'** /// /// en: **'Send native log'** String get debugNativeBridgeLog => _t(LocalizationKeys.debugNativeBridgeLog); /// Translations: /// /// nl: **'Toon vertalingen'** /// /// en: **'Show translations'** String get debugShowTranslations => _t(LocalizationKeys.debugShowTranslations); /// Translations: /// /// nl: **'Trage animaties'** /// /// en: **'Slow animations'** String get debugSlowAnimations => _t(LocalizationKeys.debugSlowAnimations); /// Translations: /// /// nl: **'Huidig platfrom: [arg1 string]'** /// /// en: **'Current platfrom: [arg1 string]'** String debugTargetPlatformSubtitle(String arg1) => _t(LocalizationKeys.debugTargetPlatformSubtitle, args: <dynamic>[arg1]); /// Translations: /// /// nl: **'Doelplatform'** /// /// en: **'Target platfrom'** String get debugTargetPlatformTitle => _t(LocalizationKeys.debugTargetPlatformTitle); /// Translations: /// /// nl: **'Thema'** /// /// en: **'Theme'** String get debugThemeTitle => _t(LocalizationKeys.debugThemeTitle); /// Translations: /// /// nl: **'Debuggen'** /// /// en: **'Debug'** String get debugTitle => _t(LocalizationKeys.debugTitle); /// Translations: /// /// nl: **'Vertaling sluitels'** /// /// en: **'Translation Keys'** String get debugTranslationsTitle => _t(LocalizationKeys.debugTranslationsTitle); /// Translations: /// /// nl: **'Toon database'** /// /// en: **'View database'** String get debugViewDatabase => _t(LocalizationKeys.debugViewDatabase); /// Translations: /// /// nl: **'Foute request error'** /// /// en: **'Bad request error'** String get errorBadRequest => _t(LocalizationKeys.errorBadRequest); /// Translations: /// /// nl: **'Je hebt een programmeerfout gemaakt'** /// /// en: **'You coded something wrong'** String get errorDuringDev => _t(LocalizationKeys.errorDuringDev); /// Translations: /// /// nl: **'Geen toegang error'** /// /// en: **'Forbidden error'** String get errorForbidden => _t(LocalizationKeys.errorForbidden); /// Translations: /// /// nl: **'Er liep iets mis'** /// /// en: **'Something went wrong'** String get errorGeneral => _t(LocalizationKeys.errorGeneral); /// Translations: /// /// nl: **'Er liep iets mis (code: [arg1 string])'** /// /// en: **'Something went wrong (code: [arg1 string])'** String errorGeneralWithCode(String arg1) => _t(LocalizationKeys.errorGeneralWithCode, args: <dynamic>[arg1]); /// Translations: /// /// nl: **'Intern server probleem'** /// /// en: **'Internal server error'** String get errorInternalServer => _t(LocalizationKeys.errorInternalServer); /// Translations: /// /// nl: **'Geen internet verbinding beschikbaar'** /// /// en: **'No internet connection available'** String get errorNoNetwork => _t(LocalizationKeys.errorNoNetwork); /// Translations: /// /// nl: **'Ongeautoriseerde fout'** /// /// en: **'Unauthorized error'** String get errorUnauthorized => _t(LocalizationKeys.errorUnauthorized); /// Translations: /// /// nl: **'Android'** /// /// en: **'Android'** String get generalLabelAndroid => _t(LocalizationKeys.generalLabelAndroid); /// Translations: /// /// nl: **'Annuleer'** /// /// en: **'Cancel'** String get generalLabelCancel => _t(LocalizationKeys.generalLabelCancel); /// Translations: /// /// nl: **'Verwijder'** /// /// en: **'Delete'** String get generalLabelDelete => _t(LocalizationKeys.generalLabelDelete); /// Translations: /// /// nl: **'iOS'** /// /// en: **'iOS'** String get generalLabelIos => _t(LocalizationKeys.generalLabelIos); /// Translations: /// /// nl: **'Nee'** /// /// en: **'No'** String get generalLabelNo => _t(LocalizationKeys.generalLabelNo); /// Translations: /// /// nl: **'Ok'** /// /// en: **'Ok'** String get generalLabelOk => _t(LocalizationKeys.generalLabelOk); /// Translations: /// /// nl: **'Opslaan'** /// /// en: **'Save'** String get generalLabelSave => _t(LocalizationKeys.generalLabelSave); /// Translations: /// /// nl: **'Systeem standaard'** /// /// en: **'System default'** String get generalLabelSystemDefault => _t(LocalizationKeys.generalLabelSystemDefault); /// Translations: /// /// nl: **'Ja'** /// /// en: **'Yes'** String get generalLabelYes => _t(LocalizationKeys.generalLabelYes); /// Translations: /// /// nl: **'Instellingen'** /// /// en: **'Settings'** String get settingsTitle => _t(LocalizationKeys.settingsTitle); /// Translations: /// /// nl: **'Vul hier uw todo in'** /// /// en: **'Enter your todo'** String get todoAddInputHint => _t(LocalizationKeys.todoAddInputHint); /// Translations: /// /// nl: **'Todo toevoegen'** /// /// en: **'Add todo'** String get todoAddTitle => _t(LocalizationKeys.todoAddTitle); /// Translations: /// /// nl: **'Er is nog geen data toegevoegd in uw database. Je kan een paar todo's ophalen van een api calll (download icoon) of je kan er zelf toevoegen door op het plus icoon te drukken.'** /// /// en: **'No data added to your database. Fetch some todos with an api call (download icon) or add one yourself by clicking the add icon.'** String get todoEmptyState => _t(LocalizationKeys.todoEmptyState); /// Translations: /// /// nl: **'Todo'** /// /// en: **'Todo'** String get todoTitle => _t(LocalizationKeys.todoTitle); /// Translations: /// /// nl: **'Thema'** /// /// en: **'Theme'** String get debugThemeModeTitle => _t(LocalizationKeys.debugThemeModeTitle); /// Translations: /// /// nl: **'Toon de app in dark mode of light'** /// /// en: **'Show the app in dark mode or light'** String get debugThemeModeSubtitle => _t(LocalizationKeys.debugThemeModeSubtitle); /// Translations: /// /// nl: **'Light'** /// /// en: **'Light'** String get themeModeLabelLight => _t(LocalizationKeys.themeModeLabelLight); /// Translations: /// /// nl: **'Dark'** /// /// en: **'Dark'** String get themeModeLabelDark => _t(LocalizationKeys.themeModeLabelDark); /// Translations: /// /// nl: **'Systeem standaard'** /// /// en: **'System default'** String get themeModeLabelSystem => _t(LocalizationKeys.themeModeLabelSystem); /// String get logOut => _t(LocalizationKeys.logOut); String get home => _t(LocalizationKeys.home); String get profile => _t(LocalizationKeys.profile); String get upToPro => _t(LocalizationKeys.upToPro); String get ranking => _t(LocalizationKeys.ranking); String get following => _t(LocalizationKeys.following); String get followers => _t(LocalizationKeys.followers); String get about => _t(LocalizationKeys.about); String get detailAbout => _t(LocalizationKeys.detailAbout); String getTranslation(String key, {List<dynamic>? args}) => _t(key, args: args ?? <dynamic>[]); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/locale/localization_overrides.dart
import 'package:flutter/widgets.dart'; //============================================================// //THIS FILE IS AUTO GENERATED. DO NOT EDIT// //============================================================// abstract class LocalizationOverrides { Future<void> refreshOverrideLocalizations(); Future<Map<String, dynamic>> getOverriddenLocalizations(Locale locale); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/locale/localization_keys.dart
//============================================================// //THIS FILE IS AUTO GENERATED. DO NOT EDIT// //============================================================// class LocalizationKeys { /// Translations: /// /// nl: **'Animaties'** /// /// en: **'Animations'** static const debugAnimationsTitle = 'debug_animations_title'; /// Translations: /// /// nl: **'Database'** /// /// en: **'Database'** static const debugDatabase = 'debug_database'; /// Translations: /// /// nl: **'Bekijk de licenties'** /// /// en: **'View licenses'** static const debugLicensesGoTo = 'debug_licenses_go_to'; /// Translations: /// /// nl: **'Licenties'** /// /// en: **'Licenses'** static const debugLicensesTitle = 'debug_licenses_title'; /// Translations: /// /// nl: **'Huidige taal: [arg1 string]'** /// /// en: **'Current language: [arg1 string]'** static const debugLocaleCurrentLanguage = 'debug_locale_current_language'; /// Translations: /// /// nl: **'Selecteer uw taal'** /// /// en: **'Select your language'** static const debugLocaleSelector = 'debug_locale_selector'; /// Translations: /// /// nl: **'Taal'** /// /// en: **'Language'** static const debugLocaleTitle = 'debug_locale_title'; /// Translations: /// /// nl: **'Native brug'** /// /// en: **'Native bridge'** static const debugNativeBridge = 'debug_native_bridge'; /// Translations: /// /// nl: **'Stuur native log'** /// /// en: **'Send native log'** static const debugNativeBridgeLog = 'debug_native_bridge_log'; /// Translations: /// /// nl: **'Toon vertalingen'** /// /// en: **'Show translations'** static const debugShowTranslations = 'debug_show_translations'; /// Translations: /// /// nl: **'Trage animaties'** /// /// en: **'Slow animations'** static const debugSlowAnimations = 'debug_slow_animations'; /// Translations: /// /// nl: **'Huidig platfrom: [arg1 string]'** /// /// en: **'Current platfrom: [arg1 string]'** static const debugTargetPlatformSubtitle = 'debug_target_platform_subtitle'; /// Translations: /// /// nl: **'Doelplatform'** /// /// en: **'Target platfrom'** static const debugTargetPlatformTitle = 'debug_target_platform_title'; /// Translations: /// /// nl: **'Thema'** /// /// en: **'Theme'** static const debugThemeTitle = 'debug_theme_title'; /// Translations: /// /// nl: **'Debuggen'** /// /// en: **'Debug'** static const debugTitle = 'debug_title'; /// Translations: /// /// nl: **'Vertaling sluitels'** /// /// en: **'Translation Keys'** static const debugTranslationsTitle = 'debug_translations_title'; /// Translations: /// /// nl: **'Toon database'** /// /// en: **'View database'** static const debugViewDatabase = 'debug_view_database'; /// Translations: /// /// nl: **'Foute request error'** /// /// en: **'Bad request error'** static const errorBadRequest = 'error_bad_request'; /// Translations: /// /// nl: **'Je hebt een programmeerfout gemaakt'** /// /// en: **'You coded something wrong'** static const errorDuringDev = 'error_during_dev'; /// Translations: /// /// nl: **'Geen toegang error'** /// /// en: **'Forbidden error'** static const errorForbidden = 'error_forbidden'; /// Translations: /// /// nl: **'Er liep iets mis'** /// /// en: **'Something went wrong'** static const errorGeneral = 'error_general'; /// Translations: /// /// nl: **'Er liep iets mis (code: [arg1 string])'** /// /// en: **'Something went wrong (code: [arg1 string])'** static const errorGeneralWithCode = 'error_general_with_code'; /// Translations: /// /// nl: **'Intern server probleem'** /// /// en: **'Internal server error'** static const errorInternalServer = 'error_internal_server'; /// Translations: /// /// nl: **'Geen internet verbinding beschikbaar'** /// /// en: **'No internet connection available'** static const errorNoNetwork = 'error_no_network'; /// Translations: /// /// nl: **'Ongeautoriseerde fout'** /// /// en: **'Unauthorized error'** static const errorUnauthorized = 'error_unauthorized'; /// Translations: /// /// nl: **'Android'** /// /// en: **'Android'** static const generalLabelAndroid = 'general_label_android'; /// Translations: /// /// nl: **'Annuleer'** /// /// en: **'Cancel'** static const generalLabelCancel = 'general_label_cancel'; /// Translations: /// /// nl: **'Verwijder'** /// /// en: **'Delete'** static const generalLabelDelete = 'general_label_delete'; /// Translations: /// /// nl: **'iOS'** /// /// en: **'iOS'** static const generalLabelIos = 'general_label_ios'; /// Translations: /// /// nl: **'Nee'** /// /// en: **'No'** static const generalLabelNo = 'general_label_no'; /// Translations: /// /// nl: **'Ok'** /// /// en: **'Ok'** static const generalLabelOk = 'general_label_ok'; /// Translations: /// /// nl: **'Opslaan'** /// /// en: **'Save'** static const generalLabelSave = 'general_label_save'; /// Translations: /// /// nl: **'Systeem standaard'** /// /// en: **'System default'** static const generalLabelSystemDefault = 'general_label_system_default'; /// Translations: /// /// nl: **'Ja'** /// /// en: **'Yes'** static const generalLabelYes = 'general_label_yes'; /// Translations: /// /// nl: **'Instellingen'** /// /// en: **'Settings'** static const settingsTitle = 'settings_title'; /// Translations: /// /// nl: **'Vul hier uw todo in'** /// /// en: **'Enter your todo'** static const todoAddInputHint = 'todo_add_input_hint'; /// Translations: /// /// nl: **'Todo toevoegen'** /// /// en: **'Add todo'** static const todoAddTitle = 'todo_add_title'; /// Translations: /// /// nl: **'Er is nog geen data toegevoegd in uw database. Je kan een paar todo's ophalen van een api calll (download icoon) of je kan er zelf toevoegen door op het plus icoon te drukken.'** /// /// en: **'No data added to your database. Fetch some todos with an api call (download icon) or add one yourself by clicking the add icon.'** static const todoEmptyState = 'todo_empty_state'; /// Translations: /// /// nl: **'Todo'** /// /// en: **'Todo'** static const todoTitle = 'todo_title'; /// Translations: /// /// nl: **'Thema'** /// /// en: **'Theme'** static const debugThemeModeTitle = 'debug_theme_mode_title'; /// Translations: /// /// nl: **'Toon de app in dark mode of light'** /// /// en: **'Show the app in dark mode or light'** static const debugThemeModeSubtitle = 'debug_theme_mode_subtitle'; /// Translations: /// /// nl: **'Light'** /// /// en: **'Light'** static const themeModeLabelLight = 'theme_mode_label_light'; /// Translations: /// /// nl: **'Dark'** /// /// en: **'Dark'** static const themeModeLabelDark = 'theme_mode_label_dark'; /// Translations: /// /// nl: **'Systeem standaard'** /// /// en: **'System default'** static const themeModeLabelSystem = 'theme_mode_label_System'; static const logOut = 'log_out'; static const home = 'home'; static const profile = 'profile'; static const upToPro = 'up_to_pro'; static const ranking = 'ranking'; static const following = 'following'; static const followers = 'followers'; static const about = 'about'; static const detailAbout = 'detail_about'; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/os_info.dart
import 'package:flutter/cupertino.dart'; import 'impl/os_info_stub.dart' if (dart.library.io) 'impl/os_info_io.dart'; /// Helper class containing information about the OS that the app /// is currently running on @immutable class OsInfo { /// The android sdk version int (if the app is running native). Eg: 21 final int androidSdk; /// The ios major and minor version (if the app is running native). Eg: 14.4 final double iosVersion; /// Indicates that this is a non-native application final bool isWeb; static OsInfo? _instance; /// Returns true if the app is running natively on android bool get isAndroid => androidSdk > 0; /// Returns true if the app is running natively on ios bool get isIOS => iosVersion > 0; /// Returns true if the app is running natively on android 10 and higher bool get isAtLeastAndroid10 => androidSdk >= 29; /// Returns true if the app is running natively on android P and higher bool get isAtLeastPie => androidSdk >= 28; /// Returns true if the app is running natively on at least ios 13 bool get isIOS13OrAbove => iosVersion >= 13; /// Initializes the os info static Future<void> init() async { if (_instance == null) { final config = await initOsConfig(); _instance ??= OsInfo(config.androidSdk, config.iosVersion, config.isWeb); } } @visibleForTesting OsInfo(this.androidSdk, this.iosVersion, this.isWeb); /// Returns the [OsInfo] instance. Call [init] first! static OsInfo get instance => _instance!; } final bool isDeviceAndroid = platformIsAndroid; final bool isDeviceIOS = platformIsIOS;
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/flavor_config.dart
import 'package:flutter/material.dart'; enum Flavor { test, dummy, dev, //We use DEV instead of DEBUG because android already has a release type Debug. alpha, beta, prod, } class FlavorValues { final String baseUrl; final bool logNetworkInfo; final bool showFullErrorMessages; const FlavorValues({ required this.baseUrl, required this.logNetworkInfo, required this.showFullErrorMessages, }); } class FlavorConfig { double devicePixelRatio = 1; final Flavor flavor; final String name; final Color color; final FlavorValues values; ThemeMode themeMode; static FlavorConfig? _instance; factory FlavorConfig({ required Flavor flavor, required String name, required Color color, required FlavorValues values, ThemeMode themeMode = ThemeMode.system, }) => _instance = FlavorConfig._internal(flavor, name, color, values, themeMode); FlavorConfig._internal(this.flavor, this.name, this.color, this.values, this.themeMode); static FlavorConfig get instance => _instance!; static bool get hasInstance => _instance != null; static bool isProd() => _instance!.flavor == Flavor.prod; static bool isDev() => _instance!.flavor == Flavor.dev; static bool isAlpha() => _instance!.flavor == Flavor.alpha; static bool isBeta() => _instance!.flavor == Flavor.beta; static bool isInTest() => _instance!.flavor == Flavor.test; static bool isDummy() => _instance!.flavor == Flavor.dummy; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/environment_util.dart
import 'package:flutter/foundation.dart'; import 'impl/environment_util_stub.dart' if (dart.library.io) 'impl/environment_util_io.dart'; /// Returns true if the code is currently being execute by unit tests bool get isInTest => !kReleaseMode && runInTest; /// Returns true if the current code is executing in release mode const bool isInRelease = kReleaseMode; /// Returns true if the current code is executing in debug mode const bool isInDebug = kDebugMode; /// Returns true if the current code is executing in profile mode const bool isInProfile = kProfileMode;
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/env
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/impl/environment_util_stub.dart
bool get runInTest => false;
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/env
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/impl/environment_util_io.dart
import 'dart:io'; bool get runInTest => Platform.environment.containsKey('FLUTTER_TEST');
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/env
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/impl/os_info_stub.dart
Future<OsConfigInfo> initOsConfig() => Future.value(OsConfigInfo( androidSdk: 0, iosVersion: 0, isWeb: true, )); class OsConfigInfo { final int androidSdk; final double iosVersion; final bool isWeb; OsConfigInfo({ required this.androidSdk, required this.iosVersion, required this.isWeb, }); } final bool platformIsAndroid = false; final bool platformIsIOS = false;
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/env
mirrored_repositories/flutter_mockup_bloc/lib/utils/env/impl/os_info_io.dart
import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; Future<OsConfigInfo> initOsConfig({ DeviceInfoPlugin? Function()? deviceInfoPluginProvider, bool? isAndroidOverride, bool? isIOSOverride, }) async { if (isAndroidOverride ?? Platform.isAndroid) { final deviceInfo = deviceInfoPluginProvider?.call() ?? DeviceInfoPlugin(); final androidInfo = await deviceInfo.androidInfo; final androidSdk = androidInfo.version.sdkInt; return OsConfigInfo( androidSdk: androidSdk ?? 0, iosVersion: 0, isWeb: false); } else if (isIOSOverride ?? Platform.isIOS) { final deviceInfo = deviceInfoPluginProvider?.call() ?? DeviceInfoPlugin(); final iosInfo = await deviceInfo.iosInfo; final iosVersion = iosInfo.systemVersion ?? ''; final lastIndexPoint = iosVersion.lastIndexOf('.'); final versionLength = iosVersion.length; final version = lastIndexPoint != -1 ? iosVersion.replaceRange(lastIndexPoint, versionLength, '') : iosVersion; final iosVersionValue = double.tryParse(version) ?? 0; return OsConfigInfo( androidSdk: 0, iosVersion: iosVersionValue, isWeb: false); } else { return OsConfigInfo(androidSdk: 0, iosVersion: 0, isWeb: false); } } class OsConfigInfo { final int androidSdk; final double iosVersion; final bool isWeb; OsConfigInfo({ required this.androidSdk, required this.iosVersion, required this.isWeb, }); } final bool platformIsAndroid = Platform.isAndroid; final bool platformIsIOS = Platform.isIOS;
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/connectivity/connectivity.dart
import 'package:connectivity_plus/connectivity_plus.dart'; /// Helper to determine if a device has connectivity class ConnectivityHelper { final Connectivity Function()? _connectivityProvider; /// Constructor, optionally takes a [connectivityProvider] to override /// the default [Connectivity] instance ConnectivityHelper({Connectivity Function()? connectivityProvider}) : _connectivityProvider = connectivityProvider; /// Returns true if the device is connected to an IP network Future<bool> hasConnection() async { return await (_connectivityProvider?.call() ?? Connectivity()) .checkConnectivity() != ConnectivityResult.none; } /// Returns a stream that monitors the connectivity state of the device Stream<bool> monitorConnection() { return (_connectivityProvider?.call() ?? Connectivity()) .onConnectivityChanged .map((event) => event != ConnectivityResult.none); } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/logging/logging.dart
import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_mockup_bloc/utils/env/environment_util.dart'; import 'package:flutter_mockup_bloc/utils/env/os_info.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:logger/logger.dart'; import 'impl/LoggerPrinter.dart'; abstract class Log { void verbose(String message); void debug(String message); void info(String message); void warning(String message); void error(String message, {dynamic error, StackTrace? trace}); void v(String message) => verbose(message); void d(String message) => debug(message); void i(String message) => info(message); void w(String message) => warning(message); void e(String message, {dynamic error, StackTrace? trace}) => this.error(message, error: error, trace: trace); void logNetworkError(NetworkError error); void logNetworkRequest(RequestOptions request); void logNetworkResponse(Response response); } extension LoggerExtension on Object { Log get logger => PrefixLogger( runtimeType.toString(), LoggingFactory.provide(), ); } Log get staticLogger => LoggingFactory.provide(); class LoggingFactory { static Log? _instance; static Log provide() { return _instance ?? reset(); } static Log reset({bool enabled = isInDebug, bool logNetworkInfo = false}) { return resetWithLogger(enabled ? LoggerLogImpl( _makeLogger(), logNetworkInfo: logNetworkInfo, ) : VoidLogger()); } static Log resetWithLogger(Log logger) { return _instance = logger; } static Logger _makeLogger() { return Logger( printer: _makeLogPrinter(), output: WrappingOutput(print), ); } static LogPrinter _makeLogPrinter() { return OurPrettyPrinter( methodCount: 0, errorMethodCount: 5, lineLength: 50, colors: isDeviceAndroid, printEmojis: true, printTime: true, ); } } @visibleForTesting class WrappingOutput extends LogOutput { final void Function(String) printer; WrappingOutput(this.printer); @override void output(OutputEvent event) { event.lines.forEach(_printWrapped); } void _printWrapped(String line) { final pattern = RegExp('.{1,800}'); pattern.allMatches(line).forEach((match) => printer(match.group(0)!)); } } @visibleForTesting class LoggerLogImpl extends Log { final Logger logger; final bool logNetworkInfo; LoggerLogImpl(this.logger, {required this.logNetworkInfo}); @override void debug(String message) => logger.d(message); @override void error(String message, {error, StackTrace? trace}) => logger.e(message, error, trace); @override void info(String message) => logger.i(message); @override void verbose(String message) => logger.v(message); @override void warning(String message) => logger.w(message); @override void logNetworkError(NetworkError error) { if (!logNetworkInfo) return; final dioError = error; final message = StringBuffer(); final response = dioError.response; final request = dioError.requestOptions; if (response == null) { message ..writeln('request | ${request.method} - url: ${request.uri}') ..writeln('message | ${dioError.message}'); } else { message ..writeln('response.data | ${response.data}') ..writeln('response.headers | ${response.headers}'); } message.writeln( '<--------------- ${request.method} - url: ${request.uri} - status code: ${response?.statusCode ?? 'N/A'}'); this.error(message.toString()); } @override void logNetworkRequest(RequestOptions request) { if (!logNetworkInfo) return; debug('---------------> ${request.method} - url: ${request.uri}'); } @override void logNetworkResponse(Response response) { if (!logNetworkInfo) return; debug( '<--------------- ${response.requestOptions.method} - url: ${response.requestOptions.uri} - status code: ${response.statusCode ?? 'N/A'}'); } } @visibleForTesting class VoidLogger implements Log { @override void d(String message) {} @override void debug(String message) {} @override void e(String message, {error, StackTrace? trace}) {} @override void error(String message, {error, StackTrace? trace}) {} @override void i(String message) {} @override void info(String message) {} @override void v(String message) {} @override void verbose(String message) {} @override void w(String message) {} @override void warning(String message) {} @override void logNetworkError(NetworkError error) {} @override void logNetworkRequest(RequestOptions request) {} @override void logNetworkResponse(Response<dynamic> response) {} } @visibleForTesting class PrefixLogger extends Log { final Log _delegate; final String _name; @visibleForTesting PrefixLogger(this._name, this._delegate); @override void debug(String message) => _delegate.debug('[$_name] $message'); @override void error(String message, {Object? error, StackTrace? trace}) => _delegate.error('[$_name] $message', error: error, trace: trace); @override void info(String message) => _delegate.info('[$_name] $message'); @override void logNetworkError(NetworkError error) => _delegate.logNetworkError(error); @override void logNetworkRequest(RequestOptions request) => _delegate.logNetworkRequest(request); @override void logNetworkResponse(Response<dynamic> response) => _delegate.logNetworkResponse(response); @override void verbose(String message) => _delegate.verbose('[$_name] $message'); @override void warning(String message) => _delegate.warning('[$_name] $message'); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/logging
mirrored_repositories/flutter_mockup_bloc/lib/utils/logging/impl/LoggerPrinter.dart
import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:logger/logger.dart'; /// Adopted from Logger's pretty printer to not include the boxes @visibleForTesting @immutable class OurPrettyPrinter extends LogPrinter { static final levelColors = { Level.verbose: AnsiColor.fg(AnsiColor.grey(0.5)), Level.debug: AnsiColor.none(), Level.info: AnsiColor.fg(12), Level.warning: AnsiColor.fg(208), Level.error: AnsiColor.fg(196), Level.wtf: AnsiColor.fg(199), }; static final levelEmojis = { Level.verbose: '', Level.debug: '🐛 ', Level.info: '💡 ', Level.warning: '⚠️ ', Level.error: '⛔ ', Level.wtf: '👾 ', }; /// Matches a stacktrace line as generated on Android/iOS devices. /// For example: /// #1 Logger.log (package:logger/src/logger.dart:115:29) static final _deviceStackTraceRegex = RegExp(r'#[0-9]+[\s]+(.+) \(([^\s]+)\)'); /// The index which to begin the stack trace at /// /// This can be useful if, for instance, Logger is wrapped in another class and /// you wish to remove these wrapped calls from stack trace final int stackTraceBeginIndex; final int methodCount; final int errorMethodCount; final int lineLength; final bool colors; final bool printEmojis; final bool printTime; OurPrettyPrinter({ this.stackTraceBeginIndex = 0, this.methodCount = 2, this.errorMethodCount = 8, this.lineLength = 120, this.colors = true, this.printEmojis = true, this.printTime = false, }); @override List<String> log(LogEvent event) { var messageStr = stringifyMessage(event.message); String? stackTraceStr; if (event.stackTrace == null) { if (methodCount > 0) { stackTraceStr = formatStackTrace(StackTrace.current, methodCount); } } else if (errorMethodCount > 0) { stackTraceStr = formatStackTrace(event.stackTrace, errorMethodCount); } var errorStr = event.error?.toString(); String? timeStr; if (printTime) { timeStr = getTime(); } return _formatAndPrint( event.level, messageStr, timeStr, errorStr, stackTraceStr, ); } String? formatStackTrace(StackTrace? stackTrace, int methodCount) { var lines = stackTrace.toString().split('\n'); if (stackTraceBeginIndex > 0 && stackTraceBeginIndex < lines.length - 1) { lines = lines.sublist(stackTraceBeginIndex); } var formatted = <String>[]; var count = 0; for (var line in lines) { if (_discardDeviceStacktraceLine(line) || line.isEmpty) { continue; } formatted.add('#$count ${line.replaceFirst(RegExp(r'#\d+\s+'), '')}'); if (++count == methodCount) { break; } } if (formatted.isEmpty) { return null; } else { return formatted.join('\n'); } } bool _discardDeviceStacktraceLine(String line) { var match = _deviceStackTraceRegex.matchAsPrefix(line); if (match == null) { return false; } return match.group(2)!.startsWith('package:logger'); } String getTime() { String _threeDigits(int n) => '$n'.padLeft(3, '0'); String _twoDigits(int n) => '$n'.padLeft(2, '0'); var now = DateTime.now(); var h = _twoDigits(now.hour); var min = _twoDigits(now.minute); var sec = _twoDigits(now.second); var ms = _threeDigits(now.millisecond); return '$h:$min:$sec.$ms'; } String stringifyMessage(dynamic message) { if (message is Map || message is Iterable) { var encoder = JsonEncoder.withIndent(' '); return encoder.convert(message); } else { return message.toString(); } } AnsiColor _getLevelColor(Level level) { if (colors) { return levelColors[level]!; } else { return AnsiColor.none(); } } AnsiColor _getErrorColor(Level level) { if (colors) { if (level == Level.wtf) { return levelColors[Level.wtf]!.toBg(); } else { return levelColors[Level.error]!.toBg(); } } else { return AnsiColor.none(); } } String _getEmoji(Level level) { if (printEmojis) { return levelEmojis[level]!; } else { return ''; } } List<String> _formatAndPrint( Level level, String message, String? time, String? error, String? stacktrace, ) { // This code is non trivial and a type annotation here helps understanding. // ignore: omit_local_variable_types List<String> buffer = []; var color = _getLevelColor(level); final timeInfix = time != null ? '$time ' : ''; final emoji = _getEmoji(level); for (final line in message.split('\n')) { buffer.add(color(' $timeInfix$emoji$line')); } if (error != null) { var errorColor = _getErrorColor(level); for (var line in error.split('\n')) { buffer.add( (time == null ? '' : color(timeInfix)) + errorColor.resetForeground + errorColor(line) + errorColor.resetBackground, ); } } if (stacktrace != null) { for (var line in stacktrace.split('\n')) { buffer.add('$color $timeInfix$line'); } } return buffer; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/internal_server_error.dart
import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class InternalServerError extends NetworkError { static const statusCode = HttpStatus.internalServerError; InternalServerError(DioError dioError, {String? statusCode}) : super(dioError, statusCodeValue: statusCode); @override String getLocalizedKey() => LocalizationKeys.errorInternalServer; @override String? get getErrorCode { if (statusCodeValue == null) return '$statusCode'; return '$statusCode [$statusCodeValue]'; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/code_error.dart
import 'package:flutter_mockup_bloc/utils/env/flavor_config.dart'; import 'package:flutter_mockup_bloc/utils/exception/localized_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class CodeError with LocalizedError { @override String getLocalizedKey() { if (FlavorConfig.isDev()) { return LocalizationKeys.errorDuringDev; } return LocalizationKeys.errorGeneral; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/un_authorized_error.dart
import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class UnAuthorizedError extends NetworkError { static const statusCode = HttpStatus.unauthorized; UnAuthorizedError(DioError dioError, {String? statusCode}) : super(dioError, statusCodeValue: statusCode); @override String getLocalizedKey() => LocalizationKeys.errorUnauthorized; @override String? get getErrorCode { if (statusCodeValue == null) return '$statusCode'; return '$statusCode [$statusCodeValue]'; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/no_internet_error.dart
import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class NoInternetError extends NetworkError { NoInternetError(DioError dioError) : super(dioError); @override String getLocalizedKey() => LocalizationKeys.errorNoNetwork; @override String? get getErrorCode => null; } class NoNetworkError extends Error {}
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/forbidden_error.dart
import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class ForbiddenError extends NetworkError { static const statusCode = HttpStatus.forbidden; ForbiddenError(DioError dioError, {String? statusCode}) : super(dioError, statusCodeValue: statusCode); @override String getLocalizedKey() => LocalizationKeys.errorForbidden; @override String? get getErrorCode { if (statusCodeValue == null) return '$statusCode'; return '$statusCode [$statusCodeValue]'; } static NetworkError parseError(DioError err) { final dynamic data = err.response?.data; if (data is! Map) return ForbiddenError(err); if (!data.containsKey('code')) return ForbiddenError(err); final code = data['code'] as String; switch (code) { default: return ForbiddenError(err); } } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/network_error.dart
import 'package:dio/dio.dart'; import 'localized_error.dart'; /// Base class for network errors abstract class NetworkError extends DioError with LocalizedError { final String? statusCodeValue; NetworkError(DioError dioError, {this.statusCodeValue}) : super( requestOptions: dioError.requestOptions, response: dioError.response, error: dioError.error, type: dioError.type, ); /// Flag indicating if this error should be shown in production bool get showInProduction => true; /// The error code associated with this error String? get getErrorCode; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/general_network_error.dart
import 'package:flutter_mockup_bloc/utils/exception/localized_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class GeneralError with LocalizedError { GeneralError() : super(); @override String getLocalizedKey() => LocalizationKeys.errorGeneral; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/general_error.dart
import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class GeneralNetworkError extends NetworkError { GeneralNetworkError(DioError dioError) : super(dioError); @override String getLocalizedKey() => LocalizationKeys.errorGeneral; @override String? get getErrorCode => null; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/bad_request_error.dart
import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter_mockup_bloc/utils/exception/network_error.dart'; import 'package:flutter_mockup_bloc/utils/locale/localization_keys.dart'; class BadRequestError extends NetworkError { static const statusCode = HttpStatus.badRequest; BadRequestError(DioError dioError, {String? statusCode}) : super(dioError, statusCodeValue: statusCode); @override String getLocalizedKey() => LocalizationKeys.errorBadRequest; @override String? get getErrorCode { if (statusCodeValue == null) return '$statusCode'; return '$statusCode [$statusCodeValue]'; } static NetworkError parseError(DioError err) { final dynamic data = err.response?.data; if (data is! Map) return BadRequestError(err); if (!data.containsKey('code')) return BadRequestError(err); final code = data['code'] as String; switch (code) { default: return BadRequestError(err); } } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/exception/localized_error.dart
mixin LocalizedError { String getLocalizedKey(); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/preferences/preferences_storage.dart
import 'package:flutter_mockup_bloc/utils/storage/simple_key_value_storage.dart'; import 'package:shared_preferences/shared_preferences.dart'; /// Utility class to facilitate storing shared preferences abstract class SharedPreferenceStorage implements SimpleKeyValueStorage { /// Create a new instance of SharedPreferenceStorage factory SharedPreferenceStorage(SharedPreferences preferences) => _SharedPreferenceStorage(preferences); /// Saves the given string [value] to the storage with [key] Future<void> saveString({required String key, required String value}); /// Saves the given boolean [value] to the storage with [key] Future<void> saveBoolean({required String key, required bool value}); /// Saves the given integer [value] to the storage with [key] Future<void> saveInt({required String key, required int value}); /// Saves the given double [value] to the storage with [key] Future<void> saveDouble({required String key, required double value}); /// Retrieves the stored string value for [key]. /// Returns null if the value is not found String? getString(String key); /// Retrieves the stored boolean value for [key]. /// Returns null if the value is not found bool? getBoolean(String key); /// Retrieves the stored integer value for [key]. /// Returns null if the value is not found int? getInt(String key); /// Retrieves the stored double value for [key]. /// Returns null if the value is not found double? getDouble(String key); /// Deletes the value stored for [key] Future<void> deleteKey(String key); /// Returns true if there is a value for [key] bool containsKey(String key); } class _SharedPreferenceStorage implements SharedPreferenceStorage { final SharedPreferences _sharedPreferences; _SharedPreferenceStorage(this._sharedPreferences); @override Future<void> saveString({required String key, required String value}) => _sharedPreferences.setString(key, value); @override Future<void> saveBoolean({required String key, required bool value}) => _sharedPreferences.setBool(key, value); @override Future<void> saveInt({required String key, required int value}) => _sharedPreferences.setInt(key, value); @override Future<void> saveDouble({required String key, required double value}) => _sharedPreferences.setDouble(key, value); @override String? getString(String key) => _sharedPreferences.getString(key); @override bool? getBoolean(String key) => _sharedPreferences.getBool(key); @override int? getInt(String key) => _sharedPreferences.getInt(key); @override double? getDouble(String key) => _sharedPreferences.getDouble(key); @override Future<void> deleteKey(String key) => _sharedPreferences.remove(key); @override bool containsKey(String key) => _sharedPreferences.containsKey(key); @override Future<String?> getValue({required String key}) => Future.value(getString(key)); @override Future<bool> hasValue({required String key}) => Future.value(containsKey(key)); @override Future<void> removeValue({required String key}) => deleteKey(key); @override Future<void> setValue({required String key, required String value}) => saveString(key: key, value: value); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/storage/simple_key_value_storage.dart
/// Simple abstraction for saving / retrieving string values based on string key abstract class SimpleKeyValueStorage { /// Get the value associated with the given key. Returns null if the value does not exist. Future<String?> getValue({required String key}); /// Sets the value to be associated with the given key Future<void> setValue({required String key, required String value}); /// Check if there is a value associated with the given key Future<bool> hasValue({required String key}); /// Removes the value associated with the given key Future<void> removeValue({required String key}); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/restorable/restorable.dart
import 'package:flutter/foundation.dart'; import 'package:flutter_mockup_bloc/utils/restorable/bundle.dart'; /// Base class for restorable change view models abstract class Restorable implements ChangeNotifier { /// Called when the system is restoring or creating a new instance. If the /// passed bundle is null, it is assumed to be a clean restoration without /// previous state void restoreState(Bundle? data); /// Called when the system needs to prepare data for later restoration. You /// should save all relevant required data to restore from later. Keep in mind /// that the system has only a limited amount of space reserved for this data: /// avoid storing large objects. void saveState(Bundle target); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/restorable/bundle.dart
/// Wrapper for storing generic values based on keys. The contained /// values are all serializable using platform channels class Bundle { final _internalMap = <String, Object?>{}; /// Creates an empty bundle Bundle(); /// Creates a bundle from the provided map. The map is assumed to be of type: /// `Map<Object?, Object?>`. See: [asFlatStructure] Bundle.from(Object data) { final source = data as Map<Object?, Object?>; source.forEach((key, value) { if (key != null) { _internalMap[key.toString()] = value; } }); } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putBoolean(String key, bool? value) { if (value == null) { _internalMap.remove(key); } else { _internalMap[key] = value; } } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putInt(String key, int? value) { if (value == null) { _internalMap.remove(key); } else { _internalMap[key] = value; } } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putString(String key, String? value) { if (value == null) { _internalMap.remove(key); } else { _internalMap[key] = value; } } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putBundle(String key, Bundle? bundle) { if (bundle == null) { _internalMap.remove(key); } else { _internalMap[key] = bundle; } } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putDouble(String key, double? value) { if (value == null) { _internalMap.remove(key); } else { _internalMap[key] = value; } } /// Saves the given value to the map for the given key. If the value is null, /// the previous mapping is removed (if any) void putStringList(String key, List<String>? values) { if (values == null) { _internalMap.remove(key); } else { _internalMap[key] = values; } } /// Removes the mapping for the given key (if any) void remove(String key) { _internalMap.remove(key); } /// Force-gets the value for the given key, throws if null or wrong type bool getBoolean(String key) => _internalMap[key] as bool; /// Checks if the bundle contains a value with the given key bool hasKey(String key) => _internalMap.containsKey(key); /// Force-gets the value for the given key, throws if null or wrong type int getInt(String key) => _internalMap[key] as int; /// Force-gets the value for the given key, throws if null or wrong type String getString(String key) => _internalMap[key] as String; /// Force-gets the value for the given key, throws if null or wrong type double getDouble(String key) => _internalMap[key] as double; /// Force-gets the value for the given key, throws if null or wrong type List<String> getStringList(String key) => (_internalMap[key] as List<Object?>).map((e) => e.toString()).toList(); /// Force-gets the value for the given key, throws if null or wrong type Bundle getBundle(String key) { final value = _internalMap[key]; if (value is Bundle) return value; if (value is Map<Object?, Object?>) return Bundle.from(value); throw FormatException('$value is not a bundle'); } /// Gets the value for the given key, returns null if null or wrong type bool? optBoolean(String key) { final value = _internalMap[key]; return value is bool ? value : null; } /// Gets the value for the given key, returns null if null or wrong type int? optInt(String key) { final value = _internalMap[key]; return value is int ? value : null; } /// Gets the value for the given key, returns null if null or wrong type String? optString(String key) { final value = _internalMap[key]; return value is String ? value : null; } /// Gets the value for the given key, returns null if null or wrong type double? optDouble(String key) { final value = _internalMap[key]; return value is double ? value : null; } /// Gets the value for the given key, returns null if null or wrong type Bundle? optBundle(String key) { final value = _internalMap[key]; if (value is Bundle) return value; if (value is Map<Object?, Object?>) return Bundle.from(value); return null; } /// Gets the value for the given key, returns null if null or wrong type List<String>? optStringList(String key) { final value = _internalMap[key]; if (value is List<Object?>) return value.map((e) => e.toString()).toList(); return null; } /// Serializes the bundle to a flat structure that is used by the restoration /// framework. See [RestorationMixin] Map<Object?, Object?> asFlatStructure() => _internalMap.map((key, value) { if (value is Bundle) { return MapEntry<Object?, Object?>(key, value.asFlatStructure()); } else { return MapEntry<Object?, Object?>(key, value); } }); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/text_style_extensions.dart
import 'package:flutter/material.dart'; extension TextStyleExtensions on TextStyle { TextStyle withOpacity0() => _withOpacity(0); TextStyle withOpacity20() => _withOpacity(0.2); TextStyle withOpacity40() => _withOpacity(0.4); TextStyle withOpacity60() => _withOpacity(0.6); //Light dark TextStyle _withOpacity(double opacity) => copyWith(color: color?.withOpacity(opacity)); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/string_extension.dart
import 'package:diacritic/diacritic.dart'; import 'package:flutter_mockup_bloc/resource/app_constant.dart'; late final RegExp _lineBreakHtmlTagRegex = RegExp('(\<br\/?\>)', multiLine: true); late final RegExp _webLinkRegex = RegExp( r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+', multiLine: true, ); late final RegExp _validUrlProtocolRegex = RegExp(r'(https?|ftp)://'); extension StringExt on String { String get toLabel => "$this: "; String get toPhoneLaunchUri => "tel:$this"; String get toWebUrl => startsWith(_validUrlProtocolRegex) ? this : "https://$this"; String get capitalize => this.length > 0 ? "${this[0].toUpperCase()}${this.substring(1)}" : ''; List<String> get dataValues => this.trim().split(RegExp(r',\n?\s*'))..removeWhere((e) => e.isEmpty); String get fileNameWithExtension => this.substring(this.lastIndexOf('/') + 1); String get fileExtension => this.substring(this.lastIndexOf('.') + 1); String get displayFileExtension => fileExtension.toUpperCase(); String get extensionOfFileFromDownloadLink => fileExtension; bool get isPngImageDownloadLink => extensionOfFileFromDownloadLink.contains('png'); bool get isNotPngImageDownloadLink => isPngImageDownloadLink == false; String get resolveLineBreakHtmlTag => this.replaceAll(_lineBreakHtmlTagRegex, '\n'); static int Function(String, String) comparator = (a, b) => a.compareTo(b); static int Function(String, String) lowerCaseWithoutDiacriticComparator = (a, b) => removeDiacritics(a.toLowerCase()).compareTo( removeDiacritics(b.toLowerCase()), ); bool get isStringNotUpdate => this == AppConstants.not_update; bool get containLoginWord => contains(AppConstants.login); List<TextPart> get splitedWebLinks { final List<RegExpMatch> matches = _webLinkRegex.allMatches(this).toList(); if (matches.isEmpty) return const []; final List<TextPart> result = []; for (int strIndex = 0, matchIndex = 0; matchIndex < matches.length; strIndex = matches[matchIndex].end, matchIndex++) { final RegExpMatch match = matches[matchIndex]; result.addAll([ TextPart( isLink: false, text: substring(strIndex, match.start), ), TextPart( isLink: true, text: substring(match.start, match.end), ), ]); } result.add( TextPart( isLink: true, text: substring(matches.last.end, length), ), ); return result; } } class TextPart { final bool isLink; final String text; TextPart({ required this.isLink, required this.text, }); } extension StringNullableExt on String? { String get emptyIfNull => this ?? ''; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/list_extensions.dart
extension ListExtensions<T> on List<T> { /// Replaces all data in the list with [newData] void replaceAll(List<T> newData) { clear(); addAll(newData); } /// Replaces all items that matches where with [newData] void replaceWhere(bool Function(T) where, T newData, {int? count}) { final replaceCount = count ?? length; var currentReplaceCount = 0; for (var i = 0; i < length; ++i) { if (where(this[i])) { this[i] = newData; ++currentReplaceCount; } if (currentReplaceCount >= replaceCount) break; } } /// Sorts the list based on the comparable returned by [by]. By default /// the sorting is [ascending] void sortBy<R>(Comparable<R>? by(T item), {bool ascending = true}) { sort((a, b) { final byA = by(a); final byB = by(b); if (byA == null) return ascending ? -1 : 1; if (byB == null) return ascending ? 1 : -1; return _compareValues(byA, byB, ascending); }); } /// Sorts the list by comparing first comparing using [by] and if the items /// are equal, by comparing them using [by2]. By default /// the sorting is [ascending] void sortBy2<R, V>( Comparable<R>? by(T item), Comparable<V>? by2(T item), { bool ascending = true, }) { sort((a, b) { final byA = by(a); final byB = by(b); if (byA == null && byB != null) return ascending ? -1 : 1; if (byB == null && byA != null) return ascending ? 1 : -1; if (byA != null && byB != null) { final result = _compareValues(byA, byB, ascending); if (result != 0) return result; } final byA2 = by2(a); final byB2 = by2(b); if (byA2 == null && byB2 == null) return 0; if (byA2 == null) return ascending ? -1 : 1; if (byB2 == null) return ascending ? 1 : -1; return _compareValues(byA2, byB2, ascending); }); } } int _compareValues<T extends Comparable<dynamic>>(T a, T b, bool ascending) { if (identical(a, b)) return 0; if (ascending) return a.compareTo(b); return -a.compareTo(b); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/null_extensions.dart
/// Extensions for nullable types extension NullExtension2<T> on T? { /// Execute the given lambda and return a result /// /// ```dart /// someNullableInt.let((notNull) => notNull * 2) ?? 0; /// ``` R? let<R>(R? Function(T) lambda) { final copy = this; if (copy == null) return null; return lambda(copy); } } extension NullStringExtension<T> on String? { /// Will return if the string is null or empty bool get isNullOrEmpty => this == null || this?.isEmpty == true; /// Will return if the string is not null and not empty bool get isNotNullOrEmpty => !isNullOrEmpty; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/map_extensions.dart
extension MapExtension<K, V> on Map<K?, V> { /// Removes all null keys from the map Map<K, V> removeNullKeys() { final map = <K, V>{}; forEach((key, value) { if (key != null) map[key] = value; }); return map; } } extension MapExtension2<K, V> on Map<K, V?> { /// Removes all null values from the map Map<K, V> removeNullValues() { final map = <K, V>{}; forEach((key, value) { if (value != null) map[key] = value; }); return map; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/context_extensions.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/presentation/widgets/responsive/responsive_widget.dart'; extension BuilContextExtensions on BuildContext { /// Returns true if the current theme is targeting the android platform bool get isAndroidTheme => Theme.of(this).platform == TargetPlatform.android; /// Returns true if the current theme is targeting the ios platform bool get isIOSTheme => Theme.of(this).platform == TargetPlatform.iOS; /// Returns true if the device indicates it is a tablet. /// /// See [ResponsiveWidget.getDeviceType] bool get isTablet => MediaQuery.of(this).isTablet; /// Returns true if the device indicates it is in landscape mode. /// /// See [MediaQueryData.orientation] bool get isLandscape => MediaQuery.of(this).isLandscape; } extension MediaQueryExtension on MediaQueryData { /// Returns true if the device indicates it is a tablet. /// /// See [ResponsiveWidget.getDeviceType] bool get isTablet => ResponsiveWidget.getDeviceType(this) == DeviceScreenType.Tablet; /// Returns true if the device indicates it is in landscape mode. /// /// See [MediaQueryData.orientation] bool get isLandscape => orientation == Orientation.landscape; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/iterable_extensions.dart
import 'package:tuple/tuple.dart'; extension IterableExtension<T> on Iterable<T> { /// Counts all elements for which [where] returns true int count(bool Function(T) where) { var c = 0; for (final element in this) { if (where(element)) { ++c; } } return c; } /// Sums the result of [valueProvider] for each item E sum<E extends num>(E Function(T) valueProducer) { num value = 0; forEach((e) => value = (value + valueProducer(e)) as E); return value as E; } /// Finds the first item that matches [where], if no such item could be found /// returns `null` T? find(bool Function(T) where) { for (final element in this) { if (where(element)) return element; } return null; } /// Returns `true` if every item matches [where] bool all(bool Function(T) where) { for (final element in this) { if (!where(element)) { return false; } } return true; } /// Create a map by mapping every element using [key]. Duplicate values /// are discarded Map<S, T> associateBy<S>(S Function(T) key) { final map = <S, T>{}; for (final element in this) { map[key(element)] = element; } return map; } /// Splits the elements according to [on]. Items for which [on] is true will /// be stored in [Tuple2.item1], other items in [Tuple2.item2] Tuple2<List<T>, List<T>> split(bool Function(T) on) { final left = <T>[]; final right = <T>[]; forEach((element) { if (on(element)) { left.add(element); } else { right.add(element); } }); return Tuple2(left, right); } /// Same as [Iterable.map] except that the [mapper] function also receives /// the index of the item being mapped Iterable<R> mapIndexed<R>(R Function(int, T) mapper) { var c = 0; return map((element) => mapper(c++, element)); } /// Same as [Iterable.foreach] except that the [f] function also receives /// the index of the item void forEachIndexed(Function(int, T) f) { var index = 0; return forEach((element) => f(index++, element)); } } /// Extension on lists extension ListIterableExtension<T> on Iterable<Iterable<T>> { /// Flattens the list of lists to a single flat list of items List<T> flatten() { final newList = <T>[]; forEach(newList.addAll); return newList; } }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/extension/system_chrome_extension.dart
import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; /// Controls specific aspects of the operating system's graphical interface and /// how it interacts with the application. extension SystemChromeExtension on SystemChrome { static void hideKeyboardIfVisible() => FocusManager.instance.primaryFocus?.unfocus(); static Future<void> allowVerticalPortraitOnly() => SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/icon_utils.dart
import 'package:flutter/material.dart'; import 'package:flutter_mockup_bloc/utils/ui/dialog/check_icon_painter.dart'; import 'package:flutter_mockup_bloc/utils/ui/dialog/info_icon_painter.dart'; import 'package:flutter_mockup_bloc/utils/ui/dialog/power_icon_painter.dart'; import 'package:flutter_mockup_bloc/utils/ui/dialog/trash_icon_painter.dart'; import 'package:flutter_mockup_bloc/utils/ui/dialog/x_icon_painter.dart'; import 'package:flutter_mockup_bloc/utils/ui/drawer/login_icon_painter.dart'; class IconUtils { static const dataItemIconSize = Size(20, 20); static const defaultIconSize = Size(24, 24); static const navIconSize = Size(25, 25); static const homeBtnIconSize = Size(73, 73); static const sectionIconSize = Size(153, 153); static const dialogIconSize = Size(70, 70); static const chatOptionIconSize = Size(50, 50); static const inlineTextIconSize = Size(13, 13); // Dialog static const dialog_x_icon = CustomPaint( size: dialogIconSize, painter: XIconPainter(), ); static const dialog_check_icon = CustomPaint( size: dialogIconSize, painter: CheckIconPainter(), ); static const dialog_info_icon = CustomPaint( size: dialogIconSize, painter: InfoIconPainter(), ); static const dialog_power_icon = CustomPaint( size: dialogIconSize, painter: PowerIconPainter(), ); static const dialog_trash_icon = CustomPaint( size: dialogIconSize, painter: TrashIconPainter(), ); // Other static const login_icon = CustomPaint( size: dialogIconSize, painter: LoginIconPainter(), ); }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/price_list_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class PriceListIconPainter extends CustomPainter { const PriceListIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.2753908, size.height * 0.1171875); path_0.lineTo(size.width * 0.4902333, size.height * 0.1171875); path_0.cubicTo( size.width * 0.5064125, size.height * 0.1171875, size.width * 0.5195333, size.height * 0.1040704, size.width * 0.5195333, size.height * 0.08789083); path_0.lineTo(size.width * 0.5195333, size.height * 0.05859375); path_0.cubicTo(size.width * 0.5195333, size.height * 0.02623242, size.width * 0.4933000, 0, size.width * 0.4609375, 0); path_0.lineTo(size.width * 0.3046875, 0); path_0.cubicTo( size.width * 0.2723262, 0, size.width * 0.2460938, size.height * 0.02623242, size.width * 0.2460938, size.height * 0.05859375); path_0.lineTo(size.width * 0.2460938, size.height * 0.08789083); path_0.cubicTo( size.width * 0.2460938, size.height * 0.1040704, size.width * 0.2592108, size.height * 0.1171875, size.width * 0.2753908, size.height * 0.1171875); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.7818583, size.height * 0.7838750); path_1.lineTo(size.width * 0.7818583, size.height * 0.8466125); path_1.cubicTo( size.width * 0.7928458, size.height * 0.8403167, size.width * 0.7994083, size.height * 0.8291917, size.width * 0.8011875, size.height * 0.8186042); path_1.cubicTo( size.width * 0.8024708, size.height * 0.8109667, size.width * 0.8029958, size.height * 0.7927750, size.width * 0.7818583, size.height * 0.7838750); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.7324208, size.height * 0.7009042); path_2.cubicTo( size.width * 0.7308583, size.height * 0.7091833, size.width * 0.7328333, size.height * 0.7168750, size.width * 0.7374542, size.height * 0.7204958); path_2.cubicTo( size.width * 0.7390792, size.height * 0.7217708, size.width * 0.7408708, size.height * 0.7230250, size.width * 0.7427958, size.height * 0.7242583); path_2.lineTo(size.width * 0.7427958, size.height * 0.6834125); path_2.cubicTo( size.width * 0.7368375, size.height * 0.6879833, size.width * 0.7335500, size.height * 0.6949042, size.width * 0.7324208, size.height * 0.7009042); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.4874625, size.height * 0.8632833); path_3.lineTo(size.width * 0.3437500, size.height * 0.8632833); path_3.cubicTo( size.width * 0.3275704, size.height * 0.8632833, size.width * 0.3144533, size.height * 0.8501625, size.width * 0.3144533, size.height * 0.8339833); path_3.cubicTo( size.width * 0.3144533, size.height * 0.8178042, size.width * 0.3275704, size.height * 0.8046875, size.width * 0.3437500, size.height * 0.8046875); path_3.lineTo(size.width * 0.4733125, size.height * 0.8046875); path_3.cubicTo( size.width * 0.4716042, size.height * 0.7919042, size.width * 0.4707042, size.height * 0.7788708, size.width * 0.4707042, size.height * 0.7656250); path_3.cubicTo( size.width * 0.4707042, size.height * 0.7523792, size.width * 0.4716042, size.height * 0.7393458, size.width * 0.4733125, size.height * 0.7265625); path_3.lineTo(size.width * 0.3437500, size.height * 0.7265625); path_3.cubicTo( size.width * 0.3275704, size.height * 0.7265625, size.width * 0.3144533, size.height * 0.7134458, size.width * 0.3144533, size.height * 0.6972667); path_3.cubicTo( size.width * 0.3144533, size.height * 0.6810875, size.width * 0.3275704, size.height * 0.6679667, size.width * 0.3437500, size.height * 0.6679667); path_3.lineTo(size.width * 0.4874625, size.height * 0.6679667); path_3.cubicTo( size.width * 0.4974875, size.height * 0.6396917, size.width * 0.5117292, size.height * 0.6133917, size.width * 0.5294458, size.height * 0.5898417); path_3.lineTo(size.width * 0.3437500, size.height * 0.5898417); path_3.cubicTo( size.width * 0.3275704, size.height * 0.5898417, size.width * 0.3144533, size.height * 0.5767250, size.width * 0.3144533, size.height * 0.5605458); path_3.cubicTo( size.width * 0.3144533, size.height * 0.5443667, size.width * 0.3275704, size.height * 0.5312500, size.width * 0.3437500, size.height * 0.5312500); path_3.lineTo(size.width * 0.5881250, size.height * 0.5312500); path_3.cubicTo( size.width * 0.6370833, size.height * 0.4944833, size.width * 0.6978708, size.height * 0.4726583, size.width * 0.7636708, size.height * 0.4726583); path_3.lineTo(size.width * 0.7636708, size.height * 0.1660158); path_3.cubicTo( size.width * 0.7636708, size.height * 0.1174746, size.width * 0.7243208, size.height * 0.07812500, size.width * 0.6757833, size.height * 0.07812500); path_3.lineTo(size.width * 0.5781250, size.height * 0.07812500); path_3.lineTo(size.width * 0.5781250, size.height * 0.08789083); path_3.cubicTo( size.width * 0.5781250, size.height * 0.1364317, size.width * 0.5387750, size.height * 0.1757813, size.width * 0.4902333, size.height * 0.1757813); path_3.lineTo(size.width * 0.2753908, size.height * 0.1757813); path_3.cubicTo( size.width * 0.2268496, size.height * 0.1757813, size.width * 0.1875000, size.height * 0.1364317, size.width * 0.1875000, size.height * 0.08789083); path_3.lineTo(size.width * 0.1875000, size.height * 0.07812500); path_3.lineTo(size.width * 0.08984375, size.height * 0.07812500); path_3.cubicTo( size.width * 0.04130275, size.height * 0.07812500, size.width * 0.001953125, size.height * 0.1174746, size.width * 0.001953125, size.height * 0.1660158); path_3.lineTo(size.width * 0.001953125, size.height * 0.9121083); path_3.cubicTo( size.width * 0.001953125, size.height * 0.9606500, size.width * 0.04130275, size.height, size.width * 0.08984375, size.height); path_3.lineTo(size.width * 0.5880833, size.height); path_3.cubicTo( size.width * 0.5423250, size.height * 0.9656333, size.width * 0.5069333, size.height * 0.9181917, size.width * 0.4874625, size.height * 0.8632833); path_3.close(); path_3.moveTo(size.width * 0.3437500, size.height * 0.2578125); path_3.lineTo(size.width * 0.6171875, size.height * 0.2578125); path_3.cubicTo( size.width * 0.6333667, size.height * 0.2578125, size.width * 0.6464833, size.height * 0.2709296, size.width * 0.6464833, size.height * 0.2871092); path_3.cubicTo( size.width * 0.6464833, size.height * 0.3032892, size.width * 0.6333667, size.height * 0.3164063, size.width * 0.6171875, size.height * 0.3164063); path_3.lineTo(size.width * 0.3437500, size.height * 0.3164063); path_3.cubicTo( size.width * 0.3275704, size.height * 0.3164063, size.width * 0.3144533, size.height * 0.3032892, size.width * 0.3144533, size.height * 0.2871092); path_3.cubicTo( size.width * 0.3144533, size.height * 0.2709296, size.width * 0.3275704, size.height * 0.2578125, size.width * 0.3437500, size.height * 0.2578125); path_3.close(); path_3.moveTo(size.width * 0.3437500, size.height * 0.3945313); path_3.lineTo(size.width * 0.6171875, size.height * 0.3945313); path_3.cubicTo( size.width * 0.6333667, size.height * 0.3945313, size.width * 0.6464833, size.height * 0.4076483, size.width * 0.6464833, size.height * 0.4238292); path_3.cubicTo( size.width * 0.6464833, size.height * 0.4400083, size.width * 0.6333667, size.height * 0.4531250, size.width * 0.6171875, size.height * 0.4531250); path_3.lineTo(size.width * 0.3437500, size.height * 0.4531250); path_3.cubicTo( size.width * 0.3275704, size.height * 0.4531250, size.width * 0.3144533, size.height * 0.4400083, size.width * 0.3144533, size.height * 0.4238292); path_3.cubicTo( size.width * 0.3144533, size.height * 0.4076483, size.width * 0.3275704, size.height * 0.3945313, size.width * 0.3437500, size.height * 0.3945313); path_3.close(); path_3.moveTo(size.width * 0.2265625, size.height * 0.8632833); path_3.lineTo(size.width * 0.1484375, size.height * 0.8632833); path_3.cubicTo( size.width * 0.1322579, size.height * 0.8632833, size.width * 0.1191408, size.height * 0.8501625, size.width * 0.1191408, size.height * 0.8339833); path_3.cubicTo( size.width * 0.1191408, size.height * 0.8178042, size.width * 0.1322579, size.height * 0.8046875, size.width * 0.1484375, size.height * 0.8046875); path_3.lineTo(size.width * 0.2265625, size.height * 0.8046875); path_3.cubicTo( size.width * 0.2427421, size.height * 0.8046875, size.width * 0.2558592, size.height * 0.8178042, size.width * 0.2558592, size.height * 0.8339833); path_3.cubicTo( size.width * 0.2558592, size.height * 0.8501625, size.width * 0.2427421, size.height * 0.8632833, size.width * 0.2265625, size.height * 0.8632833); path_3.close(); path_3.moveTo(size.width * 0.2265625, size.height * 0.7265625); path_3.lineTo(size.width * 0.1484375, size.height * 0.7265625); path_3.cubicTo( size.width * 0.1322579, size.height * 0.7265625, size.width * 0.1191408, size.height * 0.7134458, size.width * 0.1191408, size.height * 0.6972667); path_3.cubicTo( size.width * 0.1191408, size.height * 0.6810875, size.width * 0.1322579, size.height * 0.6679667, size.width * 0.1484375, size.height * 0.6679667); path_3.lineTo(size.width * 0.2265625, size.height * 0.6679667); path_3.cubicTo( size.width * 0.2427421, size.height * 0.6679667, size.width * 0.2558592, size.height * 0.6810875, size.width * 0.2558592, size.height * 0.6972667); path_3.cubicTo( size.width * 0.2558592, size.height * 0.7134458, size.width * 0.2427421, size.height * 0.7265625, size.width * 0.2265625, size.height * 0.7265625); path_3.close(); path_3.moveTo(size.width * 0.2265625, size.height * 0.5898417); path_3.lineTo(size.width * 0.1484375, size.height * 0.5898417); path_3.cubicTo( size.width * 0.1322579, size.height * 0.5898417, size.width * 0.1191408, size.height * 0.5767250, size.width * 0.1191408, size.height * 0.5605458); path_3.cubicTo( size.width * 0.1191408, size.height * 0.5443667, size.width * 0.1322579, size.height * 0.5312500, size.width * 0.1484375, size.height * 0.5312500); path_3.lineTo(size.width * 0.2265625, size.height * 0.5312500); path_3.cubicTo( size.width * 0.2427421, size.height * 0.5312500, size.width * 0.2558592, size.height * 0.5443667, size.width * 0.2558592, size.height * 0.5605458); path_3.cubicTo( size.width * 0.2558592, size.height * 0.5767250, size.width * 0.2427421, size.height * 0.5898417, size.width * 0.2265625, size.height * 0.5898417); path_3.close(); path_3.moveTo(size.width * 0.2265625, size.height * 0.4531250); path_3.lineTo(size.width * 0.1484375, size.height * 0.4531250); path_3.cubicTo( size.width * 0.1322579, size.height * 0.4531250, size.width * 0.1191408, size.height * 0.4400083, size.width * 0.1191408, size.height * 0.4238292); path_3.cubicTo( size.width * 0.1191408, size.height * 0.4076483, size.width * 0.1322579, size.height * 0.3945313, size.width * 0.1484375, size.height * 0.3945313); path_3.lineTo(size.width * 0.2265625, size.height * 0.3945313); path_3.cubicTo( size.width * 0.2427421, size.height * 0.3945313, size.width * 0.2558592, size.height * 0.4076483, size.width * 0.2558592, size.height * 0.4238292); path_3.cubicTo( size.width * 0.2558592, size.height * 0.4400083, size.width * 0.2427421, size.height * 0.4531250, size.width * 0.2265625, size.height * 0.4531250); path_3.close(); path_3.moveTo(size.width * 0.2265625, size.height * 0.3164063); path_3.lineTo(size.width * 0.1484375, size.height * 0.3164063); path_3.cubicTo( size.width * 0.1322579, size.height * 0.3164063, size.width * 0.1191408, size.height * 0.3032892, size.width * 0.1191408, size.height * 0.2871092); path_3.cubicTo( size.width * 0.1191408, size.height * 0.2709296, size.width * 0.1322579, size.height * 0.2578125, size.width * 0.1484375, size.height * 0.2578125); path_3.lineTo(size.width * 0.2265625, size.height * 0.2578125); path_3.cubicTo( size.width * 0.2427421, size.height * 0.2578125, size.width * 0.2558592, size.height * 0.2709296, size.width * 0.2558592, size.height * 0.2871092); path_3.cubicTo( size.width * 0.2558592, size.height * 0.3032892, size.width * 0.2427421, size.height * 0.3164063, size.width * 0.2265625, size.height * 0.3164063); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); Path path_4 = Path(); path_4.moveTo(size.width * 0.7636708, size.height * 0.5312500); path_4.cubicTo( size.width * 0.6342292, size.height * 0.5312500, size.width * 0.5292958, size.height * 0.6361833, size.width * 0.5292958, size.height * 0.7656250); path_4.cubicTo( size.width * 0.5292958, size.height * 0.8950667, size.width * 0.6342292, size.height, size.width * 0.7636708, size.height); path_4.cubicTo( size.width * 0.8931125, size.height, size.width * 0.9980458, size.height * 0.8950667, size.width * 0.9980458, size.height * 0.7656250); path_4.cubicTo( size.width * 0.9980458, size.height * 0.6361833, size.width * 0.8931125, size.height * 0.5312500, size.width * 0.7636708, size.height * 0.5312500); path_4.close(); path_4.moveTo(size.width * 0.8397042, size.height * 0.8250708); path_4.cubicTo( size.width * 0.8351083, size.height * 0.8524042, size.width * 0.8143083, size.height * 0.8801250, size.width * 0.7818542, size.height * 0.8883583); path_4.lineTo(size.width * 0.7818542, size.height * 0.9023417); path_4.cubicTo( size.width * 0.7818542, size.height * 0.9131292, size.width * 0.7731083, size.height * 0.9218750, size.width * 0.7623250, size.height * 0.9218750); path_4.cubicTo( size.width * 0.7515375, size.height * 0.9218750, size.width * 0.7427917, size.height * 0.9131292, size.width * 0.7427917, size.height * 0.9023417); path_4.lineTo(size.width * 0.7427917, size.height * 0.8902292); path_4.cubicTo( size.width * 0.7270250, size.height * 0.8888667, size.width * 0.7139500, size.height * 0.8846083, size.width * 0.6954208, size.height * 0.8724833); path_4.cubicTo( size.width * 0.6863917, size.height * 0.8665792, size.width * 0.6838625, size.height * 0.8544750, size.width * 0.6897667, size.height * 0.8454458); path_4.cubicTo( size.width * 0.6956667, size.height * 0.8364208, size.width * 0.7077792, size.height * 0.8338875, size.width * 0.7168042, size.height * 0.8397958); path_4.cubicTo( size.width * 0.7273542, size.height * 0.8466958, size.width * 0.7339667, size.height * 0.8496958, size.width * 0.7427917, size.height * 0.8509375); path_4.lineTo(size.width * 0.7427917, size.height * 0.7684458); path_4.cubicTo( size.width * 0.7303167, size.height * 0.7627250, size.width * 0.7209958, size.height * 0.7572250, size.width * 0.7133417, size.height * 0.7512250); path_4.cubicTo( size.width * 0.6971333, size.height * 0.7385125, size.width * 0.6897333, size.height * 0.7164583, size.width * 0.6940292, size.height * 0.6936625); path_4.cubicTo( size.width * 0.6987083, size.height * 0.6688208, size.width * 0.7160000, size.height * 0.6490583, size.width * 0.7391500, size.height * 0.6420875); path_4.cubicTo( size.width * 0.7403750, size.height * 0.6417167, size.width * 0.7415917, size.height * 0.6413792, size.width * 0.7427917, size.height * 0.6410583); path_4.lineTo(size.width * 0.7427917, size.height * 0.6289083); path_4.cubicTo( size.width * 0.7427917, size.height * 0.6181208, size.width * 0.7515375, size.height * 0.6093750, size.width * 0.7623250, size.height * 0.6093750); path_4.cubicTo( size.width * 0.7731083, size.height * 0.6093750, size.width * 0.7818542, size.height * 0.6181208, size.width * 0.7818542, size.height * 0.6289083); path_4.lineTo(size.width * 0.7818542, size.height * 0.6389208); path_4.cubicTo( size.width * 0.8008167, size.height * 0.6422042, size.width * 0.8142208, size.height * 0.6515375, size.width * 0.8207125, size.height * 0.6589917); path_4.cubicTo( size.width * 0.8278000, size.height * 0.6671250, size.width * 0.8269458, size.height * 0.6794625, size.width * 0.8188125, size.height * 0.6865458); path_4.cubicTo( size.width * 0.8107250, size.height * 0.6935917, size.width * 0.7984750, size.height * 0.6927917, size.width * 0.7913708, size.height * 0.6847792); path_4.cubicTo( size.width * 0.7909250, size.height * 0.6843292, size.width * 0.7878208, size.height * 0.6813417, size.width * 0.7818542, size.height * 0.6791375); path_4.lineTo(size.width * 0.7818542, size.height * 0.7422500); path_4.cubicTo( size.width * 0.7853208, size.height * 0.7435333, size.width * 0.7887875, size.height * 0.7447833, size.width * 0.7921875, size.height * 0.7459875); path_4.cubicTo( size.width * 0.8265208, size.height * 0.7581208, size.width * 0.8456167, size.height * 0.7899042, size.width * 0.8397042, size.height * 0.8250708); path_4.close(); Paint paint_4_fill = Paint()..style = PaintingStyle.fill; paint_4_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_4, paint_4_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/power_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class PowerIconPainter extends CustomPainter { const PowerIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.5000000, size.height * 0.04166667); path_0.cubicTo( size.width * 0.2472758, size.height * 0.04166667, size.width * 0.04166667, size.height * 0.2472758, size.width * 0.04166667, size.height * 0.5000000); path_0.cubicTo( size.width * 0.04166667, size.height * 0.7527250, size.width * 0.2472758, size.height * 0.9583333, size.width * 0.5000000, size.height * 0.9583333); path_0.cubicTo( size.width * 0.7527250, size.height * 0.9583333, size.width * 0.9583333, size.height * 0.7527250, size.width * 0.9583333, size.height * 0.5000000); path_0.cubicTo( size.width * 0.9583333, size.height * 0.2472758, size.width * 0.7527250, size.height * 0.04166667, size.width * 0.5000000, size.height * 0.04166667); path_0.close(); path_0.moveTo(size.width * 0.4583333, size.height * 0.2500008); path_0.cubicTo( size.width * 0.4583333, size.height * 0.2269892, size.width * 0.4769875, size.height * 0.2083333, size.width * 0.5000000, size.height * 0.2083333); path_0.cubicTo( size.width * 0.5230125, size.height * 0.2083333, size.width * 0.5416667, size.height * 0.2269892, size.width * 0.5416667, size.height * 0.2500008); path_0.lineTo(size.width * 0.5416667, size.height * 0.4285708); path_0.cubicTo( size.width * 0.5416667, size.height * 0.4515833, size.width * 0.5230125, size.height * 0.4702375, size.width * 0.5000000, size.height * 0.4702375); path_0.cubicTo( size.width * 0.4769875, size.height * 0.4702375, size.width * 0.4583333, size.height * 0.4515833, size.width * 0.4583333, size.height * 0.4285708); path_0.lineTo(size.width * 0.4583333, size.height * 0.2500008); path_0.close(); path_0.moveTo(size.width * 0.5000000, size.height * 0.7916667); path_0.cubicTo( size.width * 0.3539438, size.height * 0.7916667, size.width * 0.2351192, size.height * 0.6728417, size.width * 0.2351192, size.height * 0.5267875); path_0.cubicTo( size.width * 0.2351192, size.height * 0.4617125, size.width * 0.2589471, size.height * 0.3991379, size.width * 0.3022112, size.height * 0.3505904); path_0.cubicTo( size.width * 0.3175225, size.height * 0.3334067, size.width * 0.3438588, size.height * 0.3318992, size.width * 0.3610408, size.height * 0.3472067); path_0.cubicTo( size.width * 0.3782213, size.height * 0.3625179, size.width * 0.3797321, size.height * 0.3888542, size.width * 0.3644246, size.height * 0.4060379); path_0.cubicTo( size.width * 0.3347796, size.height * 0.4393000, size.width * 0.3184517, size.height * 0.4821833, size.width * 0.3184517, size.height * 0.5267875); path_0.cubicTo( size.width * 0.3184517, size.height * 0.6268917, size.width * 0.3998937, size.height * 0.7083333, size.width * 0.5000000, size.height * 0.7083333); path_0.cubicTo( size.width * 0.6001042, size.height * 0.7083333, size.width * 0.6815458, size.height * 0.6268917, size.width * 0.6815458, size.height * 0.5267875); path_0.cubicTo( size.width * 0.6815458, size.height * 0.4821750, size.width * 0.6652208, size.height * 0.4392958, size.width * 0.6355750, size.height * 0.4060379); path_0.cubicTo( size.width * 0.6202625, size.height * 0.3888596, size.width * 0.6217750, size.height * 0.3625217, size.width * 0.6389542, size.height * 0.3472104); path_0.cubicTo( size.width * 0.6561292, size.height * 0.3318992, size.width * 0.6824708, size.height * 0.3334083, size.width * 0.6977833, size.height * 0.3505904); path_0.cubicTo( size.width * 0.7410500, size.height * 0.3991325, size.width * 0.7648792, size.height * 0.4617042, size.width * 0.7648792, size.height * 0.5267875); path_0.cubicTo( size.width * 0.7648792, size.height * 0.6728417, size.width * 0.6460542, size.height * 0.7916667, size.width * 0.5000000, size.height * 0.7916667); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/necessary_information_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class NecessaryInformationIconPainter extends CustomPainter { const NecessaryInformationIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.2656250, size.height * 0.3515625); path_0.cubicTo( size.width * 0.1848575, size.height * 0.3515625, size.width * 0.1171875, size.height * 0.4172792, size.width * 0.1171875, size.height * 0.4980458); path_0.cubicTo( size.width * 0.1171875, size.height * 0.5788125, size.width * 0.1848575, size.height * 0.6445333, size.width * 0.2656250, size.height * 0.6445333); path_0.cubicTo( size.width * 0.3463925, size.height * 0.6445333, size.width * 0.4140625, size.height * 0.5788125, size.width * 0.4140625, size.height * 0.4980458); path_0.cubicTo( size.width * 0.4140625, size.height * 0.4172792, size.width * 0.3463925, size.height * 0.3515625, size.width * 0.2656250, size.height * 0.3515625); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.7363292, 0); path_1.cubicTo( size.width * 0.5909333, 0, size.width * 0.4726583, size.height * 0.1182754, size.width * 0.4726583, size.height * 0.2636717); path_1.cubicTo( size.width * 0.4726583, size.height * 0.3090196, size.width * 0.4842458, size.height * 0.3532792, size.width * 0.5062458, size.height * 0.3925333); path_1.lineTo(size.width * 0.4741708, size.height * 0.4887792); path_1.cubicTo( size.width * 0.4707667, size.height * 0.4989333, size.width * 0.4732000, size.height * 0.5100917, size.width * 0.4804667, size.height * 0.5179583); path_1.cubicTo( size.width * 0.4879250, size.height * 0.5260250, size.width * 0.4990625, size.height * 0.5290125, size.width * 0.5090500, size.height * 0.5264583); path_1.lineTo(size.width * 0.6178542, size.height * 0.4992792); path_1.cubicTo( size.width * 0.6544167, size.height * 0.5176750, size.width * 0.6951292, size.height * 0.5273417, size.width * 0.7363292, size.height * 0.5273417); path_1.cubicTo(size.width * 0.8817250, size.height * 0.5273417, size.width, size.height * 0.4090683, size.width, size.height * 0.2636717); path_1.cubicTo(size.width, size.height * 0.1182754, size.width * 0.8817250, 0, size.width * 0.7363292, 0); path_1.close(); path_1.moveTo(size.width * 0.7656250, size.height * 0.3808592); path_1.cubicTo( size.width * 0.7656250, size.height * 0.3970529, size.width * 0.7525208, size.height * 0.4101563, size.width * 0.7363292, size.height * 0.4101563); path_1.cubicTo( size.width * 0.7201333, size.height * 0.4101563, size.width * 0.7070333, size.height * 0.3970529, size.width * 0.7070333, size.height * 0.3808592); path_1.lineTo(size.width * 0.7070333, size.height * 0.2636717); path_1.cubicTo( size.width * 0.7070333, size.height * 0.2474783, size.width * 0.7201333, size.height * 0.2343750, size.width * 0.7363292, size.height * 0.2343750); path_1.cubicTo( size.width * 0.7525208, size.height * 0.2343750, size.width * 0.7656250, size.height * 0.2474783, size.width * 0.7656250, size.height * 0.2636717); path_1.lineTo(size.width * 0.7656250, size.height * 0.3808592); path_1.close(); path_1.moveTo(size.width * 0.7363292, size.height * 0.2050783); path_1.cubicTo( size.width * 0.7201500, size.height * 0.2050783, size.width * 0.7070333, size.height * 0.1919608, size.width * 0.7070333, size.height * 0.1757813); path_1.cubicTo( size.width * 0.7070333, size.height * 0.1596017, size.width * 0.7201500, size.height * 0.1464842, size.width * 0.7363292, size.height * 0.1464842); path_1.cubicTo( size.width * 0.7525083, size.height * 0.1464842, size.width * 0.7656250, size.height * 0.1596017, size.width * 0.7656250, size.height * 0.1757813); path_1.cubicTo( size.width * 0.7656250, size.height * 0.1919608, size.width * 0.7525083, size.height * 0.2050783, size.width * 0.7363292, size.height * 0.2050783); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.4193542, size.height * 0.6347042); path_2.cubicTo( size.width * 0.3817908, size.height * 0.6763917, size.width * 0.3260137, size.height * 0.7031250, size.width * 0.2656250, size.height * 0.7031250); path_2.cubicTo( size.width * 0.2052363, size.height * 0.7031250, size.width * 0.1494592, size.height * 0.6763917, size.width * 0.1118946, size.height * 0.6347042); path_2.cubicTo(size.width * 0.04442792, size.height * 0.6825083, 0, size.height * 0.7608125, 0, size.height * 0.8496125); path_2.lineTo(0, size.height * 0.9707042); path_2.cubicTo(0, size.height * 0.9869000, size.width * 0.01310350, size.height, size.width * 0.02929688, size.height); path_2.lineTo(size.width * 0.5019542, size.height); path_2.cubicTo( size.width * 0.5181458, size.height, size.width * 0.5312500, size.height * 0.9869000, size.width * 0.5312500, size.height * 0.9707042); path_2.lineTo(size.width * 0.5312500, size.height * 0.8496125); path_2.cubicTo( size.width * 0.5312500, size.height * 0.7608125, size.width * 0.4868208, size.height * 0.6825083, size.width * 0.4193542, size.height * 0.6347042); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/clock_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class ClockIconPainter extends CustomPainter { const ClockIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.8977083, size.height * 0.3747171); path_0.cubicTo( size.width * 0.8566250, size.height * 0.2452171, size.width * 0.7547917, size.height * 0.1433838, size.width * 0.6251250, size.height * 0.1022171); path_0.cubicTo( size.width * 0.5443333, size.height * 0.07713375, size.width * 0.4559167, size.height * 0.07709208, size.width * 0.3747500, size.height * 0.1022587); path_0.cubicTo( size.width * 0.2452500, size.height * 0.1433421, size.width * 0.1434167, size.height * 0.2451754, size.width * 0.1022500, size.height * 0.3748421); path_0.cubicTo( size.width * 0.08970833, size.height * 0.4153008, size.width * 0.08333333, size.height * 0.4574250, size.width * 0.08333333, size.height * 0.5000083); path_0.cubicTo( size.width * 0.08333333, size.height * 0.7297583, size.width * 0.2702500, size.height * 0.9166750, size.width * 0.5000000, size.height * 0.9166750); path_0.cubicTo( size.width * 0.7297500, size.height * 0.9166750, size.width * 0.9166667, size.height * 0.7297583, size.width * 0.9166667, size.height * 0.5000083); path_0.cubicTo( size.width * 0.9166667, size.height * 0.4574250, size.width * 0.9102917, size.height * 0.4153004, size.width * 0.8977083, size.height * 0.3747171); path_0.close(); path_0.moveTo(size.width * 0.5416667, size.height * 0.5000083); path_0.cubicTo( size.width * 0.5416667, size.height * 0.5230083, size.width * 0.5230000, size.height * 0.5416750, size.width * 0.5000000, size.height * 0.5416750); path_0.lineTo(size.width * 0.2916667, size.height * 0.5416750); path_0.cubicTo( size.width * 0.2686667, size.height * 0.5416750, size.width * 0.2500000, size.height * 0.5230083, size.width * 0.2500000, size.height * 0.5000083); path_0.cubicTo( size.width * 0.2500000, size.height * 0.4770083, size.width * 0.2686667, size.height * 0.4583417, size.width * 0.2916667, size.height * 0.4583417); path_0.lineTo(size.width * 0.4583333, size.height * 0.4583417); path_0.lineTo(size.width * 0.4583333, size.height * 0.2916754); path_0.cubicTo( size.width * 0.4583333, size.height * 0.2686754, size.width * 0.4770000, size.height * 0.2500088, size.width * 0.5000000, size.height * 0.2500088); path_0.cubicTo( size.width * 0.5230000, size.height * 0.2500088, size.width * 0.5416667, size.height * 0.2686754, size.width * 0.5416667, size.height * 0.2916754); path_0.lineTo(size.width * 0.5416667, size.height * 0.5000083); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.6374708, size.height * 0.06245833); path_1.cubicTo( size.width * 0.7802208, size.height * 0.1077500, size.width * 0.8922625, size.height * 0.2197500, size.width * 0.9374292, size.height * 0.3621254); path_1.cubicTo( size.width * 0.9380958, size.height * 0.3642921, size.width * 0.9385542, size.height * 0.3664587, size.width * 0.9391792, size.height * 0.3686254); path_1.cubicTo( size.width * 0.9774708, size.height * 0.3286254, size.width * 1.000012, size.height * 0.2753754, size.width * 1.000012, size.height * 0.2183333); path_1.cubicTo(size.width * 1.000012, size.height * 0.09795833, size.width * 0.9020542, 0, size.width * 0.7816792, 0); path_1.cubicTo( size.width * 0.7246375, 0, size.width * 0.6714292, size.height * 0.02254167, size.width * 0.6314292, size.height * 0.06083333); path_1.cubicTo( size.width * 0.6334292, size.height * 0.06141667, size.width * 0.6354708, size.height * 0.06183333, size.width * 0.6374708, size.height * 0.06245833); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.06245833, size.height * 0.3625417); path_2.cubicTo( size.width * 0.1077500, size.height * 0.2197917, size.width * 0.2197500, size.height * 0.1077500, size.width * 0.3621250, size.height * 0.06258333); path_2.cubicTo( size.width * 0.3642500, size.height * 0.06191667, size.width * 0.3664583, size.height * 0.06145833, size.width * 0.3686250, size.height * 0.06083333); path_2.cubicTo(size.width * 0.3286250, size.height * 0.02254167, size.width * 0.2753750, 0, size.width * 0.2183333, 0); path_2.cubicTo(size.width * 0.09795833, 0, 0, size.height * 0.09795833, 0, size.height * 0.2183333); path_2.cubicTo( 0, size.height * 0.2753750, size.width * 0.02254167, size.height * 0.3285833, size.width * 0.06079167, size.height * 0.3685833); path_2.cubicTo( size.width * 0.06141667, size.height * 0.3665833, size.width * 0.06183333, size.height * 0.3645417, size.width * 0.06245833, size.height * 0.3625417); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.7803708, size.height * 0.8617958); path_3.cubicTo( size.width * 0.7584542, size.height * 0.8788375, size.width * 0.7350792, size.height * 0.8939625, size.width * 0.7102458, size.height * 0.9068375); path_3.lineTo(size.width * 0.7563292, size.height * 0.9804625); path_3.cubicTo( size.width * 0.7642458, size.height * 0.9930875, size.width * 0.7778292, size.height * 1.000004, size.width * 0.7917042, size.height * 1.000004); path_3.cubicTo( size.width * 0.7992458, size.height * 1.000004, size.width * 0.8069125, size.height * 0.9979625, size.width * 0.8137875, size.height * 0.9936708); path_3.cubicTo( size.width * 0.8332875, size.height * 0.9814625, size.width * 0.8392042, size.height * 0.9557542, size.width * 0.8269958, size.height * 0.9362542); path_3.lineTo(size.width * 0.7803708, size.height * 0.8617958); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); Path path_4 = Path(); path_4.moveTo(size.width * 0.2196446, size.height * 0.8617958); path_4.lineTo(size.width * 0.1730196, size.height * 0.9362542); path_4.cubicTo( size.width * 0.1608112, size.height * 0.9557542, size.width * 0.1667279, size.height * 0.9814625, size.width * 0.1862279, size.height * 0.9936708); path_4.cubicTo( size.width * 0.1931029, size.height * 0.9979625, size.width * 0.2007696, size.height * 1.000004, size.width * 0.2083112, size.height * 1.000004); path_4.cubicTo( size.width * 0.2221863, size.height * 1.000004, size.width * 0.2357696, size.height * 0.9930875, size.width * 0.2436862, size.height * 0.9804625); path_4.lineTo(size.width * 0.2897696, size.height * 0.9068375); path_4.cubicTo( size.width * 0.2649362, size.height * 0.8939208, size.width * 0.2415612, size.height * 0.8787958, size.width * 0.2196446, size.height * 0.8617958); path_4.close(); Paint paint_4_fill = Paint()..style = PaintingStyle.fill; paint_4_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_4, paint_4_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/dispute_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class DisputeIconPainter extends CustomPainter { const DisputeIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.3388671, size.height * 0.2539063); path_0.lineTo(size.width * 0.3388671, size.height * 0.4589833); path_0.lineTo(size.width * 0.2802733, size.height * 0.4589833); path_0.lineTo(size.width * 0.2802733, size.height * 0.2539063); path_0.lineTo(size.width * 0.1777342, size.height * 0.2539063); path_0.cubicTo( size.width * 0.1211933, size.height * 0.2539063, size.width * 0.07519542, size.height * 0.2999062, size.width * 0.07519542, size.height * 0.3564454); path_0.lineTo(size.width * 0.07519542, size.height * 0.6191417); path_0.cubicTo( size.width * 0.07519542, size.height * 0.6393333, size.width * 0.09162292, size.height * 0.6557625, size.width * 0.1118163, size.height * 0.6557625); path_0.cubicTo( size.width * 0.1320096, size.height * 0.6557625, size.width * 0.1484375, size.height * 0.6393333, size.width * 0.1484375, size.height * 0.6191417); path_0.lineTo(size.width * 0.1484375, size.height * 0.3564454); path_0.lineTo(size.width * 0.2070313, size.height * 0.3564454); path_0.lineTo(size.width * 0.2070313, size.height); path_0.lineTo(size.width * 0.2802733, size.height); path_0.lineTo(size.width * 0.2802733, size.height * 0.6181625); path_0.lineTo(size.width * 0.3388671, size.height * 0.6181625); path_0.lineTo(size.width * 0.3388671, size.height); path_0.lineTo(size.width * 0.4121092, size.height); path_0.lineTo(size.width * 0.4121092, size.height * 0.2539063); path_0.lineTo(size.width * 0.3388671, size.height * 0.2539063); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.4072267, size.height * 0.09765625); path_1.cubicTo(size.width * 0.4072267, size.height * 0.04380875, size.width * 0.3634179, 0, size.width * 0.3095704, 0); path_1.cubicTo( size.width * 0.2557225, 0, size.width * 0.2119142, size.height * 0.04380875, size.width * 0.2119142, size.height * 0.09765625); path_1.cubicTo( size.width * 0.2119142, size.height * 0.1515037, size.width * 0.2557225, size.height * 0.1953125, size.width * 0.3095704, size.height * 0.1953125); path_1.cubicTo( size.width * 0.3634179, size.height * 0.1953125, size.width * 0.4072267, size.height * 0.1515037, size.width * 0.4072267, size.height * 0.09765625); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.7929667, size.height * 0.3564454); path_2.lineTo(size.width * 0.8515625, size.height * 0.3564454); path_2.lineTo(size.width * 0.8515625, size.height * 0.6191417); path_2.cubicTo( size.width * 0.8515625, size.height * 0.6393333, size.width * 0.8679917, size.height * 0.6557625, size.width * 0.8881833, size.height * 0.6557625); path_2.cubicTo( size.width * 0.9083750, size.height * 0.6557625, size.width * 0.9248042, size.height * 0.6393333, size.width * 0.9248042, size.height * 0.6191417); path_2.lineTo(size.width * 0.9248042, size.height * 0.3564454); path_2.cubicTo( size.width * 0.9248042, size.height * 0.2999062, size.width * 0.8788083, size.height * 0.2539063, size.width * 0.8222667, size.height * 0.2539063); path_2.lineTo(size.width * 0.7197250, size.height * 0.2539063); path_2.lineTo(size.width * 0.7197250, size.height * 0.4589833); path_2.lineTo(size.width * 0.6611333, size.height * 0.4589833); path_2.lineTo(size.width * 0.6611333, size.height * 0.2539063); path_2.lineTo(size.width * 0.5878917, size.height * 0.2539063); path_2.lineTo(size.width * 0.5878917, size.height); path_2.lineTo(size.width * 0.6611333, size.height); path_2.lineTo(size.width * 0.6611333, size.height * 0.6181625); path_2.lineTo(size.width * 0.7197250, size.height * 0.6181625); path_2.lineTo(size.width * 0.7197250, size.height); path_2.lineTo(size.width * 0.7929667, size.height); path_2.lineTo(size.width * 0.7929667, size.height * 0.3564454); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.7880875, size.height * 0.09765625); path_3.cubicTo(size.width * 0.7880875, size.height * 0.04380875, size.width * 0.7442792, 0, size.width * 0.6904292, 0); path_3.cubicTo( size.width * 0.6365833, 0, size.width * 0.5927750, size.height * 0.04380875, size.width * 0.5927750, size.height * 0.09765625); path_3.cubicTo( size.width * 0.5927750, size.height * 0.1515037, size.width * 0.6365833, size.height * 0.1953125, size.width * 0.6904292, size.height * 0.1953125); path_3.cubicTo( size.width * 0.7442792, size.height * 0.1953125, size.width * 0.7880875, size.height * 0.1515037, size.width * 0.7880875, size.height * 0.09765625); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); Path path_4 = Path(); path_4.moveTo(size.width * 0.5292958, 0); path_4.lineTo(size.width * 0.4707042, 0); path_4.lineTo(size.width * 0.4707042, size.height * 0.1178379); path_4.lineTo(size.width * 0.5292958, size.height * 0.1178379); path_4.lineTo(size.width * 0.5292958, 0); path_4.close(); Paint paint_4_fill = Paint()..style = PaintingStyle.fill; paint_4_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_4, paint_4_fill); Path path_5 = Path(); path_5.moveTo(size.width * 0.5292958, size.height * 0.1764325); path_5.lineTo(size.width * 0.4707042, size.height * 0.1764325); path_5.lineTo(size.width * 0.4707042, size.height * 0.2942717); path_5.lineTo(size.width * 0.5292958, size.height * 0.2942717); path_5.lineTo(size.width * 0.5292958, size.height * 0.1764325); path_5.close(); Paint paint_5_fill = Paint()..style = PaintingStyle.fill; paint_5_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_5, paint_5_fill); Path path_6 = Path(); path_6.moveTo(size.width * 0.5292958, size.height * 0.3528646); path_6.lineTo(size.width * 0.4707042, size.height * 0.3528646); path_6.lineTo(size.width * 0.4707042, size.height * 0.4707042); path_6.lineTo(size.width * 0.5292958, size.height * 0.4707042); path_6.lineTo(size.width * 0.5292958, size.height * 0.3528646); path_6.close(); Paint paint_6_fill = Paint()..style = PaintingStyle.fill; paint_6_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_6, paint_6_fill); Path path_7 = Path(); path_7.moveTo(size.width * 0.5292958, size.height * 0.5292958); path_7.lineTo(size.width * 0.4707042, size.height * 0.5292958); path_7.lineTo(size.width * 0.4707042, size.height * 0.6471333); path_7.lineTo(size.width * 0.5292958, size.height * 0.6471333); path_7.lineTo(size.width * 0.5292958, size.height * 0.5292958); path_7.close(); Paint paint_7_fill = Paint()..style = PaintingStyle.fill; paint_7_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_7, paint_7_fill); Path path_8 = Path(); path_8.moveTo(size.width * 0.5292958, size.height * 0.7057292); path_8.lineTo(size.width * 0.4707042, size.height * 0.7057292); path_8.lineTo(size.width * 0.4707042, size.height * 0.8235708); path_8.lineTo(size.width * 0.5292958, size.height * 0.8235708); path_8.lineTo(size.width * 0.5292958, size.height * 0.7057292); path_8.close(); Paint paint_8_fill = Paint()..style = PaintingStyle.fill; paint_8_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_8, paint_8_fill); Path path_9 = Path(); path_9.moveTo(size.width * 0.5292958, size.height * 0.8821625); path_9.lineTo(size.width * 0.4707042, size.height * 0.8821625); path_9.lineTo(size.width * 0.4707042, size.height); path_9.lineTo(size.width * 0.5292958, size.height); path_9.lineTo(size.width * 0.5292958, size.height * 0.8821625); path_9.close(); Paint paint_9_fill = Paint()..style = PaintingStyle.fill; paint_9_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_9, paint_9_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/debate_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class DebateIconPainter extends CustomPainter { const DebateIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.6171875, 0); path_0.lineTo(size.width * 0.3828125, 0); path_0.cubicTo( size.width * 0.3342717, 0, size.width * 0.2949217, size.height * 0.03934962, size.width * 0.2949217, size.height * 0.08789083); path_0.lineTo(size.width * 0.2949217, size.height * 0.2050783); path_0.cubicTo( size.width * 0.2949217, size.height * 0.2536192, size.width * 0.3342717, size.height * 0.2929688, size.width * 0.3828125, size.height * 0.2929688); path_0.lineTo(size.width * 0.4248167, size.height * 0.2929688); path_0.lineTo(size.width * 0.4748792, size.height * 0.3764004); path_0.cubicTo( size.width * 0.4862583, size.height * 0.3953654, size.width * 0.5137458, size.height * 0.3953654, size.width * 0.5251250, size.height * 0.3764004); path_0.lineTo(size.width * 0.5751833, size.height * 0.2929688); path_0.lineTo(size.width * 0.6171875, size.height * 0.2929688); path_0.cubicTo( size.width * 0.6657292, size.height * 0.2929688, size.width * 0.7050792, size.height * 0.2536192, size.width * 0.7050792, size.height * 0.2050783); path_0.lineTo(size.width * 0.7050792, size.height * 0.08789083); path_0.cubicTo(size.width * 0.7050792, size.height * 0.03934962, size.width * 0.6657292, 0, size.width * 0.6171875, 0); path_0.close(); path_0.moveTo(size.width * 0.5585917, size.height * 0.1757813); path_0.lineTo(size.width * 0.4414083, size.height * 0.1757813); path_0.cubicTo( size.width * 0.4252250, size.height * 0.1757813, size.width * 0.4121092, size.height * 0.1626642, size.width * 0.4121092, size.height * 0.1464842); path_0.cubicTo( size.width * 0.4121092, size.height * 0.1303046, size.width * 0.4252250, size.height * 0.1171875, size.width * 0.4414083, size.height * 0.1171875); path_0.lineTo(size.width * 0.5585917, size.height * 0.1171875); path_0.cubicTo( size.width * 0.5747750, size.height * 0.1171875, size.width * 0.5878917, size.height * 0.1303046, size.width * 0.5878917, size.height * 0.1464842); path_0.cubicTo( size.width * 0.5878917, size.height * 0.1626642, size.width * 0.5747750, size.height * 0.1757813, size.width * 0.5585917, size.height * 0.1757813); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.7753917, size.height * 0.4101563); path_1.cubicTo( size.width * 0.8131458, size.height * 0.4101563, size.width * 0.8437500, size.height * 0.3795508, size.width * 0.8437500, size.height * 0.3417967); path_1.cubicTo( size.width * 0.8437500, size.height * 0.3040429, size.width * 0.8131458, size.height * 0.2734375, size.width * 0.7753917, size.height * 0.2734375); path_1.cubicTo( size.width * 0.7376375, size.height * 0.2734375, size.width * 0.7070333, size.height * 0.3040429, size.width * 0.7070333, size.height * 0.3417967); path_1.cubicTo( size.width * 0.7070333, size.height * 0.3795508, size.width * 0.7376375, size.height * 0.4101563, size.width * 0.7753917, size.height * 0.4101563); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.9707042, size.height * 0.6054667); path_2.lineTo(size.width * 0.5800792, size.height * 0.6054667); path_2.cubicTo( size.width * 0.5639000, size.height * 0.6054667, size.width * 0.5507833, size.height * 0.6185875, size.width * 0.5507833, size.height * 0.6347667); path_2.lineTo(size.width * 0.5507833, size.height * 0.6640625); path_2.cubicTo( size.width * 0.5507833, size.height * 0.6802417, size.width * 0.5639000, size.height * 0.6933583, size.width * 0.5800792, size.height * 0.6933583); path_2.lineTo(size.width * 0.9707042, size.height * 0.6933583); path_2.cubicTo(size.width * 0.9868833, size.height * 0.6933583, size.width, size.height * 0.6802417, size.width, size.height * 0.6640625); path_2.lineTo(size.width, size.height * 0.6347667); path_2.cubicTo( size.width, size.height * 0.6185875, size.width * 0.9868833, size.height * 0.6054667, size.width * 0.9707042, size.height * 0.6054667); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.6193000, size.height * 0.9737792); path_3.cubicTo( size.width * 0.6208750, size.height * 0.9886875, size.width * 0.6334458, size.height, size.width * 0.6484333, size.height); path_3.lineTo(size.width * 0.9023417, size.height); path_3.cubicTo( size.width * 0.9173292, size.height, size.width * 0.9299000, size.height * 0.9886875, size.width * 0.9314750, size.height * 0.9737792); path_3.lineTo(size.width * 0.9549083, size.height * 0.7519542); path_3.lineTo(size.width * 0.5958667, size.height * 0.7519542); path_3.lineTo(size.width * 0.6193000, size.height * 0.9737792); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); Path path_4 = Path(); path_4.moveTo(size.width * 0.06851833, size.height * 0.9737792); path_4.cubicTo( size.width * 0.07009250, size.height * 0.9886875, size.width * 0.08266458, size.height, size.width * 0.09765292, size.height); path_4.lineTo(size.width * 0.3515592, size.height); path_4.cubicTo( size.width * 0.3665475, size.height, size.width * 0.3791200, size.height * 0.9886875, size.width * 0.3806942, size.height * 0.9737792); path_4.lineTo(size.width * 0.4041275, size.height * 0.7519542); path_4.lineTo(size.width * 0.04508458, size.height * 0.7519542); path_4.lineTo(size.width * 0.06851833, size.height * 0.9737792); path_4.close(); Paint paint_4_fill = Paint()..style = PaintingStyle.fill; paint_4_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_4, paint_4_fill); Path path_5 = Path(); path_5.moveTo(size.width * 0.4199208, size.height * 0.6054667); path_5.lineTo(size.width * 0.02929688, size.height * 0.6054667); path_5.cubicTo(size.width * 0.01311717, size.height * 0.6054667, 0, size.height * 0.6185875, 0, size.height * 0.6347667); path_5.lineTo(0, size.height * 0.6640625); path_5.cubicTo( 0, size.height * 0.6802417, size.width * 0.01311717, size.height * 0.6933583, size.width * 0.02929688, size.height * 0.6933583); path_5.lineTo(size.width * 0.4199208, size.height * 0.6933583); path_5.cubicTo( size.width * 0.4361000, size.height * 0.6933583, size.width * 0.4492167, size.height * 0.6802417, size.width * 0.4492167, size.height * 0.6640625); path_5.lineTo(size.width * 0.4492167, size.height * 0.6347667); path_5.cubicTo( size.width * 0.4492167, size.height * 0.6185875, size.width * 0.4361000, size.height * 0.6054667, size.width * 0.4199208, size.height * 0.6054667); path_5.close(); Paint paint_5_fill = Paint()..style = PaintingStyle.fill; paint_5_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_5, paint_5_fill); Path path_6 = Path(); path_6.moveTo(size.width * 0.8594667, size.height * 0.4368083); path_6.cubicTo( size.width * 0.8370542, size.height * 0.4566667, size.width * 0.8076125, size.height * 0.4687583, size.width * 0.7753875, size.height * 0.4687583); path_6.cubicTo( size.width * 0.7431583, size.height * 0.4687583, size.width * 0.7137167, size.height * 0.4566667, size.width * 0.6913042, size.height * 0.4368083); path_6.cubicTo( size.width * 0.6561042, size.height * 0.4615792, size.width * 0.6322417, size.height * 0.5014167, size.width * 0.6292333, size.height * 0.5468833); path_6.lineTo(size.width * 0.9215417, size.height * 0.5468833); path_6.cubicTo( size.width * 0.9185292, size.height * 0.5014208, size.width * 0.8946667, size.height * 0.4615792, size.width * 0.8594667, size.height * 0.4368083); path_6.close(); Paint paint_6_fill = Paint()..style = PaintingStyle.fill; paint_6_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_6, paint_6_fill); Path path_7 = Path(); path_7.moveTo(size.width * 0.3086867, size.height * 0.4368083); path_7.cubicTo( size.width * 0.2862746, size.height * 0.4566667, size.width * 0.2568313, size.height * 0.4687583, size.width * 0.2246050, size.height * 0.4687583); path_7.cubicTo( size.width * 0.1923783, size.height * 0.4687583, size.width * 0.1629350, size.height * 0.4566667, size.width * 0.1405229, size.height * 0.4368083); path_7.cubicTo( size.width * 0.1053237, size.height * 0.4615792, size.width * 0.08146042, size.height * 0.5014208, size.width * 0.07845042, size.height * 0.5468833); path_7.lineTo(size.width * 0.3707592, size.height * 0.5468833); path_7.cubicTo( size.width * 0.3677492, size.height * 0.5014208, size.width * 0.3438863, size.height * 0.4615792, size.width * 0.3086867, size.height * 0.4368083); path_7.close(); Paint paint_7_fill = Paint()..style = PaintingStyle.fill; paint_7_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_7, paint_7_fill); Path path_8 = Path(); path_8.moveTo(size.width * 0.2246092, size.height * 0.4101563); path_8.cubicTo( size.width * 0.2623633, size.height * 0.4101563, size.width * 0.2929688, size.height * 0.3795508, size.width * 0.2929688, size.height * 0.3417967); path_8.cubicTo( size.width * 0.2929688, size.height * 0.3040429, size.width * 0.2623633, size.height * 0.2734375, size.width * 0.2246092, size.height * 0.2734375); path_8.cubicTo( size.width * 0.1868554, size.height * 0.2734375, size.width * 0.1562500, size.height * 0.3040429, size.width * 0.1562500, size.height * 0.3417967); path_8.cubicTo( size.width * 0.1562500, size.height * 0.3795508, size.width * 0.1868554, size.height * 0.4101563, size.width * 0.2246092, size.height * 0.4101563); path_8.close(); Paint paint_8_fill = Paint()..style = PaintingStyle.fill; paint_8_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_8, paint_8_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/login_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class LoginIconPainter extends CustomPainter { const LoginIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.5000000, size.height); path_0.cubicTo(size.width * 0.7761429, size.height, size.width, size.height * 0.7761429, size.width, size.height * 0.5000000); path_0.cubicTo(size.width, size.height * 0.2238571, size.width * 0.7761429, 0, size.width * 0.5000000, 0); path_0.cubicTo(size.width * 0.2238571, 0, 0, size.height * 0.2238571, 0, size.height * 0.5000000); path_0.cubicTo(0, size.height * 0.7761429, size.width * 0.2238571, size.height, size.width * 0.5000000, size.height); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff45B39C).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.6676200, size.height * 0.2247914); path_1.cubicTo( size.width * 0.6618914, size.height * 0.2179171, size.width * 0.6532443, size.height * 0.2135429, size.width * 0.6436614, size.height * 0.2135429); path_1.lineTo(size.width * 0.3563700, size.height * 0.2135429); path_1.cubicTo( size.width * 0.3391814, size.height * 0.2135429, size.width * 0.3252229, size.height * 0.2275014, size.width * 0.3252229, size.height * 0.2446886); path_1.lineTo(size.width * 0.3252229, size.height * 0.7553157); path_1.cubicTo( size.width * 0.3252229, size.height * 0.7642729, size.width * 0.3290786, size.height * 0.7723986, size.width * 0.3352229, size.height * 0.7781286); path_1.lineTo(size.width * 0.5541357, size.height * 0.9970414); path_1.cubicTo( size.width * 0.7869971, size.height * 0.9719657, size.width * 0.9719186, size.height * 0.7870700, size.width * 0.9970386, size.height * 0.5542271); path_1.lineTo(size.width * 0.6676200, size.height * 0.2248971); path_1.lineTo(size.width * 0.6676200, size.height * 0.2247914); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Colors.black.withOpacity(0.1); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.6436386, size.height * 0.2336429); path_2.lineTo(size.width * 0.3563614, size.height * 0.2336429); path_2.cubicTo( size.width * 0.3391500, size.height * 0.2336429, size.width * 0.3251957, size.height * 0.2475971, size.width * 0.3251957, size.height * 0.2648086); path_2.lineTo(size.width * 0.3251957, size.height * 0.7552900); path_2.cubicTo( size.width * 0.3251957, size.height * 0.7725043, size.width * 0.3391500, size.height * 0.7864557, size.width * 0.3563614, size.height * 0.7864557); path_2.lineTo(size.width * 0.6436386, size.height * 0.7864557); path_2.cubicTo( size.width * 0.6608514, size.height * 0.7864557, size.width * 0.6748043, size.height * 0.7725043, size.width * 0.6748043, size.height * 0.7552900); path_2.lineTo(size.width * 0.6748043, size.height * 0.2648086); path_2.cubicTo( size.width * 0.6748043, size.height * 0.2475957, size.width * 0.6608514, size.height * 0.2336429, size.width * 0.6436386, size.height * 0.2336429); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xffE1E6E9).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.6436386, size.height * 0.2135429); path_3.lineTo(size.width * 0.3563614, size.height * 0.2135429); path_3.cubicTo( size.width * 0.3391500, size.height * 0.2135429, size.width * 0.3251957, size.height * 0.2274971, size.width * 0.3251957, size.height * 0.2447100); path_3.lineTo(size.width * 0.3251957, size.height * 0.7351900); path_3.cubicTo( size.width * 0.3251957, size.height * 0.7524043, size.width * 0.3391500, size.height * 0.7663571, size.width * 0.3563614, size.height * 0.7663571); path_3.lineTo(size.width * 0.6436386, size.height * 0.7663571); path_3.cubicTo( size.width * 0.6608514, size.height * 0.7663571, size.width * 0.6748043, size.height * 0.7524043, size.width * 0.6748043, size.height * 0.7351900); path_3.lineTo(size.width * 0.6748043, size.height * 0.2447100); path_3.cubicTo( size.width * 0.6748043, size.height * 0.2274971, size.width * 0.6608514, size.height * 0.2135429, size.width * 0.6436386, size.height * 0.2135429); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xffEBF0F3).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); Path path_4 = Path(); path_4.moveTo(size.width * 0.3563686, size.height * 0.6837900); path_4.cubicTo( size.width * 0.3558086, size.height * 0.6837900, size.width * 0.3553571, size.height * 0.6834086, size.width * 0.3553571, size.height * 0.6829314); path_4.lineTo(size.width * 0.3553571, size.height * 0.2668086); path_4.cubicTo( size.width * 0.3553571, size.height * 0.2663343, size.width * 0.3558086, size.height * 0.2659457, size.width * 0.3563686, size.height * 0.2659457); path_4.lineTo(size.width * 0.6436500, size.height * 0.2659457); path_4.cubicTo( size.width * 0.6442100, size.height * 0.2659457, size.width * 0.6446614, size.height * 0.2663329, size.width * 0.6446614, size.height * 0.2668086); path_4.lineTo(size.width * 0.6446614, size.height * 0.6829314); path_4.cubicTo( size.width * 0.6446614, size.height * 0.6834057, size.width * 0.6442100, size.height * 0.6837900, size.width * 0.6436500, size.height * 0.6837900); path_4.lineTo(size.width * 0.3563686, size.height * 0.6837900); path_4.close(); Paint paint_4_fill = Paint()..style = PaintingStyle.fill; paint_4_fill.color = Color(0xff64798A).withOpacity(1.0); canvas.drawPath(path_4, paint_4_fill); Path path_5 = Path(); path_5.moveTo(size.width * 0.4999971, size.height * 0.7542400); path_5.cubicTo( size.width * 0.4846757, size.height * 0.7542400, size.width * 0.4722100, size.height * 0.7417757, size.width * 0.4722100, size.height * 0.7264471); path_5.cubicTo( size.width * 0.4722100, size.height * 0.7111186, size.width * 0.4846757, size.height * 0.6986543, size.width * 0.4999971, size.height * 0.6986543); path_5.cubicTo( size.width * 0.5153186, size.height * 0.6986543, size.width * 0.5277843, size.height * 0.7111186, size.width * 0.5277843, size.height * 0.7264471); path_5.cubicTo( size.width * 0.5277843, size.height * 0.7417757, size.width * 0.5153186, size.height * 0.7542400, size.width * 0.4999971, size.height * 0.7542400); path_5.close(); path_5.moveTo(size.width * 0.4999971, size.height * 0.7087057); path_5.cubicTo( size.width * 0.4902214, size.height * 0.7087057, size.width * 0.4822600, size.height * 0.7166671, size.width * 0.4822600, size.height * 0.7264471); path_5.cubicTo( size.width * 0.4822600, size.height * 0.7362286, size.width * 0.4902214, size.height * 0.7441886, size.width * 0.4999971, size.height * 0.7441886); path_5.cubicTo( size.width * 0.5097729, size.height * 0.7441886, size.width * 0.5177343, size.height * 0.7362271, size.width * 0.5177343, size.height * 0.7264471); path_5.cubicTo( size.width * 0.5177343, size.height * 0.7166671, size.width * 0.5097729, size.height * 0.7087057, size.width * 0.4999971, size.height * 0.7087057); path_5.close(); Paint paint_5_fill = Paint()..style = PaintingStyle.fill; paint_5_fill.color = Color(0xff3A556A).withOpacity(1.0); canvas.drawPath(path_5, paint_5_fill); Path path_6 = Path(); path_6.moveTo(size.width * 0.5435286, size.height * 0.2467200); path_6.lineTo(size.width * 0.4565000, size.height * 0.2467200); path_6.cubicTo( size.width * 0.4523100, size.height * 0.2467200, size.width * 0.4489114, size.height * 0.2433229, size.width * 0.4489114, size.height * 0.2391314); path_6.cubicTo( size.width * 0.4489114, size.height * 0.2349400, size.width * 0.4523100, size.height * 0.2315429, size.width * 0.4565000, size.height * 0.2315429); path_6.lineTo(size.width * 0.5435286, size.height * 0.2315429); path_6.cubicTo( size.width * 0.5477200, size.height * 0.2315429, size.width * 0.5511171, size.height * 0.2349400, size.width * 0.5511171, size.height * 0.2391314); path_6.cubicTo( size.width * 0.5511186, size.height * 0.2433229, size.width * 0.5477200, size.height * 0.2467200, size.width * 0.5435286, size.height * 0.2467200); path_6.close(); Paint paint_6_fill = Paint()..style = PaintingStyle.fill; paint_6_fill.color = Color(0xff64798A).withOpacity(1.0); canvas.drawPath(path_6, paint_6_fill); Path path_7 = Path(); path_7.moveTo(size.width * 0.5000014, size.height * 0.4660643); path_7.cubicTo( size.width * 0.5472943, size.height * 0.4660643, size.width * 0.5856343, size.height * 0.4277257, size.width * 0.5856343, size.height * 0.3804329); path_7.cubicTo( size.width * 0.5856343, size.height * 0.3331386, size.width * 0.5472943, size.height * 0.2948000, size.width * 0.5000014, size.height * 0.2948000); path_7.cubicTo( size.width * 0.4527086, size.height * 0.2948000, size.width * 0.4143700, size.height * 0.3331386, size.width * 0.4143700, size.height * 0.3804329); path_7.cubicTo( size.width * 0.4143700, size.height * 0.4277257, size.width * 0.4527086, size.height * 0.4660643, size.width * 0.5000014, size.height * 0.4660643); path_7.close(); Paint paint_7_fill = Paint()..style = PaintingStyle.fill; paint_7_fill.color = Color(0xffF6C358).withOpacity(1.0); canvas.drawPath(path_7, paint_7_fill); Path path_8 = Path(); path_8.moveTo(size.width * 0.5000057, size.height * 0.4517829); path_8.cubicTo( size.width * 0.5394114, size.height * 0.4517829, size.width * 0.5713557, size.height * 0.4198371, size.width * 0.5713557, size.height * 0.3804314); path_8.cubicTo( size.width * 0.5713557, size.height * 0.3410271, size.width * 0.5394114, size.height * 0.3090814, size.width * 0.5000057, size.height * 0.3090814); path_8.cubicTo( size.width * 0.4606000, size.height * 0.3090814, size.width * 0.4286557, size.height * 0.3410271, size.width * 0.4286557, size.height * 0.3804314); path_8.cubicTo( size.width * 0.4286557, size.height * 0.4198371, size.width * 0.4606000, size.height * 0.4517829, size.width * 0.5000057, size.height * 0.4517829); path_8.close(); Paint paint_8_fill = Paint()..style = PaintingStyle.fill; paint_8_fill.color = Color(0xffFCD462).withOpacity(1.0); canvas.drawPath(path_8, paint_8_fill); Path path_9 = Path(); path_9.moveTo(size.width * 0.5000000, size.height * 0.4517614); path_9.cubicTo( size.width * 0.5257186, size.height * 0.4517614, size.width * 0.5481886, size.height * 0.4381086, size.width * 0.5607414, size.height * 0.4177000); path_9.cubicTo( size.width * 0.5478986, size.height * 0.3977357, size.width * 0.5255043, size.height * 0.3844971, size.width * 0.5000000, size.height * 0.3844971); path_9.cubicTo( size.width * 0.4744957, size.height * 0.3844971, size.width * 0.4521014, size.height * 0.3977343, size.width * 0.4392571, size.height * 0.4177000); path_9.cubicTo( size.width * 0.4518100, size.height * 0.4381086, size.width * 0.4742814, size.height * 0.4517614, size.width * 0.5000000, size.height * 0.4517614); path_9.close(); Paint paint_9_fill = Paint()..style = PaintingStyle.fill; paint_9_fill.color = Color(0xffDC8744).withOpacity(1.0); canvas.drawPath(path_9, paint_9_fill); Path path_10 = Path(); path_10.moveTo(size.width * 0.4999971, size.height * 0.3665971); path_10.cubicTo( size.width * 0.5124471, size.height * 0.3665971, size.width * 0.5225400, size.height * 0.3565043, size.width * 0.5225400, size.height * 0.3440543); path_10.cubicTo( size.width * 0.5225400, size.height * 0.3316043, size.width * 0.5124471, size.height * 0.3215129, size.width * 0.4999971, size.height * 0.3215129); path_10.cubicTo( size.width * 0.4875486, size.height * 0.3215129, size.width * 0.4774557, size.height * 0.3316043, size.width * 0.4774557, size.height * 0.3440543); path_10.cubicTo( size.width * 0.4774557, size.height * 0.3565043, size.width * 0.4875486, size.height * 0.3665971, size.width * 0.4999971, size.height * 0.3665971); path_10.close(); Paint paint_10_fill = Paint()..style = PaintingStyle.fill; paint_10_fill.color = Color(0xffDC8744).withOpacity(1.0); canvas.drawPath(path_10, paint_10_fill); Path path_11 = Path(); path_11.moveTo(size.width * 0.6094386, size.height * 0.4878343); path_11.lineTo(size.width * 0.3904857, size.height * 0.4878343); path_11.lineTo(size.width * 0.3904857, size.height * 0.5273343); path_11.lineTo(size.width * 0.6094386, size.height * 0.5273343); path_11.lineTo(size.width * 0.6094386, size.height * 0.4878343); path_11.close(); Paint paint_11_fill = Paint()..style = PaintingStyle.fill; paint_11_fill.color = Color(0xffEBF0F3).withOpacity(1.0); canvas.drawPath(path_11, paint_11_fill); Path path_12 = Path(); path_12.moveTo(size.width * 0.6094386, size.height * 0.5436414); path_12.lineTo(size.width * 0.3904857, size.height * 0.5436414); path_12.lineTo(size.width * 0.3904857, size.height * 0.5831414); path_12.lineTo(size.width * 0.6094386, size.height * 0.5831414); path_12.lineTo(size.width * 0.6094386, size.height * 0.5436414); path_12.close(); Paint paint_12_fill = Paint()..style = PaintingStyle.fill; paint_12_fill.color = Color(0xffEBF0F3).withOpacity(1.0); canvas.drawPath(path_12, paint_12_fill); Path path_13 = Path(); path_13.moveTo(size.width * 0.5584157, size.height * 0.6043700); path_13.lineTo(size.width * 0.4415743, size.height * 0.6043700); path_13.lineTo(size.width * 0.4415743, size.height * 0.6438700); path_13.lineTo(size.width * 0.5584157, size.height * 0.6438700); path_13.lineTo(size.width * 0.5584157, size.height * 0.6043700); path_13.close(); Paint paint_13_fill = Paint()..style = PaintingStyle.fill; paint_13_fill.color = Color(0xff2F4859).withOpacity(1.0); canvas.drawPath(path_13, paint_13_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/support_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class SupportIconPainter extends CustomPainter { const SupportIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.4999917, 0); path_0.cubicTo( size.width * 0.2891667, 0, size.width * 0.1176350, size.height * 0.1715317, size.width * 0.1176350, size.height * 0.3823546); path_0.lineTo(size.width * 0.1176350, size.height * 0.7352917); path_0.cubicTo( size.width * 0.1176350, size.height * 0.7839500, size.width * 0.1572163, size.height * 0.8235333, size.width * 0.2058692, size.height * 0.8235333); path_0.cubicTo( size.width * 0.2545292, size.height * 0.8235333, size.width * 0.2941104, size.height * 0.7839500, size.width * 0.2941104, size.height * 0.7352917); path_0.lineTo(size.width * 0.2941104, size.height * 0.4411792); path_0.cubicTo( size.width * 0.2941104, size.height * 0.3925246, size.width * 0.2545292, size.height * 0.3529433, size.width * 0.2058692, size.height * 0.3529433); path_0.cubicTo( size.width * 0.1959663, size.height * 0.3529433, size.width * 0.1865971, size.height * 0.3549500, size.width * 0.1776937, size.height * 0.3579713); path_0.cubicTo( size.width * 0.1902442, size.height * 0.1909563, size.width * 0.3298467, size.height * 0.05882250, size.width * 0.4999917, size.height * 0.05882250); path_0.cubicTo( size.width * 0.6700417, size.height * 0.05882250, size.width * 0.8096042, size.height * 0.1908342, size.width * 0.8222708, size.height * 0.3577346); path_0.cubicTo( size.width * 0.8134208, size.height * 0.3547058, size.width * 0.8040000, size.height * 0.3529433, size.width * 0.7941125, size.height * 0.3529433); path_0.cubicTo( size.width * 0.7454500, size.height * 0.3529433, size.width * 0.7058708, size.height * 0.3925246, size.width * 0.7058708, size.height * 0.4411792); path_0.lineTo(size.width * 0.7058708, size.height * 0.7352917); path_0.cubicTo( size.width * 0.7058708, size.height * 0.7839500, size.width * 0.7454500, size.height * 0.8235333, size.width * 0.7941125, size.height * 0.8235333); path_0.cubicTo( size.width * 0.8044708, size.height * 0.8235333, size.width * 0.8142750, size.height * 0.8214125, size.width * 0.8235208, size.height * 0.8181167); path_0.lineTo(size.width * 0.8235208, size.height * 0.8529417); path_0.cubicTo( size.width * 0.8235208, size.height * 0.8691708, size.width * 0.8103083, size.height * 0.8823542, size.width * 0.7941125, size.height * 0.8823542); path_0.lineTo(size.width * 0.5828083, size.height * 0.8823542); path_0.cubicTo( size.width * 0.5706208, size.height * 0.8481917, size.width * 0.5382833, size.height * 0.8235333, size.width * 0.4999917, size.height * 0.8235333); path_0.cubicTo( size.width * 0.4513375, size.height * 0.8235333, size.width * 0.4117558, size.height * 0.8631125, size.width * 0.4117558, size.height * 0.9117667); path_0.cubicTo( size.width * 0.4117558, size.height * 0.9604167, size.width * 0.4513375, size.height, size.width * 0.4999917, size.height); path_0.cubicTo( size.width * 0.5382833, size.height, size.width * 0.5706208, size.height * 0.9753333, size.width * 0.5828083, size.height * 0.9411792); path_0.lineTo(size.width * 0.7941125, size.height * 0.9411792); path_0.cubicTo( size.width * 0.8427625, size.height * 0.9411792, size.width * 0.8823458, size.height * 0.9015958, size.width * 0.8823458, size.height * 0.8529417); path_0.cubicTo( size.width * 0.8823458, size.height * 0.6760333, size.width * 0.8823458, size.height * 0.5594542, size.width * 0.8823458, size.height * 0.3823546); path_0.cubicTo(size.width * 0.8823458, size.height * 0.1715317, size.width * 0.7108125, 0, size.width * 0.4999917, 0); path_0.lineTo(size.width * 0.4999917, 0); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.9411625, size.height * 0.4171750); path_1.lineTo(size.width * 0.9411625, size.height * 0.7592792); path_1.cubicTo( size.width * 0.9753208, size.height * 0.7471000, size.width * 0.9999833, size.height * 0.7147583, size.width * 0.9999833, size.height * 0.6764583); path_1.lineTo(size.width * 0.9999833, size.height * 0.4999917); path_1.cubicTo( size.width * 0.9999833, size.height * 0.4617000, size.width * 0.9753208, size.height * 0.4293583, size.width * 0.9411625, size.height * 0.4171750); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(0, size.height * 0.4999917); path_2.lineTo(0, size.height * 0.6764583); path_2.cubicTo( 0, size.height * 0.7147583, size.width * 0.02466583, size.height * 0.7471000, size.width * 0.05882250, size.height * 0.7592792); path_2.lineTo(size.width * 0.05882250, size.height * 0.4171750); path_2.cubicTo(size.width * 0.02466583, size.height * 0.4293583, 0, size.height * 0.4617000, 0, size.height * 0.4999917); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/email_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class EmailIconPainter extends CustomPainter { const EmailIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.9583333, size.height * 0.1253333); path_0.cubicTo( size.width * 0.9540167, size.height * 0.1248887, size.width * 0.9496625, size.height * 0.1248887, size.width * 0.9453458, size.height * 0.1253333); path_0.lineTo(size.width * 0.05845417, size.height * 0.1253333); path_0.cubicTo( size.width * 0.05277000, size.height * 0.1254208, size.width * 0.04712333, size.height * 0.1262725, size.width * 0.04166667, size.height * 0.1278654); path_0.lineTo(size.width * 0.4993667, size.height * 0.5833333); path_0.lineTo(size.width * 0.9583333, size.height * 0.1253333); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.9962500, size.height * 0.1666667); path_1.lineTo(size.width * 0.5412500, size.height * 0.6209292); path_1.cubicTo( size.width * 0.5295417, size.height * 0.6325958, size.width * 0.5137000, size.height * 0.6391458, size.width * 0.4971875, size.height * 0.6391458); path_1.cubicTo( size.width * 0.4806750, size.height * 0.6391458, size.width * 0.4648333, size.height * 0.6325958, size.width * 0.4531250, size.height * 0.6209292); path_1.lineTo(size.width * 0.002187500, size.height * 0.1701129); path_1.cubicTo( size.width * 0.0008012333, size.height * 0.1752204, size.width * 0.00006620875, size.height * 0.1804838, 0, size.height * 0.1857771); path_1.lineTo(0, size.height * 0.8123417); path_1.cubicTo( 0, size.height * 0.8289625, size.width * 0.006584792, size.height * 0.8448958, size.width * 0.01830583, size.height * 0.8566500); path_1.cubicTo( size.width * 0.03002683, size.height * 0.8684000, size.width * 0.04592417, size.height * 0.8750000, size.width * 0.06250000, size.height * 0.8750000); path_1.lineTo(size.width * 0.9375000, size.height * 0.8750000); path_1.cubicTo( size.width * 0.9540750, size.height * 0.8750000, size.width * 0.9699750, size.height * 0.8684000, size.width * 0.9816958, size.height * 0.8566500); path_1.cubicTo(size.width * 0.9934167, size.height * 0.8448958, size.width, size.height * 0.8289625, size.width, size.height * 0.8123417); path_1.lineTo(size.width, size.height * 0.1857771); path_1.cubicTo( size.width * 0.9997500, size.height * 0.1792500, size.width * 0.9984875, size.height * 0.1728017, size.width * 0.9962500, size.height * 0.1666667); path_1.close(); path_1.moveTo(size.width * 0.1053125, size.height * 0.8123417); path_1.lineTo(size.width * 0.06187500, size.height * 0.8123417); path_1.lineTo(size.width * 0.06187500, size.height * 0.7675458); path_1.lineTo(size.width * 0.2890625, size.height * 0.5416667); path_1.lineTo(size.width * 0.3331250, size.height * 0.5858417); path_1.lineTo(size.width * 0.1053125, size.height * 0.8123417); path_1.close(); path_1.moveTo(size.width * 0.9368750, size.height * 0.8123417); path_1.lineTo(size.width * 0.8931250, size.height * 0.8123417); path_1.lineTo(size.width * 0.6653125, size.height * 0.5858417); path_1.lineTo(size.width * 0.7093750, size.height * 0.5416667); path_1.lineTo(size.width * 0.9365625, size.height * 0.7675458); path_1.lineTo(size.width * 0.9368750, size.height * 0.8123417); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui
mirrored_repositories/flutter_mockup_bloc/lib/utils/ui/drawer/hand_shake_icon_painter.dart
// ignore_for_file: non_constant_identifier_names import 'package:flutter/material.dart'; class HandShakeIconPainter extends CustomPainter { const HandShakeIconPainter(); @override void paint(Canvas canvas, Size size) { Path path_0 = Path(); path_0.moveTo(size.width * 0.2416658, size.height * 0.2541675); path_0.cubicTo( size.width * 0.2083321, size.height * 0.2208333, size.width * 0.06666583, size.height * 0.2125013, size.width * 0.02083204, size.height * 0.2083333); path_0.cubicTo( size.width * 0.01666600, size.height * 0.2083333, size.width * 0.01249804, size.height * 0.2083333, size.width * 0.008332042, size.height * 0.2124992); path_0.cubicTo(size.width * 0.004166017, size.height * 0.2166675, 0, size.height * 0.2250013, 0, size.height * 0.2291675); path_0.lineTo(0, size.height * 0.6041667); path_0.cubicTo( 0, size.height * 0.6166667, size.width * 0.008334000, size.height * 0.6250000, size.width * 0.02083400, size.height * 0.6250000); path_0.lineTo(size.width * 0.1458342, size.height * 0.6250000); path_0.cubicTo( size.width * 0.1541679, size.height * 0.6250000, size.width * 0.1625000, size.height * 0.6208333, size.width * 0.1666679, size.height * 0.6125000); path_0.cubicTo( size.width * 0.1666679, size.height * 0.6000000, size.width * 0.2416679, size.height * 0.3791675, size.width * 0.2500021, size.height * 0.2708354); path_0.cubicTo( size.width * 0.2500000, size.height * 0.2666675, size.width * 0.2500000, size.height * 0.2583354, size.width * 0.2416658, size.height * 0.2541675); path_0.close(); Paint paint_0_fill = Paint()..style = PaintingStyle.fill; paint_0_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_0, paint_0_fill); Path path_1 = Path(); path_1.moveTo(size.width * 0.6875042, size.height * 0.3541704); path_1.cubicTo( size.width * 0.6458375, size.height * 0.3416704, size.width * 0.6083375, size.height * 0.3250042, size.width * 0.5750042, size.height * 0.3125042); path_1.cubicTo( size.width * 0.5000042, size.height * 0.2791704, size.width * 0.4666667, size.height * 0.2958383, size.width * 0.4000025, size.height * 0.3625042); path_1.cubicTo( size.width * 0.3708362, size.height * 0.3916704, size.width * 0.3500025, size.height * 0.4333375, size.width * 0.3541683, size.height * 0.4500042); path_1.cubicTo( size.width * 0.3541683, size.height * 0.4541708, size.width * 0.3541683, size.height * 0.4541708, size.width * 0.3625025, size.height * 0.4583375); path_1.cubicTo( size.width * 0.3833362, size.height * 0.4666708, size.width * 0.4125025, size.height * 0.4708375, size.width * 0.4416667, size.height * 0.4250042); path_1.cubicTo( size.width * 0.4458333, size.height * 0.4208375, size.width * 0.4500042, size.height * 0.4166708, size.width * 0.4583333, size.height * 0.4166708); path_1.cubicTo( size.width * 0.4708333, size.height * 0.4166708, size.width * 0.4750000, size.height * 0.4125042, size.width * 0.4875000, size.height * 0.4083363); path_1.cubicTo( size.width * 0.4958333, size.height * 0.4041704, size.width * 0.5041667, size.height * 0.4000021, size.width * 0.5166667, size.height * 0.3958362); path_1.cubicTo( size.width * 0.5208333, size.height * 0.3958362, size.width * 0.5208333, size.height * 0.3958362, size.width * 0.5250000, size.height * 0.3958362); path_1.cubicTo( size.width * 0.5291667, size.height * 0.3958362, size.width * 0.5375000, size.height * 0.4000021, size.width * 0.5416667, size.height * 0.4000021); path_1.cubicTo( size.width * 0.5625042, size.height * 0.4208375, size.width * 0.6000042, size.height * 0.4500042, size.width * 0.6375042, size.height * 0.4833375); path_1.cubicTo( size.width * 0.6958375, size.height * 0.5291708, size.width * 0.7541667, size.height * 0.5791708, size.width * 0.7833375, size.height * 0.6166708); path_1.lineTo(size.width * 0.7875042, size.height * 0.6166708); path_1.cubicTo( size.width * 0.7583375, size.height * 0.5333375, size.width * 0.7083375, size.height * 0.3916700, size.width * 0.6875042, size.height * 0.3541704); path_1.close(); Paint paint_1_fill = Paint()..style = PaintingStyle.fill; paint_1_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_1, paint_1_fill); Path path_2 = Path(); path_2.moveTo(size.width * 0.9791667, size.height * 0.2500000); path_2.cubicTo( size.width * 0.8166667, size.height * 0.2500000, size.width * 0.7250000, size.height * 0.2916658, size.width * 0.7208333, size.height * 0.2916658); path_2.cubicTo( size.width * 0.7166667, size.height * 0.2958321, size.width * 0.7125000, size.height * 0.3000000, size.width * 0.7083333, size.height * 0.3041658); path_2.cubicTo( size.width * 0.7083333, size.height * 0.3083321, size.width * 0.7083333, size.height * 0.3166658, size.width * 0.7125000, size.height * 0.3208321); path_2.cubicTo( size.width * 0.7375000, size.height * 0.3624979, size.width * 0.8208333, size.height * 0.5916667, size.width * 0.8333333, size.height * 0.6500000); path_2.cubicTo( size.width * 0.8375000, size.height * 0.6583333, size.width * 0.8458333, size.height * 0.6666625, size.width * 0.8541667, size.height * 0.6666625); path_2.lineTo(size.width * 0.9791667, size.height * 0.6666625); path_2.cubicTo( size.width * 0.9916667, size.height * 0.6666625, size.width * 1.000004, size.height * 0.6583292, size.width * 1.000004, size.height * 0.6458292); path_2.lineTo(size.width * 1.000004, size.height * 0.2708300); path_2.cubicTo( size.width * 1.000004, size.height * 0.2583342, size.width * 0.9916667, size.height * 0.2500000, size.width * 0.9791667, size.height * 0.2500000); path_2.close(); Paint paint_2_fill = Paint()..style = PaintingStyle.fill; paint_2_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_2, paint_2_fill); Path path_3 = Path(); path_3.moveTo(size.width * 0.7541708, size.height * 0.6583333); path_3.cubicTo( size.width * 0.7375083, size.height * 0.6208333, size.width * 0.6666708, size.height * 0.5666667, size.width * 0.6041708, size.height * 0.5166667); path_3.cubicTo( size.width * 0.5708417, size.height * 0.4875000, size.width * 0.5375083, size.height * 0.4625000, size.width * 0.5125083, size.height * 0.4416667); path_3.cubicTo( size.width * 0.5083417, size.height * 0.4458333, size.width * 0.5000083, size.height * 0.4458333, size.width * 0.5000083, size.height * 0.4500000); path_3.cubicTo( size.width * 0.4875083, size.height * 0.4541667, size.width * 0.4833417, size.height * 0.4583333, size.width * 0.4666708, size.height * 0.4583333); path_3.cubicTo( size.width * 0.4333417, size.height * 0.5000000, size.width * 0.3916729, size.height * 0.5166667, size.width * 0.3458408, size.height * 0.5000000); path_3.cubicTo( size.width * 0.3250067, size.height * 0.4958333, size.width * 0.3125067, size.height * 0.4791667, size.width * 0.3083408, size.height * 0.4625000); path_3.cubicTo( size.width * 0.3000067, size.height * 0.4208333, size.width * 0.3375067, size.height * 0.3624992, size.width * 0.3666750, size.height * 0.3333333); path_3.lineTo(size.width * 0.2833408, size.height * 0.3333333); path_3.cubicTo( size.width * 0.2666750, size.height * 0.4166667, size.width * 0.2375067, size.height * 0.5250000, size.width * 0.2166750, size.height * 0.5833333); path_3.cubicTo( size.width * 0.2333408, size.height * 0.6000000, size.width * 0.2500088, size.height * 0.6208333, size.width * 0.2625088, size.height * 0.6291667); path_3.cubicTo( size.width * 0.3416750, size.height * 0.6958333, size.width * 0.4333417, size.height * 0.7625000, size.width * 0.4500083, size.height * 0.7750000); path_3.cubicTo( size.width * 0.4625083, size.height * 0.7833333, size.width * 0.4875083, size.height * 0.7916667, size.width * 0.5000083, size.height * 0.7916667); path_3.cubicTo( size.width * 0.5041750, size.height * 0.7916667, size.width * 0.5083417, size.height * 0.7916667, size.width * 0.5125083, size.height * 0.7916667); path_3.lineTo(size.width * 0.4458417, size.height * 0.7250000); path_3.cubicTo( size.width * 0.4375083, size.height * 0.7166667, size.width * 0.4375083, size.height * 0.7041667, size.width * 0.4458417, size.height * 0.6958333); path_3.cubicTo( size.width * 0.4541750, size.height * 0.6875000, size.width * 0.4666750, size.height * 0.6875000, size.width * 0.4750083, size.height * 0.6958333); path_3.lineTo(size.width * 0.5583417, size.height * 0.7791667); path_3.cubicTo( size.width * 0.5666750, size.height * 0.7875000, size.width * 0.5750083, size.height * 0.7833333, size.width * 0.5833417, size.height * 0.7833333); path_3.cubicTo( size.width * 0.5958417, size.height * 0.7791667, size.width * 0.6000083, size.height * 0.7708333, size.width * 0.6041750, size.height * 0.7583333); path_3.lineTo(size.width * 0.5083417, size.height * 0.6625000); path_3.cubicTo( size.width * 0.5000083, size.height * 0.6541667, size.width * 0.5000083, size.height * 0.6416667, size.width * 0.5083417, size.height * 0.6333333); path_3.cubicTo( size.width * 0.5166750, size.height * 0.6250000, size.width * 0.5291750, size.height * 0.6250000, size.width * 0.5375083, size.height * 0.6333333); path_3.lineTo(size.width * 0.6416708, size.height * 0.7375000); path_3.cubicTo( size.width * 0.6458375, size.height * 0.7416667, size.width * 0.6625083, size.height * 0.7416667, size.width * 0.6750083, size.height * 0.7375000); path_3.cubicTo( size.width * 0.6791708, size.height * 0.7333333, size.width * 0.6875083, size.height * 0.7291667, size.width * 0.6916708, size.height * 0.7208333); path_3.lineTo(size.width * 0.5750083, size.height * 0.6041667); path_3.cubicTo( size.width * 0.5666708, size.height * 0.5958333, size.width * 0.5666708, size.height * 0.5833333, size.width * 0.5750083, size.height * 0.5750000); path_3.cubicTo( size.width * 0.5833417, size.height * 0.5666667, size.width * 0.5958417, size.height * 0.5666667, size.width * 0.6041708, size.height * 0.5750000); path_3.lineTo(size.width * 0.7250083, size.height * 0.6958333); path_3.cubicTo( size.width * 0.7333417, size.height * 0.7000000, size.width * 0.7416708, size.height * 0.6958333, size.width * 0.7500083, size.height * 0.6916667); path_3.cubicTo( size.width * 0.7541708, size.height * 0.6875000, size.width * 0.7625083, size.height * 0.6750000, size.width * 0.7541708, size.height * 0.6583333); path_3.close(); Paint paint_3_fill = Paint()..style = PaintingStyle.fill; paint_3_fill.color = Color(0xff4C5BD4).withOpacity(1.0); canvas.drawPath(path_3, paint_3_fill); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }
0