One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
import java.util.regex.Pattern | |
def versionMajor = 1 | |
def versionMinor = 0 | |
def versionPatch = 0 | |
buildscript { | |
repositories { | |
mavenCentral() | |
} |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(HomePage()); | |
} | |
class HomePage extends StatefulWidget { | |
@override |
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; | |
void main() => runApp(ExampleApp()); | |
class ExampleApp extends StatelessWidget { | |
@override |
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
#dart:convert example
How to pretty-print JSON using Dart.
How to display JSON in an easy-to-read (for human readers) format.
Main library: dart:convert
Main element: JsonEncoder.withIndent
Gist: https://gist.github.com/kasperpeulen/d61029fc0bc6cd104602
import 'dart:async'; | |
import 'dart:core'; | |
import 'dart:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:path/path.dart' as p; | |
import 'package:path_provider/path_provider.dart'; | |
void main() => runLoggedApp(App()); |
- `flutter channel master && flutter doctor` | |
- `export ENABLE_FLUTTER_DESKTOP=true` | |
- `git clone git@github.com:google/flutter-desktop-embedding.git` | |
- Move your project inside the `flutter-desktop-embedding` folder | |
- Copy the `macos` folder from `flutter-desktop-embedding/example` to your project | |
- `cd flutter-desktop-embedding/my-project && flutter run -d macos` |
- (UIImage *)dynamicImage | |
{ | |
UITraitCollection *const baseTraitCollection = /* an existing trait collection */; | |
UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]]; | |
UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; | |
UITraitCollection *const darkTraitCollection = UITraitCollection *lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]]; | |
__block UIImage *lightImage; | |
[lightTraitCollection performAsCurrentTraitCollection:^{ | |
lightImage = /* draw image */; |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'dart:math' as math; | |
void main() => runApp(DemoApp()); | |
class DemoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |