sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: flutter
Issue: Detecting physical power button press in flutter
Labels: c: new feature,framework,customer: crowd,P3,team-framework,triaged-framework

Hello,

I need to detect a double click of the physical power button in flutter. I tried using this example code below, but when i run it throws this error:
```
I/flutter (13958): keyboardType: TextInputType(name: TextInputType.text, signed: null, decimal: null), dirty,
I/flutter (13958): dependencies: [_FocusMarker], state: EditableTextState#78ca3(tickers: tracking 2 tickers)):
I/flutter (13958): Tried to make a child into a parent of itself.
I/flutter (13958): 'package:flutter/src/widgets/focus_manager.dart':
I/flutter (13958): Failed assertion: line 626 pos 12: 'child != this'
```

the code is here:

```
class _RawKeyboardListenerState extends State<KeyboardListener> {
  TextEditingController _controller = new TextEditingController();
  FocusNode _textNode = new FocusNode();

  @override
  initState() {
    super.initState();
  }

  handleKey(RawKeyEventDataAndroid key) {
    print('KeyCode: ${key.keyCode}, CodePoint: ${key.codePoint}, '
        'Flags: ${key.flags}, MetaState: ${key.metaState}, '
        'ScanCode: ${key.scanCode}');
  }

  @override
  Widget build(BuildContext context) {
    return RawKeyboardListener(
      focusNode: _textNode,
      onKey: (key) => handleKey(key.data),
      child: TextField(
        controller: _controller,
        focusNode: _textNode,
      ),
    );
  }
```
Repository: flutter
Issue: Improve the Flutter installation process
Labels: tool,framework,from: study,a: first hour,c: proposal,P3,team-framework,triaged-framework

According to a recent user study, completing the installation process is associated with higher user retention.

Note: While flutter/website#7778 describes *ways to assist the users* during the installation process to help them complete the process, this issue describes *potential tooling changes* we can consider to make the installation process easier.  

Some potential changes have been proposed:
* Offer precompiled shells for Windows, Linux, and macOS using the desktop embedder that allow a zero setup workflow
* Offer a new `flutter preview` verb which is able to `run` and `reload` .dart code against a prebuilt runner, thus not requiring any other installation than the SDK
* Reduce the extra time in macOS due to platform-specific tools like brew or cocoapods
* Experiment different installation instructions (E.g., Does git clone v. unzip Flutter affect installation experience and user retention? Would the homebrew install package be better?)
* Change `flutter doctor` so that it produces error output for the host & target platforms that the developer is actually interested in
* Changed the order of installation process so that the `flutter doctor` is the last step

cc'ing the contributors of the action items doc: @timsneath, @csells, @mit-mit, @christopherfujino, @gaaclarke, @johnpryan, @tvolkert, @jonahwilliams, @eseidel
Repository: flutter
Issue: [flutter_runner] flutter_runner tests migrate the fonts resources to engine tree
Labels: customer: fuchsia,engine,P2,team-engine,triaged-engine

We still have not migrated the tests. Once we have them in our tree, move the dependent resources to the engine tree too.
Repository: ant-design
Issue: The treeDefaultExpandedKeys attribute or treeExpandedKeys attribute of the TreeSelect component will not open child node when dynamic data
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### Reproduction link
[https://codepen.io/lsunflower/pen/MNoorR?editors=0010](https://codepen.io/lsunflower/pen/MNoorR?editors=0010)

### Steps to reproduce
Click the treeselect,Only expanded the first level treenode.

### What is expected?
Expanded all keys  （treeExpandedKeys)

### What is actually happening?
Only expanded the first level treenode.

| Environment | Info |
|---|---|
| antd | 3.20.7 |
| React | 16 |
| System | windows10 |
| Browser |  Google Chrome 75.0.3770.142 64bit |


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: rust
Issue: spurious error "cannot borrow `*x` as mutable more than once at a time"
Labels: C-enhancement,T-compiler,A-NLL,NLL-polonius

```rust
pub enum Foo<'a> {
    A(&'a mut u8),
    B(&'a mut Option<u8>),
}

pub fn foo(x: &mut Option<u8>) -> Foo {
    match *x {
        Some(ref mut y) if *y == 0 => Foo::A(y),
        ref mut z => Foo::B(z),
    }
}
```

([Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9aa85d24c70ca1f05a41441093351901))

```
warning[E0499]: cannot borrow `*x` as mutable more than once at a time
  --> src/lib.rs:10:9
   |
7  | pub fn foo(x: &mut Option<u8>) -> Foo {
   |               - let's call the lifetime of this reference `'1`
8  |     match *x {
9  |         Some(ref mut y) if *y == 0 => Foo::A(y),
   |              ---------                --------- returning this value requires that `x.0` is borrowed for `'1`
   |              |
   |              first mutable borrow occurs here
10 |         ref mut z => Foo::B(z),
   |         ^^^^^^^^^ second mutable borrow occurs here
   |
   = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
   = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
```

I fail to see any potential undefined behaviour in this code.

Removing the match arm guard allows this to compile.

Also weird that the error mentions `x.0` when `x` is not a tuple.
Repository: rust
Issue: Suggested improvements to `usage-of-qualified-ty` lint
Labels: A-lints,T-compiler

Firstly, I don't even know why `ty::Ty` is a big problem... but I guess it's a readability choice someone made? Moreover, these lints had me stumped for a while.
* "Qualified" should probably read something like "Namespace-qualified" to be explicit.
* `Ty<>` should read `Ty`.
* The spans aren't great here. (They should probably just point to the `Ty::<'tcx>` bits.)

```
error: usage of qualified `ty::Ty<'tcx>`
   --> src/librustc_mir/interpret/operand.rs:175:18
    |
175 |         let ty = ty::Ty::<'tcx>::decode(self)?;
    |                  ^^^^^^^^^^^^^^^^^^^^^^ help: try using it unqualified: `Ty<'tcx>`
    |
    = note: `-D rustc::usage-of-qualified-ty` implied by `-D rustc::internal`
```

```
error: usage of qualified `ty::Ty<>`
   --> src/librustc_mir/interpret/operand.rs:175:18
    |
175 |         let ty = ty::Ty::decode(self)?;
    |                  ^^^^^^^^^^^^^^ help: try using it unqualified: `Ty<>`
    |
    = note: `-D rustc::usage-of-qualified-ty` implied by `-D rustc::internal`
```

CC @estebank
Repository: TypeScript
Issue: Module Namespace Exotic Objects are incorrectly typed as if they have an Object prototype
Labels: Suggestion,In Discussion

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.3

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

- import hasOwnProperty
- import star hasOwnProperty
- namespace exotic object
- import prototype

**Code**

```ts
import * as Foo from "./Foo"
if (foo.hasOwnProperty("bar")) {
  console.log(foo.bar)
}
```

**Expected behavior:**

Type error due to `hasOwnProperty` not existing, as the ["module namespace exotic object" should have a `null` prototype](https://tc39.es/ecma262/#table-29).

**Actual behavior:**

Code runs producing runtime error that `hasOwnProperty` is `undefined`.
Repository: create-react-app
Issue: Async anonymous function get lost in production
Labels: issue: bug

### Describe the bug

I have a function which calls an async anonymous function. Everything is fine in development but in production the relevant code is lost.

My code: 

```
    getPOIInformation = (index) => {
        const activePOIObject = pois[this.state.activePOIIndex];
        const properties = activePOIObject.geojson.features[index].properties;
        console.log(properties);

        if (!properties.additionalInformation) {

            properties.additionalInformation = "LOADING";

            (async function () {
                const response = await api.getPoiInformation({ type: properties.osmType, id: properties.id });
                properties.additionalInformation = response;
                this.forceUpdate();
            }).bind(this)();

        }

        return properties.additionalInformation;
    }
```

Code after run build: 
```
a.getPOIInformation = function (e) {
        var t = qe[a.state.activePOIIndex].geojson.features[e].properties;
        return console.log(t),
            t.additionalInformation || (t.additionalInformation = "LOADING"),
            t.additionalInformation
    }
```

I think there is something in the webpack/babel configuration wrong.
Repository: flutter
Issue: [google_maps_flutter] Can't Keep Camera In Center When Rotating
Labels: framework,f: gestures,p: maps,package,team-ecosystem,has reproducible steps,P2,found in release: 2.0,triaged-ecosystem

GoogleMap behaves differently on iOS and Android when `scrollGesturesEnabled: false`.

On iOS it behaves as expected => zooming and rotating does not effect the CameraPosition, and the Marker stays always centered.

On Android it does **not** => the CameraPosition changes and the Marker does **not** stay centered.

Sample App
```dart
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

void main() => runApp(MapPage());

class MapPage extends StatefulWidget {
  @override
  _MapPageState createState() => _MapPageState();
}

class _MapPageState extends State<MapPage> {
  final Map<String, Marker> _markers = {};

  Future<void> _onMapCreated(GoogleMapController controller) async {
    setState(() {
      _markers.clear();
      _markers['position'] = Marker(
        markerId: MarkerId('position'),
        position: LatLng(51.752022, -1.257677),
      );
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Google Maps'),
        ),
        body: GoogleMap(
          mapType: MapType.normal,
          onMapCreated: _onMapCreated,
          initialCameraPosition: CameraPosition(
            target: const LatLng(51.752022, -1.257677),
            zoom: 14,
          ),
          markers: _markers.values.toSet(),
          myLocationButtonEnabled: false,
          scrollGesturesEnabled: false,
          compassEnabled: false,
          zoomGesturesEnabled: true,
          tiltGesturesEnabled: false,
          rotateGesturesEnabled: true,
        ),
      ),
    );
  }
}
```
Repository: TypeScript
Issue: Index signature alternative
Labels: Suggestion,Awaiting More Feedback

## Search Terms

* Index signature alternative
* Index signature

## Suggestion

An alternative of Index signature would be beneficial when you want to enforce, that all properties of an object must follow given pattern, without the need of `[key: string | number]: T1`.

My suggestion is to enable the use of `?` for index signatures to mark them as type guards only.

```ts-lang
type posParams = {
  [name?: string]: UrlSegment;
};
```

## Use Cases

Whenever there is a need for an object with unknown keys, but known value types this would come in handy. A lot of people trying to implement some sort of callback that requires the index signature fails.The enormous number of results if one googles `Index signature is missing in type` confirms this

I personally tend to confront this problem regularly when working with frameworks..

## Examples

For this example, I will use Angular, but this is applicable to any typescript code.

```lang-ts
type UrlMatchResult = {
  consumed: UrlSegment[];
  posParams?: {
    [name?: string]: UrlSegment;
  };
};
```

When one would be to implement it with only specific `posParams` it would only check for the type of the object keys and values.

```lang-ts
export interface IUrlParameters {
	baseFolder: UrlSegment;
	currentFolder?: UrlSegment;
}

export function folderMatcher(segments: UrlSegment[]): UrlMatchResult {
  const posParams: IUrlParameters  = {
    currentFolder: segments[0],
  };

  return {
    consumed: segments,
    posParams,
  }
}
```

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [-] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: TypeScript
Issue: Unexpected type assertion result
Labels: Needs Investigation

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.6.0-dev.20190801

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

- `type assertion absolute import`
- `type assertion import`
- `type cast absolute import`
- `type cast import`
- `type assertion pick`

**Code**

**Repo**: https://github.com/klemenoslaj/typescript-type-assertion

`generated/types.d.ts`
---
```typescript
export interface TypeD {
  da: string;
  db: string;
  dc: string;
}

export interface Test { 
  a: string;
  b: string;
  c: string;
  d?: { __private: 'd' } & TypeD;
}
```

`src/index.model.ts`
---
```typescript
import { Test } from 'generated/types';

type DType = NonNullable<Test['d']>;
export type Model = Pick<DType, keyof Exclude<DType, '__private'>>;
```

`src/index.ts`
---
```typescript
import { Model } from './index.model';

export class A {
    value = <Model>{};
}
```

`dist/index.model.d.ts`
---
```typescript
import { Test } from 'generated/types';
declare type DType = NonNullable<Test['d']>;
export declare type Model = Pick<DType, keyof Exclude<DType, '__private'>>;
export {};
```
`dist/index.d.ts`
---
```typescript
export declare class A {
    value: Pick<{
        __private: "d";
    } & import("../generated/types").TypeD, "__private" | "da" | "db" | "dc">;
}
```

**Expected behavior:**

I would expect that `dist/index.d.ts` type definitions would result in:

```typescript
import { Model } from './index.model';
export declare class A {
    value: Model;
}
```

In fact, this is the result of type definitions, if I change `value = <Model>{};` to `value: Model = <Model>{};`.

Why doesn't typescript use `Model` directly when type asserting?

**Actual behavior:**

Results in:

```typescript
export declare class A {
    value: Pick<{
        __private: "d";
    } & import("../generated/types").TypeD, "__private" | "da" | "db" | "dc">;
}
```

**Playground Link:**
I couldn't figure out how to compile declarations in playground, sorry :(

As an alternative please clone the following repo: https://github.com/klemenoslaj/typescript-type-assertion

**Explanation:**
This is quite a significant problem in monorepo environment.  
What happens is that projects are compiled in the `dist/` folder and they contain relative path like above (`import("../generated/types")`), which points from the `src/` and not from `dist/`, effectively producing an error when projects start using one another.

Why doesn't typescript:
- use the original path from the import (`generated/types`)?
- use the type from assertion directly (`Model`)?
Repository: rust
Issue: Flag for stop interpreting code blocks as doctests
Labels: T-rustdoc,C-feature-request,A-doctests

Code blocks inside documentation are interpreted as doctests by default. Sometimes the code is not for testing at all (for example, writing pseudo-code for an algorithm), and we can add `ignore` at the beginning of the code block.

However, even if `ignore` is added, `cargo test` still interprets the code block as doctest, and prints "... ignored" on each occurrence of `ignore`-tagged code blocks. In fact, those code blocks should not be interpreted as doctest, and `cargo test` should *silently* ignore those code blocks.

For example, the following code is a snippet of my current project.
```rust
/// Minimize the input size while preserving the coverage.
///
/// The algorithm trims by trying to remove chunks, starting from large chunks
/// to small chunks.
///
/// # Algorithm
/// ```ignore
/// for round in rounds {
///     for chunk_index in buffer {
///         let new_buffer = remove_chunk(chunk_index, round_size);
///         if run(new_buffer).coverage == known_coverage {
///             buffer = new_buffer;
///         }
///     }
/// }
/// ```
pub struct Trim {
...
}
```

`cargo test` generates the following output:
```
[...]
   Doc-tests dfuzz

running 4 tests
test src/algorithm/pass/mod.rs - algorithm::pass::Trim (line 17) ... ignored
test src/tracer/function.rs - tracer::function (line 18) ... ignored
test src/tracer/function.rs - tracer::function (line 23) ... ignored
test src/tracer/function.rs - tracer::function (line 5) ... ignored
```

Is it possible to add a flag in the code block to suppress such "ignored" messages?
Repository: flutter
Issue: Quickly entering text in a textfield with a slow TextInputFormatter may ignore keypresses
Labels: a: text input,framework,engine,P2,team-engine,triaged-engine

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

// Identity formatter, with some slowness.
class SimpleTextFormatter extends TextInputFormatter {
  SimpleTextFormatter();

  static final instance = SimpleTextFormatter();

  @override
  TextEditingValue formatEditUpdate(
    TextEditingValue oldValue,
    TextEditingValue newValue,
  ) {
    var result = TextEditingValue(text: newValue.text.replaceAll('2', ''), selection: newValue.selection);

    // Some slow calculation!
    int sum = 0;
    for (int i = 0; i < 1000000000; ++i) sum += i;
    if (sum % 2 == 1) return null;

    return result;
  }
}

void main() => runApp(TextFieldTest());

class TextFieldTest extends StatefulWidget {
  @override
  _TextFieldTestState createState() => _TextFieldTestState();
}

class _TextFieldTestState extends State<TextFieldTest> {
  final _controller = TextEditingController();
  final _controller2 = TextEditingController();
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Text Editing Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Text Editing Demo'),
        ),
        body: Column(
          children: <Widget>[
            SizedBox(
              width: 100,
              child: TextField(
                controller: _controller,
                inputFormatters: [SimpleTextFormatter.instance],
              ),
            ),
            SizedBox(
              width: 100,
              child: TextField(
                controller: _controller2,
//                inputFormatters: [SimpleTextFormatter.instance],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
```

In the upper textfield quickly enter a sequence like "2266226622662266".

Expected behavior: the 2's get filtered out and all 6's end up in the text field.
Observed behavior: Some 6s are omitted as well.
Repository: flutter
Issue: [FadeInImage] Add support for images being loaded from memory
Labels: c: new feature,framework,a: images,c: proposal,P3,team-framework,triaged-framework

## Use case

As a developer, I want to load images from memory (`Uint8List`) that also take a placeholder, and have a nice fade-in animation for the transition.

This is very useful when images are big, since `Image.memory` will flick when loading a big image, creating a very unpleasant experience.

## Proposal

Add a new helper constructor to `FadeInImage`, `fromMemory(...)`, that takes an image in `Uint8List` and resolves it with a `MemoryImage` provider, so the images do not flick when loading.

#### Notes

If you think these changes are a good idea, I am very happy to open a PR with these code changes.
Repository: flutter
Issue: Crash running Android in emulation on x86 devices in libndk_translation.so
Labels: c: crash,e: device-specific,platform-android,engine,customer: crowd,P3,team-android,triaged-android

#16456. #16793 #4095 are all closed and #35920 does not look similar.

I just received the following **native crash** report from `Robo test, Nexus 6, Virtual, API Level 23` **and** `Robo test, Nexus7 clone, DVD 16:9 aspect ratio, Virtual, API Level 23` on `Channel master, v1.8.2-pre.229`:

```
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'generic/gce_x86_phone/gce_x86:6.0.1/MOB31Q.MZG52/3751182:userdebug/test-keys'
Revision: '0'
ABI: 'x86'
pid: 9587, tid: 9749, name: 1.ui  >>> app <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x180002
    eax 00000002  ebx af61af38  ecx af63f01c  edx 9bc402e4
    esi 00180000  edi 00018000
    xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000007  xss 0000007b
    eip af5c492d  ebp 9b4182a8  esp 9b418250  flags 00210206
backtrace:
    #00 pc 001c192d  /system/lib/libndk_translation.so (_ZN15ndk_translation19find_symbol_by_nameEPNS_6soinfoERNS_10SymbolNameE+237)
    #01 pc 001c2463  /system/lib/libndk_translation.so (_ZN15ndk_translation8do_dlsymEPvPKcS0_+419)
    #02 pc 001c386e  /system/lib/libndk_translation.so (_ZN15ndk_translation24ndk_translation_do_dlsymEPvPKcS2_PKvPS0_+46)
    #03 pc 001346ad  /system/lib/libndk_translation.so (_ZN15ndk_translation11GuestLoader6DlVSymEPvPKcS3_S1_+77)
    #04 pc 0000193b  /system/lib/libndk_translation_proxy_libdl.so
    #05 pc 00000691  [anon:ndk_x_0xb2f00000]
    #06 pc 0005f2e3  /data/app/app-1/lib/arm/libflutter.so
    #07 pc fffffffe  <unknown>
```