Building adaptive apps from Flutter docs
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
class WidgetCache<T> extends StatefulWidget { | |
const WidgetCache({ | |
super.key, | |
required this.value, | |
required this.builder, | |
}); | |
final T value; | |
final Widget Function(BuildContext context, T value) builder; |
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 'dart:isolate'; | |
import 'package:flutter/material.dart'; | |
void computeIsolate(Message message) { | |
Stream<int> streamcompute(numb) async* { | |
for (var i = 0; i < numb; i++) { | |
yield i; | |
} |
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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@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
[ +91 ms] executing: [/Users/owner/development/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ +58 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H | |
[ ] b1395592de68cc8ac4522094ae59956dd21a91db | |
[ ] executing: [/Users/owner/development/flutter/] git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db | |
[ +22 ms] Exit code 0 from: git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db | |
[ ] 2.0.4 | |
[ +49 ms] executing: [/Users/owner/development/flutter/] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +13 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ ] origin/stable | |
[ ] executing: [/Users/owner/development/flutter/] git ls-remote --get-url origin |
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:i18n_extension/i18n_extension.dart'; | |
extension Localization on String { | |
static var _t = Translations.byLocale("fr_fr") + | |
{ | |
"en_US": { | |
"SAVE YOUR MONEY": "SAVE YOUR MONEY", | |
"Create blocked savings account into which you keep money saved for a specified period of time.": | |
"Create blocked savings account into which you keep money saved for a specified period of time.", | |
"QUICK PAYMENTS": "QUICK PAYMENTS", |
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()); | |
double kHeight = 100; | |
double kWidth = 100; | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="com.example.permissionhandlerexample"> | |
<!-- | |
Internet permissions do not affect the `permission_handler` plugin, but are required if your app needs access to | |
the internet. | |
--> | |
<uses-permission android:name="android.permission.INTERNET"/> |
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( | |
MaterialApp( | |
theme: themeData, | |
home: Scaffold( | |
body: MyApp(), | |
), | |
), |
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( | |
MaterialApp( | |
theme: themeData, | |
home: Scaffold( | |
body: MyApp(), | |
), | |
), |