「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
Flutter の step by step(其の四)。
// main.dart Form( child: Column( children: [ TextFormField( decoration: InputDecoration(labelText: 'id'), ), TextFormField( decoration: InputDecoration(labelText: 'password'), obscureText: true, // 追加 ), ], ), )
decodeするdart:convertライブラリのサンプルが複数ある。
DBの一覧ならList<dynamic>になる。
以下のように実装する。
onTap: () { while(Navigator.of(context).canPop()){ Navigator.of(context).pop(); } },
onTap: () { while(Navigator.of(context).canPop()){ Navigator.of(context).pop(); } Navigator.of(context).pushNamed("/appauth"); },
みたいな。
import 'package:flutter/material.dart'; class MyDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer(
return Scaffold( ..., drawer: MyDrawer(), );
import 'package:flutter/material.dart'; class MyElevatedButton extends StatelessWidget { final String _caption; final VoidCallback _onPressed; const MyElevatedButton( this._caption, this._onPressed, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { return ElevatedButton( child: Text(this._caption), ..., ), onPressed: this._onPressed, ); } }
MyElevatedButton('EnglishWords Button', this._englishWords),
class CounterFormField extends FormField<int> { CounterFormField({ FormFieldSetter<int> onSaved, FormFieldValidator<int> validator, int initialValue = 0, bool autovalidate = false }) : super( onSaved: onSaved, validator: validator, initialValue: initialValue, autovalidate: autovalidate, builder: (FormFieldState<int> state) { return Row( この中で、state.valueとかstate.didChangeが使える。 ); } ); }
CounterFormField( autovalidate: false, validator: (value) { ... }, onSaved: (value) => this._value = value, )
全体構成の見直し の 各フォルダに入れる。
→ configs
→ helpers
→ services