Skip to content

Instantly share code, notes, and snippets.

import 'dart:ui' as ui;
import 'package:shared_preferences/shared_preferences.dart';
Future<void> setAppLanguageDynamic(
BuildContext context, String languageCode) async {
final locale = ui.PlatformDispatcher.instance.locale;
final String languageOnly = locale.languageCode;
bool found = false;
TutorialCoachMark createPageWalkthrough(BuildContext context) =>
TutorialCoachMark(
targets: createWalkthroughTargets(context),
onFinish: () async {
safeSetState(() => _model.pageWalkthroughController = null);
FFAppState().pageWalkthroughIsDone = true;
},
onSkip: () {
() async {
FFAppState().pageWalkthroughIsDone = true;
/*
Scroll to a widget with a given key
*/
Future<void> _scrollToWidget(GlobalKey key) async {
final context = key.currentContext;
if (context != null) {
await Scrollable.ensureVisible(
context,
duration: Duration(milliseconds: 500),