Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am new to flutter and i am developing flutter app I want to call a function inside the column but it said null values.i have tried to show the Title1() function inside the Photo() class but it shows error. #9

Open
Natnael3344 opened this issue Aug 26, 2020 · 0 comments

Comments

@Natnael3344
Copy link

[class Internal extends StatefulWidget{

      @override
      _InternalState createState()=>_InternalState();
    
    }
    class _InternalState extends State<Internal> {
    
      bool isSearching=false;
      Photo(int number,){
        return Scaffold(
          backgroundColor: Color(0XFFfffafa),
          body: SafeArea(
          child: SingleChildScrollView(
            child: Container(
              child: Stack(
                children: <Widget>[
                  Container(
                    height: 19,
                    child: Padding(
                      padding: const EdgeInsets.only(right:360.0),
                      child: IconButton(icon: Icon(Icons.arrow_back,color: Colors.black,size: 30,), onPressed: (){
                        Navigator.push(
                          context,
                          MaterialPageRoute(builder: (context) => Internal()),
                        );
    
                      }),
                    ),
                  ),
                Title1(number),
                ClipRRect(
                  borderRadius: BorderRadius.only(topRight: Radius.circular(40.0),topLeft: Radius.circular(40.0)),
                  child: Image(image:  AssetImage('images/song$number.jpg'),),
                ),
                ],
              ),
            ),
          ),
        ),
    Title1(int number){
      number=1;
      Container(
        margin: EdgeInsets.only(left:37.0,right: 37,bottom: 10),
        child: Center(child: Text('Tempo : 102\nStyle : Waltz\nChord : C\nTranspose : 4',
          style: TextStyle(color: Colors.white,fontFamily: 'SourceSansPro',fontWeight: FontWeight.w600,fontSize: 20),)),
        height: 120.0,
        width: 380,
        decoration: BoxDecoration(shape: BoxShape.rectangle,color: Color(0XFF40404F),borderRadius: BorderRadius.circular(20.0)),
      );
      number=2;
      Container(
        margin: EdgeInsets.only(left:37.0,right: 37,bottom: 10),
        child: Center(child: Text('Tempo : 102\nStyle : Waltz\nChord : C\nTranspose : 2',
          style: TextStyle(color: Colors.white,fontFamily: 'SourceSansPro',fontWeight: FontWeight.w600,fontSize: 20),)),
        height: 120.0,
        width: 380,
        decoration: BoxDecoration(shape: BoxShape.rectangle,color: Color(0XFF40404F),borderRadius: BorderRadius.circular(20.0)),
      );
    }
    );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant