text:
ThemeData does not respect ColorScheme for TabBar, CheckBox, etc

Description:

ThemeData(colorSchemeSeed: ...) makes theme.indicatorColor configured from color scheme
ThemeData(colorScheme: ...) does not make theme.indicatorColor configured from color scheme - is it a bug?

Reproduction:
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  // should fail
  test('ThemeData.colorScheme', () {
    final theme = ThemeData(
      colorScheme: ColorScheme.fromSeed(
        brightness: Brightness.dark,
        // just ensure every color in ColorScheme is completely unrelated to teal
        seedColor: Colors.orange,
        primary: Colors.orange,
        secondary: Colors.orange,
        tertiary: Colors.orange,
      ),
    );

    // e.g. TabBar
    expect(theme.indicatorColor, isNot(Colors.tealAccent[200]));
  });

  // should pass
  test('ThemeData.colorSchemeSeed', () {
    final theme = ThemeData(
      colorSchemeSeed: Colors.orange,
      brightness: Brightness.dark,
    );

    // e.g. TabBar
    expect(theme.indicatorColor, isNot(Colors.tealAccent[200]));
  });
}

Suggest fix: Replace the following part in ThemeData constructor
    if (colorSchemeSeed != null) {
      colorScheme = ColorScheme.fromSeed(seedColor: colorSchemeSeed, brightness: effectiveBrightness);

      // For surfaces that use primary color in light themes and surface color in dark
      final Color primarySurfaceColor = isDark ? colorScheme.surface : colorScheme.primary;
      final Color onPrimarySurfaceColor = isDark ? colorScheme.onSurface : colorScheme.onPrimary;

      // Default some of the color settings to values from the color scheme
      primaryColor = primarySurfaceColor;
      primaryColorBrightness = ThemeData.estimateBrightnessForColor(primarySurfaceColor);
      canvasColor ??= colorScheme.background;
      accentColor ??= colorScheme.secondary;
      accentColorBrightness ??= ThemeData.estimateBrightnessForColor(colorScheme.secondary);
      scaffoldBackgroundColor ??= colorScheme.background;
      bottomAppBarColor ??= colorScheme.surface;
      cardColor ??= colorScheme.surface;
      dividerColor ??= colorScheme.outline;
      backgroundColor ??= colorScheme.background;
      dialogBackgroundColor ??= colorScheme.background;
      indicatorColor ??= onPrimarySurfaceColor;
      errorColor ??= colorScheme.error;
      applyElevationOverlayColor ??= brightness == Brightness.dark;
    }

change it to:
    if (colorSchemeSeed != null || colorScheme != null) {
...

Triage report
I can reproduce this issue on Master (3.5.0-12.0.pre.94). Labelling as such

In TabBar, if I set dividerColor in MaterialApp, it does not work, is this the same issue?
https://dartpad.dev/?id=e75b493dae1287757c5e1d77a0dc73f1

Code
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,
      theme: ThemeData(
        useMaterial3: true,
        primarySwatch: Colors.blue,
        tabBarTheme: TabBarTheme(
          // this does not work
          dividerColor: Colors.transparent,
        ),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  const MyHomePage({
    Key? key,
    required this.title,
  }) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
            title: Text(widget.title),
            bottom: TabBar(
              // this does work
              // dividerColor: Colors.transparent,
              tabs: [
                Tab(child: Text('TAB A')),
                Tab(child: Text('TAB B')),
              ],
            ),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                const Text(
                  'You have pushed the button this many times:',
                ),
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.headlineMedium,
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
            child: const Icon(Icons.add),
          ),
        ));
  }
}

Hi @fzyzcjy
Looks like this is already fixed, both tests pass on the latest stable.
Thank you

authors: TahaTesser exaby73 fzyzcjy talski


text:
CustomScrollView bug when SliverGrid and SliverList are children

Steps to Reproduce
Running the Sample Code from widgets/CustomScrollView produces a bug while scrolling. See Video and Github Repo.
(The issue only seems to happen if a SliverGrid and a SliverFixedExtentList/SliverList are mixed together in a CustomScrollView?) It was recorded on the iPhone Simulator but the same happens on an actual Android Device.
/* Sample Code from widgets/CustomScrollView */
new CustomScrollView(
  slivers: <Widget>[
    const SliverAppBar(
      pinned: true,
      expandedHeight: 250.0,
      flexibleSpace: const FlexibleSpaceBar(
        title: const Text('Demo'),
      ),
    ),
    new SliverGrid(
      gridDelegate: new SliverGridDelegateWithMaxCrossAxisExtent(
        maxCrossAxisExtent: 200.0,
        mainAxisSpacing: 10.0,
        crossAxisSpacing: 10.0,
        childAspectRatio: 4.0,
      ),
      delegate: new SliverChildBuilderDelegate(
        (BuildContext context, int index) {
          return new Container(
            alignment: FractionalOffset.center,
            color: Colors.teal[100 * (index % 9)],
            child: new Text('grid item $index'),
          );
        },
        childCount: 20,
      ),
    ),
    new SliverFixedExtentList(
      itemExtent: 50.0,
      delegate: new SliverChildBuilderDelegate(
        (BuildContext context, int index) {
          return new Container(
            alignment: FractionalOffset.center,
            color: Colors.lightBlue[100 * (index % 9)],
            child: new Text('list item $index'),
          );
        },
      ),
    ),
  ],
)

/* similar code in my own app */
List slivers = <Widget>[
  new SliverAppBar(
    pinned: true,
    primary: true,
    expandedHeight: topSize['height'],
    flexibleSpace: new FlexibleSpaceBar(
      background: topContent(context, widget.id),
    ),
    actions: <Widget>[
      new IconButton(
        icon: new Icon(Icons.share),
        onPressed: () {

        },
        tooltip: 'Share',
      )
    ],
  ),
  new SliverList(
    delegate: new SliverChildListDelegate(
      topChildren.where(notNull).toList(),
    )
  ),
  new Images( // is a SliverGrid
    images: screenshots,
    id: widget.id,
    onClickImage: openImage
  ),
  new SliverList(
    delegate: new SliverChildListDelegate(
    bottomChildren.where(notNull).toList(),
  )
 ),
];

return new CustomScrollView(
  slivers: slivers
)

Logs
flutter logs
Since there is not crash happening there are no indications in the logs.
DTServiceHub: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
diagnosticd: dispatch_io_write error: 32 (Broken pipe)
diagnosticd: reflect channel created for fd 6
DTServiceHub: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
DTServiceHub: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
DTServiceHub: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn

flutter analyze
only one issues regarding not using the value _counter
flutter doctor
[✓] Flutter (on Mac OS X 10.12.6 16G29, locale en-DE, channel alpha)
    • Flutter at /Users/johannes/Documents/dev/github/flutter-sdk
    • Framework revision bbcfb8d51a (7 days ago), 2017-08-01 14:50:29 -0700
    • Engine revision f2af347363
    • Tools Dart version 1.25.0-dev.7.0

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.3)
    • Android SDK at /Users/johannes/Library/Android/sdk
    • Platform android-25, build-tools 25.0.3
    • ANDROID_HOME = /Users/johannes/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b05)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.3.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 8.3.3, Build version 8E3004b
    • ios-deploy 1.9.1
    • CocoaPods version 1.2.1

[✓] Android Studio (version 2.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b05)

[-] IntelliJ IDEA Community Edition (version 2016.3.2)
    ✗ Flutter plugin version 12.1 - the recommended minimum version is 14.0.0
    • Dart plugin version 163.13137
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins
    ✗ This install is older than the minimum recommended version of 2017.1.0.

[✓] Connected devices
    • iPhone SE • A5527156-9756-425D-B9F0-CB741DB4FB42 • ios • iOS 10.3 (simulator)

Because there is a lack of documentation regarding slivers I wanted to ask another question:
If I understand correctly this
CustomScrollView
  - SliverAppBar
  - SliverList
      - Item
      - Item
  - SliverGrid
  - SliverList

is now preferred over
$controller

ListView (with controller)
  - Item
  - Item
  - GridView (with controller & shrinkWrap: true)
  - Item

Is this correct?

is this correct?

Definitely, yes.
There should be some documentation for slivers now by the way. The only thing lacking any documentation at all currently is NestedScrollView. Please don't hesitate to file bugs if you have specific questions that the documentation doesn't answer.

Looks like the bug here is that when the SliverGrid is off the screen, it reports the wrong metrics.

Another related bug?
I'm learning flutter and was driving me nuts thinking I was missing code, until I tried a simple test.
BUG: cannot have more than one SliverGrid in CustomScrollView.
Recreate by taking the same sample code above, copy a create 3 total SliverGrids, change color for each grid.
When you scroll on Nexus 5 emulator, you'll get first two and then bounce up to top. 3rd never paints.

Probably the same thing, yeah.

Any suggested workaround to show multiple grids in a single view?
I want to show grids of Cards with headings, as in Google Now view on Android.

Here's the code to recreate multi-grid bug:
main.dart.txt

I can't think of a work-around. This is definitely a bug we should fix though. It's probably a simple math bug in the RenderSliverGrid class if you're interested in trying to pin down the cause yourself.

Actually, important to note not even the sample Flutter code actually works.
https://docs.flutter.io/flutter/widgets/CustomScrollView-class.html
once it hits the list index of [12] screen paints starting at [12] at the top, rather than continuing to scroll below [11]. Sample main.dart attached with flutter doc sample used for home:
main.dart.txt
I'm digging into RenderSliverGrid.performLayout() but it's over my head pretty quickly. :(

Yup, we definitely need to fix this.

seems a low priority that the sample code doesn't even work.
any way to include an expert in this thread on SliverGrid so this can get on their radar?

I'm the expert. It's a high priority, it's just competing with all the other high priorities.

oh cool Hixie thanks
flutter is very promising and thanks for your dedication to make it great!

seems bug is also in SliverFixedExtentList as well as SliverGrid
sample using 3 SliverFixedExtentList of length 20. It also bounces to start paint at top when 3 list is starting to display. Sample code:
main.dart.txt

I have a fix for this. Just need to write a test.

source: gharchive/issue

authors: Hixie JohannesKaufmann eturk1

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
Add missing "Contact Emergency" icon

Use case
The Icon class does not include the Material Icon "contact_emergency"
Proposal
Update the Icon class to include this icon.
  /// <i class="material-icons md-36">contact_emergency</i> — material icon named "contact emergency".
  static const IconData contact_emergency = IconData( ... , fontFamily: 'MaterialIcons');

Marking this as a duplicate of https://github.com/flutter/flutter/issues/99973


text:
Don't use shrink wrap in our samples

https://github.com/flutter/flutter/blob/fa063eb4ce4140dec9a887c3130239c68f7b713e/examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart uses shrinkWrap, but really it shouldn't. Unfortunately, it is currently hard to achieve this effect without shrinkWrapping. We should implement whatever additional Slivers are needed to not require shrinkWrapping here (e.g. SliverDecoration).

cc @Piinks @jonahwilliams
(I removed shrinkWrapping from all of our other samples in https://github.com/flutter/flutter/pull/116236, this is the last remaining one.)


text:
Stretch overscroll on NestedScrollView does not ease back stretch on shapes

Steps to Reproduce

Run the example on a device that uses Stretching overscroll
Try to overscroll

Expected results:
After letting go, the box decorations should ease back just like the body's contents
Actual results:
Instead they stay stuck at the highest stretch extent

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(useMaterial3: true),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        headerSliverBuilder: (context, innerBoxIsScrolled) => [
          SliverAppBar.large(
            title: const Text('I wish this worked'),
          ),
        ],
        body: ListView.separated(
          padding: EdgeInsets.zero,
          itemCount: 15,
          itemBuilder: (context, index) => ListTile(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(16),
            ),
            tileColor: Theme.of(context).colorScheme.secondaryContainer,
            title: Text('$index'),
          ),
          separatorBuilder: (BuildContext context, int index) => const Divider(),
        ),
      ),
    );
  }
}

Logs
verbose log is too big for github issues >65536 characters
Verbose log

flutter analyze
Analyzing stretchtest...
No issues found! (ran in 3.2s)

[ÔêÜ] Flutter (Channel stable, 3.3.9, on Microsoft Windows [Version 10.0.22621.819], locale de-DE)
    ÔÇó Flutter version 3.3.9 on channel stable at C:\Users\patri\flutter
    ÔÇó Upstream repository https://github.com/flutter/flutter.git
    ÔÇó Framework revision b8f7f1f986 (3 weeks ago), 2022-11-23 06:43:51 +0900
    ÔÇó Engine revision 8f2221fbef
    ÔÇó Dart version 2.18.5
    ÔÇó DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    ÔÇó Android SDK at C:\Users\patri\AppData\Local\Android\sdk
    ÔÇó Platform android-33, build-tools 33.0.0
    ÔÇó Java binary at: C:\Users\patri\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\213.7172.25.2113.9123335\jre\bin\java
    ÔÇó Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[ÔêÜ] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
    ÔÇó Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    ÔÇó Visual Studio Community 2022 version 17.4.33110.190
    ÔÇó Windows 10 SDK version 10.0.22000.0

[ÔêÜ] Android Studio (version 2021.3)
    ÔÇó Android Studio at C:\Users\patri\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\213.7172.25.2113.9123335
    ÔÇó Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    ÔÇó Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    ÔÇó Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[ÔêÜ] IntelliJ IDEA Ultimate Edition (version 2022.2)
    ÔÇó IntelliJ at C:\Users\patri\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\222.4345.14
    ÔÇó Flutter plugin version 71.0.5
    ÔÇó Dart plugin version 222.4345.14

[ÔêÜ] VS Code (version 1.73.1)
    ÔÇó VS Code at C:\Users\patri\AppData\Local\Programs\Microsoft VS Code
    ÔÇó Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[ÔêÜ] Connected device (4 available)
    ÔÇó Pixel 4a (mobile)            ÔÇó 0B211JEC216722 ÔÇó android-arm64  ÔÇó Android 13 (API 33)
    ÔÇó sdk gphone64 x86 64 (mobile) ÔÇó emulator-5554  ÔÇó android-x64    ÔÇó Android 13 (API 33) (emulator)
    ÔÇó Windows (desktop)            ÔÇó windows        ÔÇó windows-x64    ÔÇó Microsoft Windows [Version 10.0.22621.819]
    ÔÇó Edge (web)                   ÔÇó edge           ÔÇó web-javascript ÔÇó Microsoft Edge 108.0.1462.42

[ÔêÜ] HTTP Host Availability
    ÔÇó All required HTTP hosts are available

! Doctor found issues in 2 categories.

https://user-images.githubusercontent.com/24683548/208167048-6bfa97d2-0732-4020-b503-81770c182b49.mov

Moved here from https://github.com/flutter/flutter/issues/82906

Hi @pohuing
I see there's an open issue addressing the case you described https://github.com/flutter/flutter/issues/107964 and take a look at https://github.com/flutter/flutter/issues/107964#issuecomment-1191754151 that gave a workaround by wrapping the ListTile (or Ink) in Material. Please try the updated sample code below:

Sample code (with workaround)
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(useMaterial3: true),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        headerSliverBuilder: (context, innerBoxIsScrolled) => [
          SliverAppBar.large(
            title: const Text('I wish this worked'),
          ),
        ],
        body: ListView.separated(
          padding: EdgeInsets.zero,
          itemCount: 15,
          itemBuilder: (context, index) => Material(
            child: ListTile(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(16),
              ),
              tileColor: Theme.of(context).colorScheme.secondaryContainer,
              title: Text('$index'),
            ),
          ),
          separatorBuilder: (BuildContext context, int index) => const Divider(),
        ),
      ),
    );
  }
}

Demo (with workaround)
https://user-images.githubusercontent.com/104349824/208352035-802d4178-7993-4e76-a54e-ca0223847739.mp4

Closing this issue as a duplicate, so please follow up on it for further updates. You can leave there your comment and react an upvote to the original comment will help to raise the issue.
If you disagree, please write in the comments and I will reopen it. Thank you!

authors: huycozy pohuing


text:
GoRouter errorBuilder - routes stack is cleared and there is no possibility to pop to previous screen

When you push some unknown route
context.push('/someRoute');
errorBuilder widget is shown. But, there is no possibility to pop this error screen using leading icon of AppBar or system back button.
This was possible in go_router version 3.1.1.
So, with latest version of go_router there is no possibility to push errorBuilder screen? It behaves like 'go' and not like 'push' because that errorBuilder screen cleans all previous routes stack even if previous there were push and pushNamed routes.
Previously with go_router version 3.1.1
I had:
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() => runApp(const MyApp());

final GoRouter _router = GoRouter(
  routes: [
    GoRoute(
      path: '/',
      builder: (BuildContext context, GoRouterState state) {
        return const HomeScreen();
      },
      routes: [
        GoRoute(
          path: 'details',
          builder: (BuildContext context, GoRouterState state) {
            return const DetailsScreen();
          },
        ),
      ],
    ),
  ],
);

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routeInformationParser: _router.routeInformationParser,
      routerDelegate: _router.routerDelegate,
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Home Screen')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: () => context.push('/details'),
              child: const Text('Go to details screen'),
            ),
          ],
        ),
      ),
    );
  }
}

class DetailsScreen extends StatelessWidget {
  const DetailsScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Details Screen')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <ElevatedButton>[
            ElevatedButton(
              onPressed: () => context.push('/someRoute'),
              child: const Text('Go to unknown screen'),
            ),
          ],
        ),
      ),
    );
  }
}

And stack was working fine. When you press in Details screen button, error screen is shown and you can pop back to details screen. And then back to home screen.
With newer version of the go_router you can't pop back. Same code as previous, only change is additional line in MaterialApp:
    return MaterialApp.router(
      routeInformationProvider: _router.routeInformationProvider,
      routeInformationParser: _router.routeInformationParser,
      routerDelegate: _router.routerDelegate,
    );

@tomotoshi3 Please provide a completed and minimal reproducible code sample so that we may verify this. Thanks!

Sample code is updated

This issue is reproducible with the latest go_router: ^6.0.0. Labeling the issue for the team's attention. Thank you!

Demo (go_router 6.0.0 vs 3.1.1)

6.0.0
3.1.1

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.3.10 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (13 hours ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.73.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 12 (API 31)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[!] Flutter (Channel master, 3.7.0-13.0.pre.38, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.7.0-13.0.pre.38 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ca7ca3b8f0 (3 hours ago), 2022-12-21 18:51:21 -0500
    • Engine revision a90c45db3f
    • Dart version 3.0.0 (build 3.0.0-55.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.74.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

I'm also facing the same problem.

Once error builder widget is there then i am not able to do context.push or context.go only context.pushReplacement is working

Once error builder widget is there then i am not able to do context.push or context.go only context.pushReplacement is working

I have this same issue


text:
[web] Re-organize web unit tests

Our web unit tests have gotten pretty complicated with a lot of special casing. I made a proposal for re-organizing our tests into suites, which makes things more explicit and organized.

This is done.

authors: eyebrowsoffire yjbanov


text:
[image_picker][documentation] ImagePicker does nothing without permission on Android

Out of the box, image_picker does nothing on the Android emulator (does not open the gallery or camera).
In the console, the following error is reported:
Unhandled Exception: MissingPluginException(No implementation found for method pickImage
on channel plugins.flutter.io/image_picker_android)

The problem is that the documentation states Android: No configuration required - the plugin should work out of the box.
However, in reality Android needs the following permission:
    <uses-permission android:name="android.permission.CAMERA" />

In fact, this permission is needed even if the app only uses ImagePicker.gallery, not ImagePicker.camera. Neither method works without this permission, and there is no visual indication in the app as to why it failed, you have to look at the logs and then google the error message to figure out you're missing a permission.
The image_picker docs need to be fixed to state that this permission must be added to AndroidManifest.xml.

you have to look at the logs and then google the error message to figure out you're missing a permission

I'm not sure what you found indicating that error message is related to permissions, but whoever said that was incorrect. That error message means that there's no handler on the native side for the method you called; generally that means the plugin hasn't been registered at all. Even if there were code in image_picker that required manifest permissions (which is not the case), the error message is saying that none of that code even had a chance to run.
Adding a permission could not possibly have fixed that error. However, it would have involved quitting the app, rebuilding it, and relaunching, and just that process could have (e.g., if you had tried adding the plugin while the app was already running and just hot reloading, which would cause that error).
Closing as the premise of this report is incorrect. However, if you have a reproducible way of causing the error you listed, please file a new issue with details about that.

I noticed the comment in the other issue that you linked to after posting my comment above; I've hidden it so that it doesn't cause similar confusion for others in the future.

authors: lukehutch stuartmorgan


text:
Can't run flutter repo (in China) after cloning flutter repo

Steps to Reproduce
I just cloned flutter repo and then run the flutter command in order to download the all required dependencies. However, dependencies (e.g. dart sdk) can not be downloaded because google servers are blocked in China. It doesn't work with VPN as well!
Is it possible to download the dependencies from github (instead of google servers), because github works well in China?
Output:
➜  softwares flutter -v
Downloading Dart SDK 1.25.0-dev.11.0...
** Resuming transfer from byte position 3497984
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:--  0:00:43 --:--:--     0
curl: (35) Server aborted the SSL handshake

Sorry about the inconvenience. We're investigating this issue, but it probably will take us some time to have a solution. Please watch #11681 to monitor progress. In the meantime, I'd suggest you seek help from other Flutter users in China on this forum: http://flutter-dev.cn/bbs/. Thanks!

Cc: @kevmoo

I imagine this is fixed now https://github.com/flutter/flutter/wiki/Using-Flutter-in-China

authors: InMatrix kunalshah xster


text:
flutter pub get

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce
Got socket error trying to find package nested at https://pub.dev.
Expected results
i can execute command  flutter pub get
Actual results
run and get packages
Code sample
Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
[Paste your output here]

[√] Flutter (Channel stable, 3.10.4, on Microsoft Windows [Version 10.0.19045.2965], locale en-US)
• Flutter version 3.10.4 on channel stable at C:\Flutter_Files_SDK
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 682aa387cf (7 days ago), 2023-06-05 18:04:56 -0500
• Engine revision 2a3401c9bb
• Dart version 3.0.3
• DevTools version 2.23.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at C:\android_sdk
• Platform android-33-ext5, build-tools 33.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
[√] VS Code (version 1.79.0)
• VS Code at C:\Users\Mohamed Ibrahem\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.66.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2965]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 114.0.5735.110
• Edge (web)        • edge    • web-javascript • Microsoft Edge 114.0.1823.43
[√] Network resources
• All expected network resources are available.

Hi @eng-mohamed-ibrahem .
Can you provide more information on the issue you are facing?
When opening an issue, please try to provide all or some of the information indicated in the template so that we can address this issue properly. (See Report a bug template).

authors: dam-ease eng-mohamed-ibrahem


text:
[Impeller] Correct way of examining Impeller performance issues?

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Use case
For triage: I guess this can be categorized as "proposal to add some doc" or "proposal to add some features for easy debugging".
Background: I am experimenting Impeller and want to debug and fix the performance problems of my real app, and probably submit PRs if the slowness is from Impeller's code itself. However, I need to firstly know the best-practice of examining its performance issues.
What I have searched: I have checked https://docs.flutter.dev/perf/impeller and https://github.com/flutter/engine/blob/main/impeller/docs/read_frame_captures.md, but I am not sure whether that's the correct thing to look at - for example, it may be bottlenecked by CPU work. The impeller says it is "Instrumentable", so I am not sure whether I can easily read a flamechart or whatever, with all tags clearly showing which part takes how much time (like "enhanced tracing" for widgets). Therefore, I am creating this issue, hoping to see how you (Impeller developers) debug performance issues in everyday life. I have also guessed I could use standard CPU profilers, but given that there are the helpful "enhanced tracing" feature for Flutter framework, I guess there could also been something like this for Impeller and it is just I do not know that yet.
I am happy to make a PR, either to add doc (after I know and play with the correct approach), or to add some features for easy performance problem debugging.
By the way, a side question: Where should I find the doc of Impeller? Currently I only found https://github.com/flutter/engine/tree/main/impeller and https://github.com/flutter/engine/tree/main/impeller/docs. And https://www.youtube.com/watch?v=vd5NqS01rlA video.
Proposal
see above

Update: Thanks @jonahwilliams for replying on Discord. Quote the reply here for anyone needed:

I would start by looking at devtools to verify that the performance issue is on the Raster thread. Then you can either run the Xcode CPU profilter to see what is taking so long on the raster thread. Though if the timeline traces show a lot of time in waitForNextDrawable, then the issue is usually on the GPU and you should instead look at frame captures

@fzyzcjy
Does above comment help to answer your original question of ways to examine impeller perforrmance issues ?

@darshankawar Yes, I will firstly try that path. I am happy to contribute some doc if needed.

Somehow related: An example of examining impeller slowness https://github.com/flutter/flutter/issues/129149#issuecomment-1598694268

I added wait label based on your previous comment or you can also close this until you complete your findings per your comment and reopen if required.

I think this can be triaged as: feature / improvement of doc

We use multiple profilers to analyze performance issues. Stuff like Xcode and Instruments (in which we label all GPU resources) and RenderDoc. Profiling workflows are documented separately in the docs folder but I am sure we can add to these. As far as one "correct" way to profile everything, I don't think there is one. It is workload and platform dependent. If the existing docs are insufficient, let us know. For specific work items related to documentation, there is a "Documentation" section in https://github.com/orgs/flutter/projects/21 that we can prioritize.

Thank you!

authors: chinmaygarde darshankawar fzyzcjy


text:
No image asset location found

I got an error saying no image location found
here is the screenshot
https://ibb.co/eqwi1J
Logs
 [  +88 ms] [C:\flutter_windows_v0.3.2-beta\flutter\] git rev-parse --abbrev-ref --symbolic @{u}

[ +125 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +1 ms] origin/beta
[        ] [C:\flutter_windows_v0.3.2-beta\flutter] git rev-parse --abbrev-ref HEAD
[  +69 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[        ] [C:\flutter_windows_v0.3.2-beta\flutter] git ls-remote --get-url origin
[  +81 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] [C:\flutter_windows_v0.3.2-beta\flutter] git log -n 1 --pretty=format:%H
[ +129 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] 44b7e7d3f42f050a79712daab253af06e9daf530
[        ] [C:\flutter_windows_v0.3.2-beta\flutter] git log -n 1 --pretty=format:%ar
[  +67 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 3 weeks ago
[        ] [C:\flutter_windows_v0.3.2-beta\flutter] git describe --match v*.. --first-parent --long --tags
[  +85 ms] Exit code 0 from: git describe --match v*.. --first-parent --long --tags
[        ] v0.3.2-0-g44b7e7d3f
[ +743 ms] C:\Users\My\AppData\Local\Android\sdk\platform-tools\adb devices -l
[  +41 ms] Exit code 0 from: C:\Users\My\AppData\Local\Android\sdk\platform-tools\adb devices -l
[        ] List of devices attached
[  +13 ms] No connected devices.
[  +74 ms] "flutter run" took 681ms.
#0      throwToolExit (package:flutter_tools/src/base/common.dart:28)
#1      RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:256)

#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:312)

#3      FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:270)

#4      AppContext.run. (package:flutter_tools/src/base/context.dart:142)

#5      _rootRun (dart:async/zone.dart:1126)
#6      _CustomZone.run (dart:async/zone.dart:1023)
#7      runZoned (dart:async/zone.dart:1501)
#8      AppContext.run (package:flutter_tools/src/base/context.dart:141)

#9      FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:261)
#10     CommandRunner.runCommand (package:args/command_runner.dart:194)

#11     FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:309)

#12     AppContext.run. (package:flutter_tools/src/base/context.dart:142)

#13     _rootRun (dart:async/zone.dart:1126)
#14     _CustomZone.run (dart:async/zone.dart:1023)
#15     runZoned (dart:async/zone.dart:1501)
#16     AppContext.run (package:flutter_tools/src/base/context.dart:141)

#17     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:265)

#18     CommandRunner.run. (package:args/command_runner.dart:109)
#19     new Future.sync (dart:async/future.dart:224)
#20     CommandRunner.run (package:args/command_runner.dart:109)
#21     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:174)
#22     run. (package:flutter_tools/runner.dart:54)

#23     AppContext.run. (package:flutter_tools/src/base/context.dart:142)

#24     _rootRun (dart:async/zone.dart:1126)
#25     _CustomZone.run (dart:async/zone.dart:1023)
#26     runZoned (dart:async/zone.dart:1501)
#27     AppContext.run (package:flutter_tools/src/base/context.dart:141)

#28     runInContext (package:flutter_tools/src/context_runner.dart:41)

#29     run (package:flutter_tools/runner.dart:49)
#30     main (package:flutter_tools/executable.dart:48)

#31     main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#32     _startIsolate. (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#33     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
Running "flutter packages get" in flutter_login...

Error on line 29, column 4 of pubspec.yaml: Expected a key while parsing a block mapping.
assets:
^
pub get failed (65)
flutter doctor -v
[√] Flutter (Channel beta, v0.3.2, on Microsoft Windows [Version 10.0.15063], locale en-US)
• Flutter version 0.3.2 at C:\flutter_windows_v0.3.2-beta\flutter
• Framework revision 44b7e7d3f4 (3 weeks ago), 2018-04-20 01:02:44 -0700
• Engine revision 09d05a3891
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\My\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 24.2.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] IntelliJ IDEA Community Edition (version 2017.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.5
• Flutter plugin version 23.2.2
• Dart plugin version 173.4700
[√] VS Code, 64-bit edition (version 1.23.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension version 2.12.1
[!] Connected devices
! No devices available
! Doctor found issues in 1 category.

There is a space to many before  assets:.
It doesn't align with uses-material-design:

thanks, it works

@zoechi    It doesn't work for the image it works only for the font
here is the screenshot:-

Please try flutter clean and then run again.

@zoechi     Nope I get the error again
I got 1 warning

The indentation is wrong. In YAML spaces are significant.
I'd suggest you create a new project using flutter create and look up the indentation there (or check https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/pubspec.yaml)

stop your debugging. don't do hot reload. be course of that case could not recognize new repository.
cancel debug and do debug again.

authors: AbhijitL lakziro zoechi


text:
Default format for text counter in TextField doesn't properly support Arabic and Hebrew

Default counter in TextField is hardcoded to [text length]/[max text length]
In both Arabic and Hebrew, it looks like it should be flipped. [max text length]/[text length]

As a native Hebrew speaker I think it should stay [text length] / [max text length] as numbers are read from left to right.

Closing this then since it seems that TextField is doing the right thing per @amirh's comment

authors: amirh rami-a shujames


text:
Could not resolve all artifacts for configuration 'classpath'

From URL: https://www.flutterchina.club/support.md
Finished with error: Please review your Gradle project setup in the android/ folder.
* Error running Gradle:
ProcessException: Process "/Users/../Desktop/flutter_app/android/gradlew" exited abnormally:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/../Desktop/flutter_app/android/app/build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
  Command: /Users/../Desktop/flutter_app/android/gradlew app:properties`

I have already done：
buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

Same here. This is fixed in master but not under stable release yet. For now, I would suggest switching to master branch and wait for the fix to be released.

I am also struggling with this issue, so do i need to wait up to fix.

Merging with #23404

same issue

I solved the problem by moving :
maven {
url 'https://dl.google.com/dl/android/maven2'
}
in the top of:
jcenter()
in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :
buildscript {
repositories {
    maven {
        url 'https://dl.google.com/dl/android/maven2'
    }
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
}

}

same issue
Solved by adding "google()" to gradle

@Parth1029 It is solved! Thank you 👍

@Parth1029 thanks it works on my app as well!

still i am facing issue.

@ Parth1029 Great work! Thx.

@Parth1029 still i am facing the issue form, i tried to adding google(), but still i am getting same issue.

Upgrading Flutter should fix it @rravithejareddy

I solved the problem.
File->setting->build->Gradle->Android studio
checked "Enable embedded Maven repository".

gradle.properties set proxy
org.gradle.jvmargs=-Xmx1536M
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=yourport
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=yourport

I solved the problem.In android folder,edit build.gradle file like this:
buildscript {
    repositories {
        google()
        mavenCentral()  //add this line
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

It works.

I solved the problem.
File->setting->build->Gradle->Android studio
checked "Enable embedded Maven repository".

That's right！

I have made all the possible changes but still I am facing this issue. Please help me. Here is I am getting while performing tns run
A problem occurred configuring root project 'newAppo'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.4.1.
Required by:
project :
Could not resolve com.android.tools.build:gradle:3.4.1.
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Could not resolve com.android.tools.build:gradle:3.4.1.
Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Could not resolve com.android.tools.build:gradle:3.4.1.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

pls same issue.
error message below:
FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring project ':GkuonTestApplicationApp'.

Could not resolve all artifacts for configuration ':GkuonTestApplicationApp:classpath'.
Could not download robovm-dist-compiler.jar (com.gluonhq:robovm-dist-compiler:2.3.1-ios11)
Could not get resource 'https://jcenter.bintray.com/com/gluonhq/robovm-dist-compiler/2.3.1-ios11/robovm-dist-compiler-2.3.1-ios11.jar'.
Read timed out
Could not download ecj.jar (org.eclipse.jdt.core.compiler:ecj:4.4)
Could not get resource 'https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.jar'.
Read timed out

Hi, I have this problem when I try to execute a Serenity BDD project, I need to run from command line a gradle execution but generate that problem.
$ gradle clean test aggregate
FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring root project 'IVR'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Required by:
project :
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Could not get resource 'https://jcenter.bintray.com/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Could not HEAD 'https://jcenter.bintray.com/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.161.196.51, jcenter.bintray.com/54.148.18.233] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Could not get resource 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Could not HEAD 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Could not get resource 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Could not HEAD 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Could not get resource 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Could not HEAD 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Required by:
project :
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Could not get resource 'https://jcenter.bintray.com/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Could not HEAD 'https://jcenter.bintray.com/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.161.196.51, jcenter.bintray.com/54.148.18.233] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Could not get resource 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Could not HEAD 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Could not get resource 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Could not HEAD 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Could not get resource 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Could not HEAD 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection timed out: connect

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Get more help at https://help.gradle.org

BUILD FAILED in 6m 31s
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:"C:\Program Files (x86)\Micro Focus\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"
And this is my build.gradle
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {url = 'http://repo.maven.apache.org/maven2'}
}
dependencies {
	classpath "net.serenity-bdd:serenity-gradle-plugin:2.0.49"
	classpath "net.serenity-bdd:serenity-emailer:2.0.49"

}

}
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
}
apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'java'
apply plugin: 'eclipse'
defaultTasks = ['clean', 'build']
tasks.withType(Test) {
reports.html.destination = new File('IVR', name)
println(it.name + '\t' + reports.html.destination)
scanForTestClasses = false
include "**/*Runner.class" // whatever Ant pattern matches your test class files
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:26.0-jre'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'

compile group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '4.1.0'
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '4.1.0'
compile group: 'org.apache.poi', name: 'poi', version: '4.1.0'
compile group: 'net.serenity-bdd', name: 'serenity-reports', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-model', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-junit', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-core', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-cucumber', version: '1.9.31'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta4'
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.8.0-beta4'

compile group: 'net.serenity-bdd', name: 'serenity-gradle-plugin', version: '1.9.36'
compile group: 'net.serenity-bdd', name: 'serenity-emailer', version: '1.9.36'

}
serenity {
reports = ["email"]
}
test.finalizedBy(aggregate)
Please help me, with this problem

I run it on vs code and throws the same problem. like below:
* Get more help at https://help.gradle.org

BUILD FAILED in 30s
  Command: /Users/dobby/Dropbox/Code/Android/VSFlutter/hello_flutter/android/gradlew app:properties

Open terminal goes to /path/to/your/app/android, run above command with proxy configs, and it resolved.
./gradlew app:properties -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=1087 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=1087 --debug

TakeEasyBoy's suggestion worked for me. Thanks.

This Can Help You ? https://icetutor.com/question/libusbmuxd-version-error-during-flutter-install/

Go to cordova-support-google-services/app-build.gradle, replace maventCentral() with
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap'}
Credits to hunijkah in https://stackoverflow.com/questions/58529904/error-could-not-find-org-jetbrains-kotlinkotlin-stdlib-jdk81-3-60-eap-25-in-i

Got the same issue.anyone can help me..please.

I did everything that written this page but it doesn't work.
Last, I tried to update so it worked.
If you tried all the way but when it doesn't work, try update flutter

@TakeEasyBoy not work. I'm dying

@Parth1029 not work. I'm dying really.

@Suppppppp I updated flutter 1.9.1+hotfix.6 , but it doesn't work also. what your flutter version.
Flutter 1.9.1+hotfix.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 68587a0916 (7 weeks ago) • 2019-09-13 19:46:58 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0

not work. I'm dying really too

I faced this error after upgrading to  Flutter 1.12.13+hotfix.5 :
Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
  > Could not download flutter_embedding_debug.jar (io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695)
     > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.jar'.

@flutteradv Update flutter, Accept android licences flutter doctor --android-licenses, run flutter clean

thnaks a lot now I need to migrate to androidX

I solved the problem by moving :
maven {
    url 'https://dl.google.com/dl/android/maven2'
}

in the top of:
jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :
    buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

I couldn't find the file .flutter. Do I look it into the app directory for the .flutter dir.

I solved the problem.In android folder,edit build.gradle file like this:
buildscript {
    repositories {
        google()
        mavenCentral()  //add this line
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

It works.
stackoverflow link

It Worked!

I solved the problem by moving :
maven {
    url 'https://dl.google.com/dl/android/maven2'
}

in the top of:
jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :
    buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

I couldn't find the file .flutter. Where is the .flutter dir located?

.flutter is just a convention, here '.flutter' is the path where you extracted or installed flutter in your system. Hope this helps you.

edit the following in build.gradle :
buildscript {     repositories {         jcenter()         mavenCentral() #add         google() #add     }     .... }

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
i Dont know why am getting this error......
THIS IS MY build.gradle
pls i dont know what to do
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
allprojects {
repositories {
google()
jcenter()
}

}
task clean(type: Delete) {
delete rootProject.buildDir
}

I solved it by....

go to search icon on the top-right corner and search for "Execute Gradle Task".
click on result "Execute Gradle Task" after it appear , And you'll be given sort of options.
NOTE: Now make sure you have internet.
double click on "gradle mergeDexRelease" among the other options.
.....Now wait for it to finish download some stuffs, then you are good......

It worked  for me, i'm using Windows...

@gayanramyakumara I am also facing same issue can i know how you solved this issue.

i went with capacitor

authors: Benklins HarshEglesiaa Niek-Okido Parth1029 Paulswith PocoMin Sly777 SuperCup Suppppppp TakeEasyBoy VineetMaker Youzhigang aboutmydreams derekgithubs flutteradv gayanramyakumara irvingreece jonathar2605 marianoarga nhhockeyplayer onemanstartup patelkrunal78 prabh08 rravithejareddy shaileshpanthee songyiYu succygoldbaji sumation werdlv xring yefeidd yibingxiong zoechi zuilintan


text:
showDatePicker overflow in small screen

Steps to Reproduce

Use a small screen emulator like - Nexus S (460 x 800)
Run flutter_gallery app and run Picker demo
Pick date has overflow error

Logs
I/zygote  (23274): Do partial code cache collection, code=30KB, data=26KB
I/zygote  (23274): After code cache collection, code=30KB, data=26KB
I/zygote  (23274): Increasing code cache capacity to 128KB
I/flutter (23274): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (23274): The following message was thrown during layout:
I/flutter (23274): A RenderFlex overflowed by 39 pixels on the bottom.
I/flutter (23274):
I/flutter (23274): The overflowing RenderFlex has an orientation of Axis.vertical.
I/flutter (23274): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
I/flutter (23274): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
I/flutter (23274): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
I/flutter (23274): RenderFlex to fit within the available space instead of being sized to their natural size.
I/flutter (23274): This is considered an error condition because it indicates that there is content that cannot be
I/flutter (23274): seen. If the content is legitimately bigger than the available space, consider clipping it with a
I/flutter (23274): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
I/flutter (23274): like a ListView.
I/flutter (23274): The specific RenderFlex in question is:
I/flutter (23274):   RenderFlex#21475 relayoutBoundary=up7 OVERFLOWING
I/flutter (23274):   creator: Column ← SizedBox ← LayoutBuilder ← OrientationBuilder ← DefaultTextStyle ←
I/flutter (23274):   AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#e781f ink renderer] ←
I/flutter (23274):   NotificationListener<LayoutChangedNotification> ← CustomPaint ← _ShapeBorderPaint ← PhysicalShape
I/flutter (23274):   ← _MaterialInterior ← ⋯
I/flutter (23274):   parentData: <none> (can use size)
I/flutter (23274):   constraints: BoxConstraints(w=240.0, 0.0<=h<=461.3)
I/flutter (23274):   size: Size(240.0, 461.3)
I/flutter (23274):   direction: vertical
I/flutter (23274):   mainAxisAlignment: start
I/flutter (23274):   mainAxisSize: min
I/flutter (23274):   crossAxisAlignment: stretch
I/flutter (23274):   verticalDirection: down
I/flutter (23274): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
I/flutter (23274): ════════════════════════════════════════════════════════════════════════════════════════════════════

Analyzer
[√] Flutter (Channel beta, v0.11.13, on Microsoft Windows [Version 10.0.17134.376], locale en-SG)
    • Flutter version 0.11.13 at C:\app\flutter
    • Framework revision 58c8489fcd (2 days ago), 2018-11-29 19:20:18 -0500
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at C:\Users\k\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Ultimate Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5
    • Flutter plugin version 30.0.2
    • Dart plugin version 182.5124

[!] VS Code (version 1.29.1)
    • VS Code at C:\Users\k\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

! Doctor found issues in 1 category.

Merging with #21383

authors: yathit zoechi


text:
[WebView]  Does not follow redirects.

The webview_flutter plugin does not appear to follow redirects.  It simply displays a blank white page.  This is an example of a URL that has a redirect for the flutter.io website. (this is a Google Ad link)
https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwis9JrFup7fAhVbuMAKHTNtA5gYABAAGgJpbQ&ohost=www.google.com&cid=CAESQeD2UsU5H7fGhUZOPtY-kPyuOuLkiFu02AYGI7ZI1pHvfjhZaQhzWkZiIC9SuCSp_y7E9WnDpUNypnNzx0oBS6Nm&sig=AOD64_2AaG88ZD2HKakgg_Zdck7rnkTkZA&q=&ved=2ahUKEwjrpJHFup7fAhXMi60KHSYZD4QQ0Qx6BAgPEAE&adurl=

Experiencing the same issue! Any update on this issue?

This is just a little hack for android for this issue. not to use in production because i don't know the side effect of this code. taken from this answer
steps:-
step1:-  Clone webview_flutter repo.
step2:-  edit packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java
add this bold styled text to existing code like this.
package io.flutter.plugins.webviewflutter;
import android.content.Context;
import android.view.View;
import android.webkit.WebView;
**import android.webkit.WebViewClient;**
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.platform.PlatformView;
import java.util.List;
import java.util.Map;

public class FlutterWebView implements PlatformView, MethodCallHandler {
  private static final String JS_CHANNEL_NAMES_FIELD = "javascriptChannelNames";
  private final WebView webView;
  private final MethodChannel methodChannel;

  @SuppressWarnings("unchecked")
  FlutterWebView(Context context, BinaryMessenger messenger, int id, Map<String, Object> params) {
    webView = new WebView(context);

    **webView.setWebViewClient(new WebViewClient() {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        return false;
      }
    });**

    methodChannel = new MethodChannel(messenger, "plugins.flutter.io/webview_" + id);
    methodChannel.setMethodCallHandler(this);

    applySettings((Map<String, Object>) params.get("settings"));

    if (params.containsKey(JS_CHANNEL_NAMES_FIELD)) {
      registerJavaScriptChannelNames((List<String>) params.get(JS_CHANNEL_NAMES_FIELD));
    }

    if (params.containsKey("initialUrl")) {
      String url = (String) params.get("initialUrl");
      webView.loadUrl(url);
    }
  }

  @Override
  public View getView() {
    return webView;
  }

  @Override
  public void onMethodCall(MethodCall methodCall, Result result) {
    switch (methodCall.method) {
      case "loadUrl":
        loadUrl(methodCall, result);
        break;
      case "updateSettings":
        updateSettings(methodCall, result);
        break;
      case "canGoBack":
        canGoBack(methodCall, result);
        break;
      case "canGoForward":
        canGoForward(methodCall, result);
        break;
      case "goBack":
        goBack(methodCall, result);
        break;
      case "goForward":
        goForward(methodCall, result);
        break;
      case "reload":
        reload(methodCall, result);
        break;
      case "currentUrl":
        currentUrl(methodCall, result);
        break;
      case "evaluateJavascript":
        evaluateJavaScript(methodCall, result);
        break;
      case "addJavascriptChannels":
        addJavaScriptChannels(methodCall, result);
        break;
      case "removeJavascriptChannels":
        removeJavaScriptChannels(methodCall, result);
        break;
      default:
        result.notImplemented();
    }
  }

  private void loadUrl(MethodCall methodCall, Result result) {
    String url = (String) methodCall.arguments;
    webView.loadUrl(url);
    result.success(null);
  }

  private void doJavascriptRedirect(MethodCall methodCall, Result result) {
    String url = (String) methodCall.arguments;
    webView.loadUrl(url);
    result.success(null);
  }

  private void canGoBack(MethodCall methodCall, Result result) {
    result.success(webView.canGoBack());
  }

  private void canGoForward(MethodCall methodCall, Result result) {
    result.success(webView.canGoForward());
  }

  private void goBack(MethodCall methodCall, Result result) {
    if (webView.canGoBack()) {
      webView.goBack();
    }
    result.success(null);
  }

  private void goForward(MethodCall methodCall, Result result) {
    if (webView.canGoForward()) {
      webView.goForward();
    }
    result.success(null);
  }

  private void reload(MethodCall methodCall, Result result) {
    webView.reload();
    result.success(null);
  }

  private void currentUrl(MethodCall methodCall, Result result) {
    result.success(webView.getUrl());
  }

  @SuppressWarnings("unchecked")
  private void updateSettings(MethodCall methodCall, Result result) {
    applySettings((Map<String, Object>) methodCall.arguments);
    result.success(null);
  }

  private void evaluateJavaScript(MethodCall methodCall, final Result result) {
    String jsString = (String) methodCall.arguments;
    if (jsString == null) {
      throw new UnsupportedOperationException("JavaScript string cannot be null");
    }
    webView.evaluateJavascript(
        jsString,
        new android.webkit.ValueCallback<String>() {
          @Override
          public void onReceiveValue(String value) {
            result.success(value);
          }
        });
  }

  @SuppressWarnings("unchecked")
  private void addJavaScriptChannels(MethodCall methodCall, Result result) {
    List<String> channelNames = (List<String>) methodCall.arguments;
    registerJavaScriptChannelNames(channelNames);
    result.success(null);
  }

  @SuppressWarnings("unchecked")
  private void removeJavaScriptChannels(MethodCall methodCall, Result result) {
    List<String> channelNames = (List<String>) methodCall.arguments;
    for (String channelName : channelNames) {
      webView.removeJavascriptInterface(channelName);
    }
    result.success(null);
  }

  private void applySettings(Map<String, Object> settings) {
    for (String key : settings.keySet()) {
      switch (key) {
        case "jsMode":
          updateJsMode((Integer) settings.get(key));
          break;
        default:
          throw new IllegalArgumentException("Unknown WebView setting: " + key);
      }
    }
  }

  private void updateJsMode(int mode) {
    switch (mode) {
      case 0: // disabled
        webView.getSettings().setJavaScriptEnabled(false);
        break;
      case 1: // unrestricted
        webView.getSettings().setJavaScriptEnabled(true);
        break;
      default:
        throw new IllegalArgumentException("Trying to set unknown JavaScript mode: " + mode);
    }
  }

  private void registerJavaScriptChannelNames(List<String> channelNames) {
    for (String channelName : channelNames) {
      webView.addJavascriptInterface(
          new JavaScriptChannel(methodChannel, channelName), channelName);
    }
  }

  @Override
  public void dispose() {}
}

step3:- copy updated plugin in your project and update path in pubspec.yaml like this
webview_flutter:
path: webview_flutter
Note:- webview_flutter is the plugin folder inside the apps root directory /myapp/webview_flutter
step4:- compile

PS. server side redirects are working

@zoechi can i make a pull request regarding this ?
What you say ?

@rakeshlanjewarwork sure, go ahead 👍

thanks , pushing...

@rakeshlanjewarwork We are waiting for your pull request, thank you.

i have made a pull request on same day. https://github.com/flutter/plugins/pull/1197

Could you try VS CODE - Command - Format Document ?

I also need this fix , could you try again ? Thank you very much.

@realcarlos I have tried to pull request but due to some problems about formatting of code the CI build is failing.
If you can make a pull please see here https://github.com/flutter/plugins/pull/1243

Need this fix badly!

@zoechi could you Kindly help to merge it? thank you

facing same issue, white blank screen on ios

Hi all, I just ran into this same issue, and it looks like the underlying issue is that these are redirects from HTTP to HTTPS. On iOS, for example, we have to add these domains to our App Transport Security exception list (e.g.: https://stackoverflow.com/questions/30731785/how-do-i-load-an-http-url-with-app-transport-security-enabled-in-ios-9)

@skylineproject same issue here (just tested on Android) can anyone tell me what they did to fix?
I tried @rakeshlanjewarwork solution but without success (file was not exactly has described here not sure if that is the problem) ... any help would be great thanks.

I just tested redirects with webview_flutter 0.3.10+3 and it's working for me.
I tested on Android O and Android M devices (to cover both the WebViewClientCompat and WebViewClient code paths), and on an iOS device.
Loading https://flutter.io which redirects to https://flutter.dev works for me on both Android and iOS.
As @skylineproject mentioned in https://github.com/flutter/flutter/issues/25351#issuecomment-513891490 iOS is not allowing http connections by default, but you can add an Info.plist key to enable it. With the Info.plist key loading http://flutter.io which redirects to https://flutter.dev worked on all tested devices.
@pedrosalesmiranda which webview_flutter version are you using? which device and OS version? can you share a sample url that's not loading for you?

My bad here. I tought ^0.1.1 was getting the last version of minor but nop. So i just changed .yaml to   webview_flutter: 0.3.10+3
and redirects are working now. I just have problem with loading images now but i will research first to see what i find out. Thank you @amirh

Great, I'm closing this issue then.
If someone still sees a problem with redirect please reopen.

Hi all, I do not know if my issue related to redirections, problem is that I can not open simple html page on my server which is not HTTPS (for example http://<MY_IP_ADDRESS>/stats.html) but it can be opened in browser. Also I've tested example on Android https://github.com/flutter/plugins/tree/master/packages/webview_flutter/example  it's also not work with initial URL 'http://google.com'

@mavr301 to load http sites on iOS
you need to add new key to ios/Runner/Info.plist
<key>NSAppTransportSecurity</key> <dict>     <key>NSAllowsArbitraryLoads</key>     <true/>     <key>NSAllowsArbitraryLoadsInWebContent</key>     <true/> </dict>

https://www.pleatsbouttique.com
This still shows white screen and fails to redirect. I tried 0.3.10+3 still no luck :/

I just tested redirects with webview_flutter 0.3.10+3 and it's working for me.
I tested on Android O and Android M devices (to cover both the WebViewClientCompat and WebViewClient code paths), and on an iOS device.
Loading https://flutter.io which redirects to https://flutter.dev works for me on both Android and iOS.
As @skylineproject mentioned in #25351 (comment) iOS is not allowing http connections by default, but you can add an Info.plist key to enable it. With the Info.plist key loading http://flutter.io which redirects to https://flutter.dev worked on all tested devices.
@pedrosalesmiranda which webview_flutter version are you using? which device and OS version? can you share a sample url that's not loading for you?

https://www.pleatsbouttique.com
This still shows white screen and fails to redirect. I tried 0.3.10+3 still no luck :/

@mavr301 to load http sites on iOS
you need to add new key to ios/Runner/Info.plist
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSAllowsArbitraryLoadsInWebContent</key> <true/> </dict>

Worked for me, thx!

I'm using webview_flutter 0.3.18+1
if url has 302 redirect android will be shown Webpage not available.
net::ERR_UNKNOWN_URL_SCHEME
https://forms.gle/UYTCutLKbSGdDUw99
=> https://docs.google.com/forms/d/e/1FAIpQLSdPjIjDbhSKiF5z8mVfosk9Z0wql9_-CnwZxnaXehWbgPckyg/viewform?usp=send_form
Not everything doesn't work.
especially if it is 302 responses in HTTP/2.
here is CURL exceute result
$ curl -I https://forms.gle/UYTCutLKbSGdDUw99
HTTP/2 302
cache-control: no-cache, no-store, max-age=0, must-revalidate
content-security-policy: script-src 'nonce-Q2Wa/q0LgbuqorGQEegIoQ' 'unsafe-inline';object-src 'none';base-uri 'self';report-uri /_/DurableDeepLinkUi/cspreport;worker-src 'self'
content-type: application/binary
expires: Mon, 01 Jan 1990 00:00:00 GMT
location: https://docs.google.com/forms/d/e/1FAIpQLSdPjIjDbhSKiF5z8mVfosk9Z0wql9_-CnwZxnaXehWbgPckyg/viewform?usp=send_form
pragma: no-cache
server: ESF
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
accept-ranges: bytes
accept-ranges: bytes
date: Tue, 17 Mar 2020 13:06:08 GMT
x-served-by: cache-tyo19949-TYO
x-cache: MISS
x-cache-hits: 0
x-timer: S1584450368.985180,VS0,VE310
vary: x-fh-requested-host, accept-encoding
content-length: 0

any idea? thank you :)

authors: AliSayed Smarto-Dev amirh dakamojo knitero mavr301 myriky pedrosalesmiranda phaniteja1 piyushsinha24 rakeshlanjewarwork realcarlos skylineproject woutervanwijk zoechi zxl777


text:
flutter_gallery__back_button_memory is flaky

Seems to have started being flaky around 19ce65eec923535d5d0daf580429a2d23596dffd

Might be related to https://github.com/flutter/flutter/issues/25481

Reopening this.  It seems to flake out every few days now.  Rebooting the device seems to help.

authors: amirh dnfield


text:
Extended FABs don’t require an icon

This issue is a bug report.
Description
In Material design, an extended FAB doesn’t require an icon.
https://material.io/design/components/buttons-floating-action-button.html#extended-fab

So, I think the @required below should be removed.
https://github.com/flutter/flutter/blob/216a65b6697f2ca5cf3501e50c3f9592334fbe4b/packages/flutter/lib/src/material/floating_action_button.dart#L116
If you guys agree, I can create a pull request to fix it.
Steps to Reproduce

null
Logs

null

Good point, will fix this.

@HansMuller you saw that there is already a PR? #27711

@zoechi I have seen #27711, thanks for the reminder

authors: HansMuller ocavue zoechi


text:
pluginization

Does flutter support pluginization?How to do?

Flutter has a rich plugin system - https://flutter.dev/docs/development/packages-and-plugins/developing-packages
I'm going to close this as it's not really a feature request or a bug report.
For general support questions like this, please consider using one of the other channels at https://flutter.dev/community.

I will pay attention later, thank you!