Skip to content

Instantly share code, notes, and snippets.

View boeledi's full-sized avatar

Didier Boelens boeledi

View GitHub Profile
class MyStatelessWidget extends StatelessWidget {
const MyStatelessWidget({
super.key,
required this.parameter,
});
final parameter;
@override
Widget build(BuildContext context) {
@override
Widget build(BuildContext) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: ApplicationSample(),
),
);
}
@boeledi
boeledi / OverlayableContainerOnLongPress_sample.dart
Last active May 1, 2024 04:47
How to display an overlay on top of a particular item, present in a Scroll Area, on longPress?
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
///
/// Launch the application
///
runApp(const Application());
}
@boeledi
boeledi / all_translations_sample.dart
Created October 18, 2018 22:27
Sample to implement the all_translations.dart
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'all_translations.dart';
void main() async {
// Initializes the translation module
await allTranslations.init();
// then start the application
runApp( MyApplication(),);
@boeledi
boeledi / all_translations.dart
Last active July 31, 2019 13:52
Module to handle multi-lingual
import 'dart:async';
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
///
/// Preferences related
///
const String _storageKey = "MyApplication_";
@boeledi
boeledi / shared_preferences.dart
Last active January 28, 2024 22:23
Sample to show a way of using the SharedPreferences in a build
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
List<String> _languages = <String>['de','en','es','fr','it','nl','pt'];
class TestPage extends StatefulWidget {
@override
_TestPageState createState() => _TestPageState();