Hello! Mr.Rein ! I just wanted use simply " Japan style example " in my own project ( in main.dart ) but i am sure now it doesn't use " simply " as i though.
//// >>>>> CODE START <<<<<////
import 'package:flutter/material.dart';
import 'package:styled_widget/styled_widget.dart';
import 'user_card.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'UYGULAMA ADI'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
missionCard(
cardColor: Colors.lightBlue,
cardOwnder: "assets/userAvatar.png",
cardMission1: "",
cardMission2: "",
),
SizedBox(height: 60),
//// >>>>> japan style example START <<<<< ////
Styled.widget() // red circle
.backgroundColor(Color(0xffFF6160))
.constrained(width: 100, height: 100)
.clipOval()
.gestures(
onTap: () => showBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext context) => BottomSheet(),
),
),
//// >>>>> japan style example END <<<<<////
],
),
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}
//// >>>>> Japan style example CLASS START <<<<<////
class BottomSheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text('サインアップ') // button
.textColor(Colors.white)
.fontSize(24)
.padding(vertical: 15, horizontal: 30)
.decorated(
color: Color(0xff41508D),
borderRadius: BorderRadius.circular(35),
)
.gestures(onTap: () => Navigator.pop(context)),
Text('サインイン') // bottom description
.fontSize(18)
.textColor(Color(0xff455178))
.padding(vertical: 30),
],
)
.constrained(
height: 380,
width: MediaQuery.of(context).size.width,
)
.padding(all: 10)
.backgroundBlur(20)
.clipRect();
}
}
//// >>>>> Japan style example CLASS END <<<<<//// ```
//// >>>>> CODE END <<<<<////
And, i check `flutter doctor` and there is no issue.
There is no warning in Android Studio with this code. When i click "run" , app uploaded well on my phone without any warning. There is red button on my phone screen ( as Japanese Flag ) . But problem has start when i click this red button.
Here is " 4: RUN " warning screen after i click red button where on my screen :
//// >>>>> WARNING SCREEN <<<<<////
`
════════ Exception caught by gesture ═══════════════════════════════════════════════════════════════
The following assertion was thrown while handling a gesture:
No Scaffold widget found.
MyHomePage widgets require a Scaffold widget ancestor.
The specific widget that could not find a Scaffold ancestor was: MyHomePage
state: _MyHomePageState#b2c07
The ancestors of this widget were:
: MaterialApp
state: _MaterialAppState#39fad
: MyApp
...
Typically, the Scaffold widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree.
When the exception was thrown, this was the stack:
#0 debugCheckHasScaffold.<anonymous closure> (package:flutter/src/material/debug.dart:112:7)
#1 debugCheckHasScaffold (package:flutter/src/material/debug.dart:123:4)
#2 showBottomSheet (package:flutter/src/material/bottom_sheet.dart:534:10)
#3 _MyHomePageState.build.<anonymous closure> (package:flatmate/main.dart:73:28)
#4 StyledWidget.gestures.<anonymous closure> (package:styled_widget/src/extensions/widget_extension.dart:949:35)
...
Handler: "onTap"
Recognizer: TapGestureRecognizer#f7306
debugOwner: GestureDetector
state: possible
won arena
finalPosition: Offset(186.7, 573.7)
finalLocalPosition: Offset(56.7, 53.7)
button: 1
sent tap down
════════════════════════════════════════════════════════════════════════════════════════════════════
`
Do you have any idea how i can solve this problem ? I hope you would help me .
But in any case , its good work. I am almost new here and i hope i can done some good project as like you .
Thanks for all !