Flutter

How to change BottomNavigationBar background colour?

牧云@^-^@ 提交于 2021-02-08 19:42:54
问题 Im making a simple app with tab bars. I need to change Bottom Navigation Bar's background colour to blue. The rest of the app should be in white background and navigation bar should be blue backgrounded. How should I do that? Setting canvasColor in ThemeData didnt work. Heres my code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { State<StatefulWidget> createState(){ return MyAppState(); } } class MyAppState extends State<MyApp>{

How to change BottomNavigationBar background colour?

拈花ヽ惹草 提交于 2021-02-08 19:42:50
问题 Im making a simple app with tab bars. I need to change Bottom Navigation Bar's background colour to blue. The rest of the app should be in white background and navigation bar should be blue backgrounded. How should I do that? Setting canvasColor in ThemeData didnt work. Heres my code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { State<StatefulWidget> createState(){ return MyAppState(); } } class MyAppState extends State<MyApp>{

how to add multiple ChangeNotifierProvider in same type in Flutter

左心房为你撑大大i 提交于 2021-02-08 19:42:05
问题 Is it possible to add same type multiple ChangeNotifierProvider? return MultiProvider( providers: [ ChangeNotifierProvider<ValueNotifier<double>>( create: (_) => ValueNotifier<double>(0.0), ), ChangeNotifierProvider<ValueNotifier<double>>( create: (_) => ValueNotifier<double>(0.0), ), ], In my build method @override Widget build(BuildContext context) { ValueNotifier<double> firstNotifier = Provider.of(context, listen: true); ValueNotifier<double> secondNotifier = Provider.of(context, listen:

How to filter a list of obseravble in rxdart

房东的猫 提交于 2021-02-08 19:41:59
问题 I am trying to implement bloc pattern in rxdart . I am trying to build todo app type of app . I implemented showing all items in list but what I want is not to show completed and uncompleted items in different part . However I am not able to filter the items based on completed on rxdart . import 'package:rxdart/rxdart.dart'; import '../models/ShoppingItem.dart'; class ShoppingItemBloc { final _shoppingItems = BehaviorSubject<List<ShoppingItem>> (seedValue: []); Observable<List<ShoppingItem>>

How to filter a list of obseravble in rxdart

梦想的初衷 提交于 2021-02-08 19:39:10
问题 I am trying to implement bloc pattern in rxdart . I am trying to build todo app type of app . I implemented showing all items in list but what I want is not to show completed and uncompleted items in different part . However I am not able to filter the items based on completed on rxdart . import 'package:rxdart/rxdart.dart'; import '../models/ShoppingItem.dart'; class ShoppingItemBloc { final _shoppingItems = BehaviorSubject<List<ShoppingItem>> (seedValue: []); Observable<List<ShoppingItem>>

flutter layout-child

此生再无相见时 提交于 2021-02-08 16:50:35
一、Container 二、Padding 三、Center 四、Align 五、FittedBox 六、AspectRatio 七、 ConstrainedBox 八、Baseline 九、FractionallySizedBox 十、IntrinsicHeight 十一、IntrinsicWidth 十二、LimitedBox 十三、Offstage 十四、OverflowBox 十五、SizedBox 十六、SizedOverflowBox 十七、Transform 十八、CustomSingleChildLayout 来源: oschina 链接: https://my.oschina.net/u/4283724/blog/3540264

Material App styles doesn't work without Scaffold

大兔子大兔子 提交于 2021-02-08 16:42:12
问题 I'm trying to create a Material design app without the Scaffold element: Here is the purely default app: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super

Material App styles doesn't work without Scaffold

╄→尐↘猪︶ㄣ 提交于 2021-02-08 16:40:15
问题 I'm trying to create a Material design app without the Scaffold element: Here is the purely default app: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super

How to check if user is already logged in using Google Sign in and Firebase Auth to retrieve their data?

自闭症网瘾萝莉.ら 提交于 2021-02-08 15:27:53
问题 I have a simple game made in Flutter and I can log in the user but I don't know how to check if the user is logged and how to get user's data if so. For log in I am using this method, after log in the user I can get his data: Future<String> signInWithGoogle() async{ print("INICIALIZANDO LOGIN COM GOOGLE..."); googleSignInAccount = await googleSignIn.signIn(); googleSignInAuthentication = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider

How to check if user is already logged in using Google Sign in and Firebase Auth to retrieve their data?

安稳与你 提交于 2021-02-08 15:27:11
问题 I have a simple game made in Flutter and I can log in the user but I don't know how to check if the user is logged and how to get user's data if so. For log in I am using this method, after log in the user I can get his data: Future<String> signInWithGoogle() async{ print("INICIALIZANDO LOGIN COM GOOGLE..."); googleSignInAccount = await googleSignIn.signIn(); googleSignInAuthentication = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider