does anyone know how to achieve a CircularProgressIndicator() as on the screenshot below in Flutter?
That's the IOS equivalent of the CircularProgressIndicator(). You can use CupertinoActivityIndicator. Here is a YouTube video by the Google team on how to use it.
You have to import cupertino first:
import 'package:flutter/cupertino.dart';
...
return CupertinoActivityIndicator()
Result:
Related
How to solve this. In flutter i have imported the import 'package:webview_flutter/webview_flutter.dart';
package but still the WebView is showing error :
The method 'WebView isn't defined for the type' Article PageState.:39
How can I hide the topbar of an app in flutter? I want to restrict users from closing the app.
Solution:
Add to dependencies window_manager: ^0.2.8
Import in main.dart import 'package:window_manager/window_manager.dart';
Place the following code
runApp(App());
windowManager.waitUntilReadyToShow().then((_) async{
await windowManager.setTitleBarStyle(TitleBarStyle.hidden);
});
How to disable screenshot in flutter? I have Kotlin file instead of MainActivity.java file. Please suggest full code with path where I need to change for disable screenshot in my app.
package com.quotster.untitled
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
If you want to do that in Android only you can use flutter_windowmanager and add FLAG_SECURE.
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);
How to create (and is it a good practice) a Flutter app which shows Cupertino UI widgets at iOS and Material UI widgets at Android with same functionality?
Import import 'dart:io'
And then in your widget make if statement
if(Platform.isIOS){
...
} else {
...
}
I found Flutter Platform Widgets package, works fine
I would like to show the native date picker depending on the device. For example UIDatePicker if it's iOS.
I've tried to add SelectDateTextField inside my widget and it works, but it looks like the Android one. Does anyone have any recommendations?
You should check the Platform then need to write specific widgets as per your need.
Use the APIs provided by the Dart.
Example:
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
Your Widget
Platform.isIOS ? CupertinoWidget() : MaterialWidget()