This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart'; | |
import 'package:url_launcher/url_launcher.dart'; | |
/// Flutter code sample for [BottomNavigationBar]. | |
void main() => runApp(const BottomNavigationBarExampleApp()); | |
class BottomNavigationBarExampleApp extends StatelessWidget { | |
const BottomNavigationBarExampleApp({super.key}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async{ | |
final sample=Sample(); | |
await Future.delayed(Duration(milliseconds:100)); | |
for(int i=0;i<5;i++){ | |
print(i); | |
sample.averageReading; | |
sample.averageReading2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:rxdart/rxdart.dart'; | |
void main() async { | |
final fakeAdapter = FakeBluetoothAdapter(); | |
final sub = fakeAdapter | |
.availableDevices() | |
.listen(print); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MaterialApp(home: MyHomePage())); | |
} | |
class MyHomePage extends StatelessWidget { | |
const MyHomePage({super.key}); | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Interacts with services and provide observables that read or update settings. | |
/// | |
/// Controllers glue Data Services to Flutter Widgets. The SettingsController | |
/// uses the SettingsService to store and retrieve user settings. | |
class SettingsController with ChangeNotifier { | |
// Make SettingsService a private variable so it is not used directly. " Law of Demeter " | |
final SettingsService _settingsService; | |
late int counter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:shared_preferences/shared_preferences.dart'; | |
/// A service that stores and retrieves user settings. | |
/// | |
/// This class persists its data via SharedPreferences plugin | |
class SettingsService { | |
final SharedPreferences _sharedPreferences; | |
SettingsService(this._sharedPreferences); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
/// A widget that executes a [callback] on several conditions. | |
/// | |
/// - If [pollingTime] is not null the [callback] will be executed periodically given that [pollingTime] | |
/// This widget respects the apps lifecycle and won't execute the callback if the app is in the background. | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
final loadingProvider = StateProvider<bool>((ref) => false); | |
void main() => runApp(const ProviderScope(child: MaterialApp(home: GlobalLoadingIndicator(child: Home())))); | |
class Home extends ConsumerWidget { | |
const Home({Key? key}) : super(key: key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | |
/// Given a [focusNode] when it gains focus it will scroll to the widget that is wrapped by [ScrollWhenFocusGained] | |
/// Useful for when working with forms in which they keyboard can obscure areas of the screen. | |
/// It also provides a [onFocus] fallback method to be execute if the view could not be scrolled correctly. | |
/// |
NewerOlder