Dart
import 'package:flutter/material.dart';import 'package:flutter/cupertino.dart'; class PushNotification extends StatefulWidget { const PushNotification({Key? key}) : super(key: key); State<PushNotification> createState() => _PushNotification();} class _PushNotification extends State<PushNotification> { bool _isOn1 = true; bool _isOn2 = true; bool _isOn3 = true; bool _isOn4 = true; bool _isOn5 = true; bool _isOn6 = true; Widget build(BuildContext context) { final double deviceHeight = MediaQuery.of(context).size.height; final double devicewWdth = MediaQuery.of(context).size.width; return Scaffold( backgroundColor: Color.fromARGB(255, 243, 243, 243), appBar: PreferredSize( preferredSize: Size.fromHeight(70), child: AppBar( iconTheme: IconThemeData(color: Colors.black, size: 23), leadingWidth: devicewWdth * 0.2, backgroundColor: Color.fromARGB(255, 243, 243, 243), elevation: 0.0, centerTitle: true, title: Text('プッシュ通知', style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, color: Colors.black)), bottom: PreferredSize( child: Container( height: 0.3, color: Color.fromARGB(255, 156, 156, 156), ), preferredSize: Size.fromHeight(5)), ), ), body: Center( child: Container( color: Color.fromARGB(255, 243, 243, 243), child: Column( children: <Widget>[ Container( height: deviceHeight * 0.08, width: devicewWdth, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Color.fromARGB(255, 156, 156, 156), width: 0.3, ), ), color: Colors.white, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Row( children: const <Widget>[ Text('スイッチ'), ], ), CupertinoSwitch( value: _isOn1, onChanged: (bool? value) => setState(() => _isOn1 = value!), ), ], ), ), ], ), ), ), ); }}

0 コメント